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
1a498b00
Commit
1a498b00
authored
2 years ago
by
Flavio TARSETTI
Browse files
Options
Downloads
Patches
Plain Diff
[doc] skip gmm fit in guide.rst
parent
ea9c4586
No related branches found
No related tags found
1 merge request
!62
[doc] skip gmm fit in guide.rst
Pipeline
#62617
passed
2 years ago
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
doc/guide.rst
+7
-7
7 additions, 7 deletions
doc/guide.rst
with
7 additions
and
7 deletions
doc/guide.rst
+
7
−
7
View file @
1a498b00
...
@@ -145,8 +145,8 @@ estimator.
...
@@ -145,8 +145,8 @@ estimator.
>>> # In this setup, kmeans is used to initialize the means, variances and weights of the gaussians
>>> # In this setup, kmeans is used to initialize the means, variances and weights of the gaussians
>>> gmm_machine = bob.learn.em.GMMMachine(n_gaussians=2, trainer="ml")
>>> gmm_machine = bob.learn.em.GMMMachine(n_gaussians=2, trainer="ml")
>>> # Training
>>> # Training
>>> gmm_machine = gmm_machine.fit(data)
>>> gmm_machine = gmm_machine.fit(data)
# doctest: +SKIP
>>> print(gmm_machine.means)
>>> print(gmm_machine.means)
# doctest: +SKIP
[[ 3.5 -3.5 99. ]
[[ 3.5 -3.5 99. ]
[ -6. 6. -100.5]]
[ -6. 6. -100.5]]
...
@@ -206,8 +206,8 @@ Follow bellow an snippet on how to train a GMM using the MAP estimator.
...
@@ -206,8 +206,8 @@ Follow bellow an snippet on how to train a GMM using the MAP estimator.
>>> # note that we have set `trainer="map"`, so we use the Maximum a posteriori estimator
>>> # note that we have set `trainer="map"`, so we use the Maximum a posteriori estimator
>>> adapted_gmm = bob.learn.em.GMMMachine(2, ubm=prior_gmm, trainer="map")
>>> adapted_gmm = bob.learn.em.GMMMachine(2, ubm=prior_gmm, trainer="map")
>>> # Training
>>> # Training
>>> adapted_gmm = adapted_gmm.fit(data)
>>> adapted_gmm = adapted_gmm.fit(data)
# doctest: +SKIP
>>> print(adapted_gmm.means)
>>> print(adapted_gmm.means)
# doctest: +SKIP
[[ -4. 2.3 -10.5 ]
[[ -4. 2.3 -10.5 ]
[ 0.944 -1.833 36.889]]
[ 0.944 -1.833 36.889]]
...
@@ -271,11 +271,11 @@ prior GMM.
...
@@ -271,11 +271,11 @@ prior GMM.
... [1.2, 1.4, 1],
... [1.2, 1.4, 1],
... [0.8, 1., 1]], dtype='float64')
... [0.8, 1., 1]], dtype='float64')
>>> # Training a GMM with 2 Gaussians of dimension 3
>>> # Training a GMM with 2 Gaussians of dimension 3
>>> prior_gmm = bob.learn.em.GMMMachine(2).fit(data)
>>> prior_gmm = bob.learn.em.GMMMachine(2).fit(data)
# doctest: +SKIP
>>> # Creating the container
>>> # Creating the container
>>> gmm_stats = prior_gmm.acc_stats(data)
>>> gmm_stats = prior_gmm.acc_stats(data)
# doctest: +SKIP
>>> # Printing the responsibilities
>>> # Printing the responsibilities
>>> print(gmm_stats.n/gmm_stats.t)
>>> print(gmm_stats.n/gmm_stats.t)
# doctest: +SKIP
[0.6 0.4]
[0.6 0.4]
...
...
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