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
2a5f2a95
Commit
2a5f2a95
authored
Jul 18, 2017
by
David Sussillo
Committed by
GitHub
Jul 18, 2017
Browse files
Merge pull request #1984 from allenlavoie/master
Shape fix for LFADS tf.case statements
parents
504bc193
fd6da687
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
8 deletions
+10
-8
lfads/README.md
lfads/README.md
+1
-3
lfads/lfads.py
lfads/lfads.py
+9
-5
No files found.
lfads/README.md
View file @
2a5f2a95
...
@@ -7,9 +7,7 @@ This code implements the model from the paper "[LFADS - Latent Factor Analysis v
...
@@ -7,9 +7,7 @@ This code implements the model from the paper "[LFADS - Latent Factor Analysis v
The code is written in Python 2.7.6. You will also need:
The code is written in Python 2.7.6. You will also need:
*
**TensorFlow**
version 1.1 (
[
install
](
http://tflearn.org/installation/
)
) -
*
**TensorFlow**
version 1.2.1 (
[
install
](
https://www.tensorflow.org/install/
)
) -
there is an incompatibility with LFADS and TF v1.2, which we are in the
process of resolving
*
**NumPy, SciPy, Matplotlib**
(
[
install SciPy stack
](
https://www.scipy.org/install.html
)
, contains all of them)
*
**NumPy, SciPy, Matplotlib**
(
[
install SciPy stack
](
https://www.scipy.org/install.html
)
, contains all of them)
*
**h5py**
(
[
install
](
https://pypi.python.org/pypi/h5py
)
)
*
**h5py**
(
[
install
](
https://pypi.python.org/pypi/h5py
)
)
...
...
lfads/lfads.py
View file @
2a5f2a95
...
@@ -432,11 +432,15 @@ class LFADS(object):
...
@@ -432,11 +432,15 @@ class LFADS(object):
pf_pairs_out_fac_Ws
=
zip
(
preds
,
fns_out_fac_Ws
)
pf_pairs_out_fac_Ws
=
zip
(
preds
,
fns_out_fac_Ws
)
pf_pairs_out_fac_bs
=
zip
(
preds
,
fns_out_fac_bs
)
pf_pairs_out_fac_bs
=
zip
(
preds
,
fns_out_fac_bs
)
case_default
=
lambda
:
tf
.
constant
([
-
8675309.0
])
def
_case_with_no_default
(
pairs
):
this_in_fac_W
=
tf
.
case
(
pf_pairs_in_fac_Ws
,
case_default
,
exclusive
=
True
)
def
_default_value_fn
():
this_in_fac_b
=
tf
.
case
(
pf_pairs_in_fac_bs
,
case_default
,
exclusive
=
True
)
with
tf
.
control_dependencies
([
tf
.
Assert
(
False
,
[
"Reached default"
])]):
this_out_fac_W
=
tf
.
case
(
pf_pairs_out_fac_Ws
,
case_default
,
exclusive
=
True
)
return
tf
.
identity
(
pairs
[
0
][
1
]())
this_out_fac_b
=
tf
.
case
(
pf_pairs_out_fac_bs
,
case_default
,
exclusive
=
True
)
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).
# External inputs (not changing by dataset, by definition).
if
hps
.
ext_input_dim
>
0
:
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