Skip to content

Commit

Permalink
Merge pull request #1188 from goodfeli/doc
Browse files Browse the repository at this point in the history
Document DBM stuff
  • Loading branch information
Ian Goodfellow committed Oct 21, 2014
2 parents da31911 + 34dae86 commit 3be2a6d
Show file tree
Hide file tree
Showing 5 changed files with 599 additions and 446 deletions.
2 changes: 1 addition & 1 deletion pylearn2/devtools/nan_guard.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,4 @@ def nan_check(i, node, fn):
do_check_on(x, node, fn, False)

wrap_linker = theano.gof.WrapLinkerMany([theano.gof.OpWiseCLinker()], [nan_check])
super(NanGuardMode, self).__init__(wrap_linker, optimizer='fast_run')
super(NanGuardMode, self).__init__(wrap_linker, optimizer=theano.config.optimizer)
2 changes: 0 additions & 2 deletions pylearn2/devtools/tests/test_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
"models/dbm/layer.py",
"models/dbm/__init__.py",
"models/dbm/ising.py",
"models/dbm/inference_procedure.py",
"models/differentiable_sparse_coding.py",
"models/local_coordinate_coding.py",
"models/mnd.py",
Expand Down Expand Up @@ -319,7 +318,6 @@
'models/dbm/__init__.py',
'models/dbm/dbm.py',
'models/dbm/ising.py',
'models/dbm/inference_procedure.py',
'models/differentiable_sparse_coding.py',
'models/local_coordinate_coding.py',
'models/maxout.py',
Expand Down
16 changes: 8 additions & 8 deletions pylearn2/expr/nnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ def inverse_sigmoid_numpy(x):

def arg_of_softmax(Y_hat):
"""
.. todo::
WRITEME properly
Given the output of a call to theano.tensor.nnet.softmax,
returns the argument to the softmax (by tracing the Theano
graph).
Parameters
----------
Expand Down Expand Up @@ -138,7 +138,7 @@ def kl(Y, Y_hat, batch_axis):
ave : Variable
average kl divergence between Y and Y_hat.
"""

assert hasattr(Y_hat, 'owner')
assert batch_axis is not None

Expand All @@ -150,12 +150,12 @@ def kl(Y, Y_hat, batch_axis):
raise ValueError("Expected Y_hat to be generated by an Elemwise "
"op, got "+str(op)+" of type "+str(type(op)))
assert isinstance(op.scalar_op, T.nnet.sigm.ScalarSigmoid)

for Yv in get_debug_values(Y):
if not (Yv.min() >= 0.0 and Yv.max() <= 1.0):
raise ValueError("Expected Y to be between 0 and 1. Either Y"
+ "< 0 or Y > 1 was found in the input.")

z, = owner.inputs

term_1 = Y * T.nnet.softplus(-z)
Expand Down Expand Up @@ -207,12 +207,12 @@ def elemwise_kl(Y, Y_hat):
raise ValueError("Expected Y_hat to be generated by an Elemwise "
"op, got "+str(op)+" of type "+str(type(op)))
assert isinstance(op.scalar_op, T.nnet.sigm.ScalarSigmoid)

for Yv in get_debug_values(Y):
if not (Yv.min() >= 0.0 and Yv.max() <= 1.0):
raise ValueError("Expected Y to be between 0 and 1. Either Y"
+ "< 0 or Y > 1 was found in the input.")

z, = owner.inputs

term_1 = Y * T.nnet.softplus(-z)
Expand Down
Loading

0 comments on commit 3be2a6d

Please sign in to comment.