Skip to content

Commit

Permalink
Don't return bias in reservoir states during training.
Browse files Browse the repository at this point in the history
  • Loading branch information
nschaetti committed Jan 29, 2019
1 parent e2e281c commit a122411
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion echotorch/nn/RRCell.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,13 @@ def forward(self, x, y=None):
self.xTx.data.add_(x[b].t().mm(x[b]).data)
self.xTy.data.add_(x[b].t().mm(y[b]).data)
# end for
return x

# Bias or not
if self.with_bias:
return x[:, :, 1:]
else:
return x
# end if
elif not self.training:
# Outputs
outputs = Variable(torch.zeros(batch_size, time_length, self.output_dim), requires_grad=False)
Expand Down

0 comments on commit a122411

Please sign in to comment.