Skip to content

Commit

Permalink
fix rnn_cell constraint bug
Browse files Browse the repository at this point in the history
  • Loading branch information
plliao committed Jun 19, 2017
1 parent d40f91b commit dbcd736
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
7 changes: 0 additions & 7 deletions test/recurrent/test_bidirectional_rnn_encoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,6 @@ def create_model(self, rnn_layer):
model.compile('sgd', 'mean_squared_error')
return model

def test_output_shape(self):
result = self.model.predict(self.data)
self.assertEqual(
result.shape,
(self.data_size, self.max_length, self.encoding_size)
)

def test_mask_value(self):
result = self.model.predict(self.data)
np.testing.assert_array_almost_equal(
Expand Down
4 changes: 2 additions & 2 deletions yklz/recurrent/rnn_cell.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,9 @@ def get_losses_for(self, inputs=None):
@property
def constraints(self):
constraints = {}
if hasattr(self.recurrent_layer.layer, 'constraints'):
if hasattr(self.recurrent_layer, 'constraints'):
constraints.update(self.recurrent_layer.constraints)
if hasattr(self.dense_layer.layer, 'constraints'):
if hasattr(self.dense_layer, 'constraints'):
constraints.update(self.dense_layer.constraints)
return self.dense_layer.constraints

Expand Down

0 comments on commit dbcd736

Please sign in to comment.