Commit 5c80997d authored by Szymon Sidor's avatar Szymon Sidor Committed by GitHub
Browse files

Merge pull request #9 from AAorris/patch-1

tf_util: spelling / docstring updates
parents 7327a156 2361220d
...@@ -52,7 +52,7 @@ def argmax(x, axis=None): ...@@ -52,7 +52,7 @@ def argmax(x, axis=None):
def switch(condition, then_expression, else_expression): def switch(condition, then_expression, else_expression):
'''Switches between two operations depending on a scalar value (int or bool). """Switches between two operations depending on a scalar value (int or bool).
Note that both `then_expression` and `else_expression` Note that both `then_expression` and `else_expression`
should be symbolic tensors of the *same shape*. should be symbolic tensors of the *same shape*.
...@@ -60,7 +60,7 @@ def switch(condition, then_expression, else_expression): ...@@ -60,7 +60,7 @@ def switch(condition, then_expression, else_expression):
condition: scalar tensor. condition: scalar tensor.
then_expression: TensorFlow operation. then_expression: TensorFlow operation.
else_expression: TensorFlow operation. else_expression: TensorFlow operation.
''' """
x_shape = copy.copy(then_expression.get_shape()) x_shape = copy.copy(then_expression.get_shape())
x = tf.cond(tf.cast(condition, 'bool'), x = tf.cond(tf.cast(condition, 'bool'),
lambda: then_expression, lambda: then_expression,
...@@ -362,9 +362,9 @@ def dropout(x, pkeep, phase=None, mask=None): ...@@ -362,9 +362,9 @@ def dropout(x, pkeep, phase=None, mask=None):
def function(inputs, outputs, updates=None, givens=None): def function(inputs, outputs, updates=None, givens=None):
"""Just like Theano function. Take a bunch of tensorflow placeholders and expersions """Just like Theano function. Take a bunch of tensorflow placeholders and expressions
computed based on those placeholders and produces f(inputs) -> outputs. Function f takes computed based on those placeholders and produces f(inputs) -> outputs. Function f takes
values to be feed to the inputs placeholders and produces the values of the experessions values to be fed to the input's placeholders and produces the values of the expressions
in outputs. in outputs.
Input values can be passed in the same order as inputs or can be provided as kwargs based Input values can be passed in the same order as inputs or can be provided as kwargs based
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment