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
93d83610
Commit
93d83610
authored
8 years ago
by
Guillaume HEUSCH
Browse files
Options
Downloads
Patches
Plain Diff
[network] added scope parameter when computing graph
parent
0721c731
Branches
Branches containing commit
No related tags found
1 merge request
!8
Gan
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bob/learn/tensorflow/network/SequenceNetwork.py
+6
-6
6 additions, 6 deletions
bob/learn/tensorflow/network/SequenceNetwork.py
with
6 additions
and
6 deletions
bob/learn/tensorflow/network/SequenceNetwork.py
+
6
−
6
View file @
93d83610
...
...
@@ -65,7 +65,7 @@ class SequenceNetwork(six.with_metaclass(abc.ABCMeta, object)):
self
.
pickle_architecture
=
pickle
.
dumps
(
self
.
sequence_net
)
self
.
deployment_shape
=
shape
def
compute_graph
(
self
,
input_data
,
feature_layer
=
None
,
training
=
True
):
def
compute_graph
(
self
,
input_data
,
feature_layer
=
None
,
training
=
True
,
scope
=
None
):
"""
Given the current network, return the Tensorflow graph
**Parameter**
...
...
@@ -77,18 +77,18 @@ class SequenceNetwork(six.with_metaclass(abc.ABCMeta, object)):
training: If `True` will generating the graph for training
"""
input_offset
=
input_data
for
k
in
self
.
sequence_net
.
keys
():
current_layer
=
self
.
sequence_net
[
k
]
if
training
or
not
isinstance
(
current_layer
,
Dropout
):
current_layer
.
create_variables
(
input_offset
)
current_layer
.
create_variables
(
input_offset
,
scope
=
scope
)
input_offset
=
current_layer
.
get_graph
(
training_phase
=
training
)
if
feature_layer
is
not
None
and
k
==
feature_layer
:
return
input_offset
return
input_offset
def
compute_inference_graph
(
self
,
feature_layer
=
None
):
...
...
@@ -148,9 +148,9 @@ class SequenceNetwork(six.with_metaclass(abc.ABCMeta, object)):
variables
[
self
.
sequence_net
[
k
].
b
.
name
]
=
self
.
sequence_net
[
k
].
b
# Dumping batch norm variables
if
self
.
sequence_net
[
k
].
batch_norm
:
variables
[
self
.
sequence_net
[
k
].
beta
.
name
]
=
self
.
sequence_net
[
k
].
beta
variables
[
self
.
sequence_net
[
k
].
gamma
.
name
]
=
self
.
sequence_net
[
k
].
gamma
#
if self.sequence_net[k].batch_norm:
#
variables[self.sequence_net[k].beta.name] = self.sequence_net[k].beta
#
variables[self.sequence_net[k].gamma.name] = self.sequence_net[k].gamma
#variables[self.sequence_net[k].mean.name] = self.sequence_net[k].mean
#variables[self.sequence_net[k].var.name] = self.sequence_net[k].var
...
...
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