Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.learn.tensorflow
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
bob
bob.learn.tensorflow
Commits
8e81ae89
There was a problem fetching the pipeline summary.
Commit
8e81ae89
authored
7 years ago
by
Olivier Canévet
Browse files
Options
Downloads
Patches
Plain Diff
[test_lstm] Use rnn from bob correcly
parent
8e673720
Branches
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bob/learn/tensorflow/layers/RNN.py
+5
-8
5 additions, 8 deletions
bob/learn/tensorflow/layers/RNN.py
bob/learn/tensorflow/test/test_lstm.py
+2
-2
2 additions, 2 deletions
bob/learn/tensorflow/test/test_lstm.py
with
7 additions
and
10 deletions
bob/learn/tensorflow/layers/RNN.py
+
5
−
8
View file @
8e81ae89
#!/usr/bin/env python
import
tensorflow
as
tf
from
tensorflow.python.layers
import
base
# def lstm(inputs, n_hidden, name=None):
# """
# """
# return LSTM(n_hidden=n_hidden, name=name)(inputs)
def
rnn
(
inputs
,
n_hidden
,
cell_fn
,
cell_args
,
name
=
None
):
def
rnn
(
inputs
,
n_hidden
,
cell_fn
=
tf
.
nn
.
rnn_cell
.
BasicLSTMCell
,
cell_args
=
{
"
forget_bias
"
:
1.0
,
},
name
=
None
):
"""
"""
return
RNN
(
n_hidden
=
n_hidden
,
return
RNN
(
n_hidden
=
n_hidden
,
cell_fn
=
cell_fn
,
cell_args
=
cell_args
,
name
=
name
)(
inputs
)
...
...
This diff is collapsed.
Click to expand it.
bob/learn/tensorflow/test/test_lstm.py
+
2
−
2
View file @
8e81ae89
...
...
@@ -7,7 +7,7 @@ from bob.learn.tensorflow.loss import BaseLoss
from
bob.learn.tensorflow.trainers
import
Trainer
,
constant
from
bob.learn.tensorflow.utils
import
load_real_mnist
,
load_mnist
from
bob.learn.tensorflow.utils.session
import
Session
from
bob.learn.tensorflow.layers
import
lstm
from
bob.learn.tensorflow.layers
import
rnn
import
tensorflow
as
tf
import
shutil
...
...
@@ -95,7 +95,7 @@ def test_dnn_trainer():
graph
=
input_pl
[:,
n_input
:]
graph
=
tf
.
reshape
(
graph
,
(
-
1
,
n_steps
,
n_input
))
graph
=
tf
.
unstack
(
graph
,
n_steps
,
1
)
graph
=
lstm
(
graph
,
n_hidden
)
graph
=
rnn
(
graph
,
n_hidden
)
graph
=
slim
.
fully_connected
(
graph
,
n_classes
,
activation_fn
=
None
)
# Loss for the softmax
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment