Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
13530934
baselines
Commits
2361220d
Commit
2361220d
authored
May 25, 2017
by
Aaron Morris
Committed by
AAorris
May 25, 2017
Browse files
tf_util: spelling / docstring updates
parent
7327a156
Changes
1
Hide whitespace changes
Inline
Side-by-side
baselines/common/tf_util.py
View file @
2361220d
...
...
@@ -52,7 +52,7 @@ def argmax(x, axis=None):
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`
should be symbolic tensors of the *same shape*.
...
...
@@ -60,7 +60,7 @@ def switch(condition, then_expression, else_expression):
condition: scalar tensor.
then_expression: TensorFlow operation.
else_expression: TensorFlow operation.
'''
"""
x_shape
=
copy
.
copy
(
then_expression
.
get_shape
())
x
=
tf
.
cond
(
tf
.
cast
(
condition
,
'bool'
),
lambda
:
then_expression
,
...
...
@@ -362,9 +362,9 @@ def dropout(x, pkeep, phase=None, mask=None):
def
function
(
inputs
,
outputs
,
updates
=
None
,
givens
=
None
):
"""Just like Theano function. Take a bunch of tensorflow placeholders and exp
e
rsions
"""Just like Theano function. Take a bunch of tensorflow placeholders and expr
es
sions
computed based on those placeholders and produces f(inputs) -> outputs. Function f takes
values to be fe
e
d to the inputs placeholders and produces the values of the exp
e
ressions
values to be fed to the input
'
s placeholders and produces the values of the expressions
in outputs.
Input values can be passed in the same order as inputs or can be provided as kwargs based
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment