Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bob
bob.learn.tensorflow
Commits
d46cb5c1
Commit
d46cb5c1
authored
Jun 06, 2019
by
Amir MOHAMMADI
Browse files
Allow architectures to provide the logits layer
parent
68d6ca2f
Changes
1
Hide whitespace changes
Inline
Side-by-side
bob/learn/tensorflow/estimators/Regressor.py
View file @
d46cb5c1
...
...
@@ -25,6 +25,7 @@ class Regressor(estimator.Estimator):
add_histograms
=
None
,
optimize_loss
=
tf
.
contrib
.
layers
.
optimize_loss
,
optimize_loss_learning_rate
=
None
,
architecture_has_logits
=
False
,
):
self
.
architecture
=
architecture
self
.
label_dimension
=
label_dimension
...
...
@@ -51,12 +52,15 @@ class Regressor(estimator.Estimator):
# Checking if we have some variables/scope that we may want to shut
# down
trainable_variables
=
get_trainable_variables
(
extra_checkpoint
,
mode
=
mode
)
prelogits
=
self
.
architecture
(
prelogits
,
end_points
=
self
.
architecture
(
data
,
mode
=
mode
,
trainable_variables
=
trainable_variables
)[
0
]
logits
=
append_logits
(
prelogits
,
label_dimension
,
trainable_variables
=
trainable_variables
)
if
architecture_has_logits
:
logits
,
prelogits
=
prelogits
,
end_points
[
"prelogits"
]
else
:
logits
=
append_logits
(
prelogits
,
label_dimension
,
trainable_variables
=
trainable_variables
)
predictions
=
{
"predictions"
:
logits
,
"key"
:
key
}
...
...
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