Skip to content

Commit

Permalink
fixing some gcc warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Ricardicus committed Dec 23, 2019
1 parent 3416250 commit 78b406f
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ net
# and files that doxygen produce are not kept under version control
docs/latex
docs/html

# Object files
*.o
7 changes: 4 additions & 3 deletions lstm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1611,8 +1611,9 @@ void lstm_train(lstm_model_t** model_layers, lstm_model_parameters_t *params,
set_t* char_index_mapping, unsigned int training_points,
int* X_train, int* Y_train, unsigned int layers)
{
int status = 0, p;
unsigned int i = 0, b = 0, q = 0, e1 = 0, e2 = 0, e3, record_iteration = 0, tmp_count, trailing;
int status = 0;
unsigned int p, i = 0, b = 0, q = 0, e1 = 0, e2 = 0,
e3, record_iteration = 0, tmp_count, trailing;
unsigned long n = 0, epoch = 0;
double loss = -1, loss_tmp = 0.0, record_keeper = 0.0;
double initial_learning_rate = params->learning_rate;
Expand Down Expand Up @@ -1769,7 +1770,7 @@ void lstm_train(lstm_model_t** model_layers, lstm_model_parameters_t *params,

if ( p > 0 ) {
--p;
while ( p >= 0 ) {
while ( p >= 0 && p <= layers - 1 ) {
lstm_forward_propagate(model_layers[p],
cache_layers[p+1][e2]->probs,
cache_layers[p][e1],
Expand Down
10 changes: 5 additions & 5 deletions lstm.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,17 +100,17 @@ typedef struct lstm_model_parameters_t {
char *store_char_indx_map_name;

// General parameters
int mini_batch_size;
unsigned int mini_batch_size;
double gradient_clip_limit;
unsigned long iterations;
} lstm_model_parameters_t;

typedef struct lstm_model_t
{
int X; /**< Number of input nodes */
int N; /**< Number of neurons */
int Y; /**< Number of output nodes */
int S; /**< lstm_model_t.X + lstm_model_t.N */
unsigned int X; /**< Number of input nodes */
unsigned int N; /**< Number of neurons */
unsigned int Y; /**< Number of output nodes */
unsigned int S; /**< lstm_model_t.X + lstm_model_t.N */

// Parameters
lstm_model_parameters_t * params;
Expand Down
10 changes: 5 additions & 5 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ CC := gcc
FLAGS := O3 Ofast msse3
LIBS := m
GCC_HINTS := all \
unused \
uninitialized \
no-unused-variable \
extra \
unused-parameter
unused \
uninitialized \
no-unused-variable \
extra \
unused-parameter

.PHONY : net clean

Expand Down

0 comments on commit 78b406f

Please sign in to comment.