Skip to content

Commit

Permalink
Merge pull request #679 from f0k/change-rrelu-test
Browse files Browse the repository at this point in the history
Update RReLU tests for updated T.nnet.relu function
  • Loading branch information
benanne committed May 13, 2016
2 parents b729690 + 6ead6b8 commit 31ac7d2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lasagne/tests/layers/test_special.py
Original file line number Diff line number Diff line change
Expand Up @@ -707,13 +707,14 @@ def test_nomod_positive(self, RandomizedRectifierLayer):
def test_low_eq_high(self, RandomizedRectifierLayer):
input = np.ones((3, 3, 28, 28)).astype(theano.config.floatX) * -1
layer = RandomizedRectifierLayer(input.shape, lower=0.5, upper=0.5)
out = layer.get_output_for(input)
out = layer.get_output_for(theano.tensor.constant(input)).eval()
assert np.allclose(out, -0.5)

def test_deterministic(self, RandomizedRectifierLayer):
input = np.ones((3, 3, 28, 28)).astype(theano.config.floatX) * -1
layer = RandomizedRectifierLayer(input.shape, lower=0.4, upper=0.6)
out = layer.get_output_for(input, deterministic=True)
out = layer.get_output_for(theano.tensor.constant(input),
deterministic=True).eval()
assert np.allclose(out, -0.5)

def test_dim_None(self, RandomizedRectifierLayer):
Expand Down

0 comments on commit 31ac7d2

Please sign in to comment.