Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.learn.em
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
Package Registry
Model registry
Operate
Environments
Terraform modules
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
Show more breadcrumbs
bob
bob.learn.em
Commits
0abaac5f
There was a problem fetching the pipeline summary.
Commit
0abaac5f
authored
7 years ago
by
Manuel Günther
Browse files
Options
Downloads
Patches
Plain Diff
Made EM and JFA training less verbose
parent
4e704a43
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!30
Resolve "training is very verbose"
Pipeline
#
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bob/learn/em/train.py
+8
-7
8 additions, 7 deletions
bob/learn/em/train.py
with
8 additions
and
7 deletions
bob/learn/em/train.py
+
8
−
7
View file @
0abaac5f
...
...
@@ -58,7 +58,7 @@ def train(trainer, machine, data, max_iterations=50, convergence_threshold=None,
average_output
=
trainer
.
compute_likelihood
(
machine
)
for
i
in
range
(
max_iterations
):
logger
.
info
(
"
Iteration = %d/%d
"
,
i
,
max_iterations
)
logger
.
debug
(
"
Iteration = %d/%d
"
,
i
+
1
,
max_iterations
)
average_output_previous
=
average_output
trainer
.
m_step
(
machine
,
data
)
trainer
.
e_step
(
machine
,
data
)
...
...
@@ -67,15 +67,16 @@ def train(trainer, machine, data, max_iterations=50, convergence_threshold=None,
average_output
=
trainer
.
compute_likelihood
(
machine
)
if
type
(
machine
)
is
bob
.
learn
.
em
.
KMeansMachine
:
logger
.
info
(
"
average euclidean distance = %f
"
,
average_output
)
logger
.
debug
(
"
average euclidean distance = %f
"
,
average_output
)
else
:
logger
.
info
(
"
log likelihood = %f
"
,
average_output
)
logger
.
debug
(
"
log likelihood = %f
"
,
average_output
)
convergence_value
=
abs
((
average_output_previous
-
average_output
)
/
average_output_previous
)
logger
.
info
(
"
convergence value = %f
"
,
convergence_value
)
logger
.
debug
(
"
convergence value = %f
"
,
convergence_value
)
# Terminates if converged (and likelihood computation is set)
if
convergence_threshold
!=
None
and
convergence_value
<=
convergence_threshold
:
logger
.
info
(
"
EM training converged after %d iterations with convergence value %f
"
,
convergence_value
)
break
if
hasattr
(
trainer
,
"
finalize
"
):
trainer
.
finalize
(
machine
,
data
)
...
...
@@ -109,7 +110,7 @@ def train_jfa(trainer, jfa_base, data, max_iterations=10, initialize=True, rng=N
# V Subspace
logger
.
info
(
"
V subspace estimation...
"
)
for
i
in
range
(
max_iterations
):
logger
.
info
(
"
Iteration = %d/%d
"
,
i
,
max_iterations
)
logger
.
debug
(
"
Iteration = %d/%d
"
,
i
+
1
,
max_iterations
)
trainer
.
e_step_v
(
jfa_base
,
data
)
trainer
.
m_step_v
(
jfa_base
,
data
)
trainer
.
finalize_v
(
jfa_base
,
data
)
...
...
@@ -117,7 +118,7 @@ def train_jfa(trainer, jfa_base, data, max_iterations=10, initialize=True, rng=N
# U subspace
logger
.
info
(
"
U subspace estimation...
"
)
for
i
in
range
(
max_iterations
):
logger
.
info
(
"
Iteration = %d/%d
"
,
i
,
max_iterations
)
logger
.
debug
(
"
Iteration = %d/%d
"
,
i
+
1
,
max_iterations
)
trainer
.
e_step_u
(
jfa_base
,
data
)
trainer
.
m_step_u
(
jfa_base
,
data
)
trainer
.
finalize_u
(
jfa_base
,
data
)
...
...
@@ -125,7 +126,7 @@ def train_jfa(trainer, jfa_base, data, max_iterations=10, initialize=True, rng=N
# D subspace
logger
.
info
(
"
D subspace estimation...
"
)
for
i
in
range
(
max_iterations
):
logger
.
info
(
"
Iteration = %d/%d
"
,
i
,
max_iterations
)
logger
.
debug
(
"
Iteration = %d/%d
"
,
i
+
1
,
max_iterations
)
trainer
.
e_step_d
(
jfa_base
,
data
)
trainer
.
m_step_d
(
jfa_base
,
data
)
trainer
.
finalize_d
(
jfa_base
,
data
)
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