Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
ResNet50_tensorflow
Commits
44bdf29f
Commit
44bdf29f
authored
Jul 18, 2017
by
Allen Lavoie
Browse files
Shape fix for LFADS tf.case statements
parent
a57a00f6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
lfads/lfads.py
lfads/lfads.py
+9
-5
No files found.
lfads/lfads.py
View file @
44bdf29f
...
...
@@ -432,11 +432,15 @@ class LFADS(object):
pf_pairs_out_fac_Ws
=
zip
(
preds
,
fns_out_fac_Ws
)
pf_pairs_out_fac_bs
=
zip
(
preds
,
fns_out_fac_bs
)
case_default
=
lambda
:
tf
.
constant
([
-
8675309.0
])
this_in_fac_W
=
tf
.
case
(
pf_pairs_in_fac_Ws
,
case_default
,
exclusive
=
True
)
this_in_fac_b
=
tf
.
case
(
pf_pairs_in_fac_bs
,
case_default
,
exclusive
=
True
)
this_out_fac_W
=
tf
.
case
(
pf_pairs_out_fac_Ws
,
case_default
,
exclusive
=
True
)
this_out_fac_b
=
tf
.
case
(
pf_pairs_out_fac_bs
,
case_default
,
exclusive
=
True
)
def
_case_with_no_default
(
pairs
):
def
_default_value_fn
():
with
tf
.
control_dependencies
([
tf
.
Assert
(
False
,
[
"Reached default"
])]):
return
tf
.
identity
(
pairs
[
0
][
1
]())
return
tf
.
case
(
pairs
,
_default_value_fn
,
exclusive
=
True
)
this_in_fac_W
=
_case_with_no_default
(
pf_pairs_in_fac_Ws
)
this_in_fac_b
=
_case_with_no_default
(
pf_pairs_in_fac_bs
)
this_out_fac_W
=
_case_with_no_default
(
pf_pairs_out_fac_Ws
)
this_out_fac_b
=
_case_with_no_default
(
pf_pairs_out_fac_bs
)
# External inputs (not changing by dataset, by definition).
if
hps
.
ext_input_dim
>
0
:
...
...
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