Skip to content

Commit

Permalink
legibility
Browse files Browse the repository at this point in the history
  • Loading branch information
bquast committed May 6, 2016
1 parent 84a45cd commit c11b38a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions R/trainr.R
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,11 @@ trainr <- function(Y, X, learningrate, learningrate_decay = 1, momentum = 0, hid
# layer_1_values = rbind(layer_1_values, matrix(0, nrow=1, ncol=hidden_dim))

# time index vector, needed because we predict in one direction but update the weight in an other
if(start_from_end == T){
pos_vec <- binary_dim:1
if(start_from_end == TRUE) {
pos_vec <- binary_dim:1
pos_vec_back <- 1:binary_dim
}else{
pos_vec <- 1:binary_dim
} else {
pos_vec <- 1:binary_dim
pos_vec_back <- binary_dim:1
}

Expand Down Expand Up @@ -144,8 +144,8 @@ trainr <- function(Y, X, learningrate, learningrate_decay = 1, momentum = 0, hid
# Weight iteration,
for (position in 0:(binary_dim-1)) {

x =a[pos_vec_back[position+1],]
layer_1 = layer_1_values[dim(layer_1_values)[1]-position,]
x = a[pos_vec_back[position+1],]
layer_1 = layer_1_values[dim(layer_1_values)[1]-position,]
prev_layer_1 = layer_1_values[dim(layer_1_values)[1]-(position+1),]

# error at output layer
Expand Down

0 comments on commit c11b38a

Please sign in to comment.