Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
nmm_2020_site
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Erik Strand
nmm_2020_site
Commits
1817db9e
Commit
1817db9e
authored
May 7, 2020
by
Erik Strand
Browse files
Options
Downloads
Patches
Plain Diff
Update writeup
parent
9a174bad
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
_code/pset_11/cwm.py
+1
-1
1 addition, 1 deletion
_code/pset_11/cwm.py
_psets/11.md
+5
-1
5 additions, 1 deletion
_psets/11.md
with
6 additions
and
2 deletions
_code/pset_11/cwm.py
+
1
−
1
View file @
1817db9e
...
@@ -139,8 +139,8 @@ def em_step():
...
@@ -139,8 +139,8 @@ def em_step():
predicted
=
np
.
array
([
cluster_func
(
x
[
n
],
m
)
for
n
in
range
(
N
)])
predicted
=
np
.
array
([
cluster_func
(
x
[
n
],
m
)
for
n
in
range
(
N
)])
out_var
[
m
]
=
cw_expectation
((
y
-
predicted
)
**
2.0
,
m
)
+
tiny
out_var
[
m
]
=
cw_expectation
((
y
-
predicted
)
**
2.0
,
m
)
+
tiny
make_plot
(
plot_name
(
0
))
print_everything
()
print_everything
()
make_plot
(
plot_name
(
0
))
for
i
in
range
(
50
):
for
i
in
range
(
50
):
em_step
()
em_step
()
make_plot
(
plot_name
(
i
+
1
))
make_plot
(
plot_name
(
i
+
1
))
...
...
This diff is collapsed.
Click to expand it.
_psets/11.md
+
5
−
1
View file @
1817db9e
...
@@ -14,8 +14,12 @@ during the EM iterations.
...
@@ -14,8 +14,12 @@ during the EM iterations.
My code lives
[
here
](
https://gitlab.cba.mit.edu/erik/nmm_2020_site/-/tree/master/_code/pset_11
)
.
My code lives
[
here
](
https://gitlab.cba.mit.edu/erik/nmm_2020_site/-/tree/master/_code/pset_11
)
.
Here's a video of the convergence progress with three clusters.
Here's a video of 50 EM iterations with three clusters. I'm displaying the local linear models over
a $$4
\s
igma$$ range. (I don't indicate the output variance in any way, would be nice to add this.)
<video
width=
"480"
height=
"320"
controls=
"controls"
muted
plays-inline
>
<video
width=
"480"
height=
"320"
controls=
"controls"
muted
plays-inline
>
<source
type=
"video/mp4"
src=
"../assets/mp4/11_cwm.mp4"
>
<source
type=
"video/mp4"
src=
"../assets/mp4/11_cwm.mp4"
>
</video>
</video>
Not surprisingly, for tanh three clusters seems to work best. Any less and the fit degrades, any
more and some clusters end up with needlessly similar local models.
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
sign in
to comment