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
e90a4429
There was a problem fetching the pipeline summary.
Commit
e90a4429
authored
7 years ago
by
Tiago Pereira
Browse files
Options
Downloads
Patches
Plain Diff
Added normalized in the Embedding
parent
7b03d324
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Pipeline
#
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bob/learn/tensorflow/network/Embedding.py
+8
-1
8 additions, 1 deletion
bob/learn/tensorflow/network/Embedding.py
with
8 additions
and
1 deletion
bob/learn/tensorflow/network/Embedding.py
+
8
−
1
View file @
e90a4429
...
...
@@ -6,6 +6,7 @@
import
tensorflow
as
tf
from
bob.learn.tensorflow.utils.session
import
Session
from
bob.learn.tensorflow.datashuffler
import
Linear
class
Embedding
(
object
):
...
...
@@ -19,12 +20,18 @@ class Embedding(object):
graph: Embedding graph
"""
def
__init__
(
self
,
input
,
graph
):
def
__init__
(
self
,
input
,
graph
,
normalizer
=
Linear
()
):
self
.
input
=
input
self
.
graph
=
graph
self
.
normalizer
=
normalizer
def
__call__
(
self
,
data
):
session
=
Session
.
instance
().
session
if
self
.
normalizer
is
not
None
:
for
i
in
range
(
data
.
shape
[
0
]):
data
[
i
]
=
self
.
normalizer
(
data
[
i
])
feed_dict
=
{
self
.
input
:
data
}
return
session
.
run
([
self
.
graph
],
feed_dict
=
feed_dict
)[
0
]
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