Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PlanArt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
belie
PlanArt
Commits
ce27aca1
Commit
ce27aca1
authored
5 days ago
by
belie
Browse files
Options
Downloads
Patches
Plain Diff
fixed bug n fit motorsensory adaptation
parent
c98dfeb5
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
planart/motorsensory/_adaptation.py
+26
-23
26 additions, 23 deletions
planart/motorsensory/_adaptation.py
planart/motorsensory/_fit.py
+1
-1
1 addition, 1 deletion
planart/motorsensory/_fit.py
with
27 additions
and
24 deletions
planart/motorsensory/_adaptation.py
+
26
−
23
View file @
ce27aca1
...
...
@@ -116,31 +116,34 @@ def adaptation_somatosensory_perturbation_experiment(config, perturbations,
).
squeeze
()
produced_articulatory_matrix
[
n
,
:]
=
x0
predicted_articulatory_matrix
[
n
,
:]
=
x0_sol
# contours = parametric.articulatory_to_contour(x0_sol)
# contours_perturbed = contours.copy()
# lx, ly, ux, uy = contours[0].contours
# distance = (lx[-3] - 10)
# lx[-3:] += distance * p
# ux[-3:] += distance * p
# distance = (lx[-1] - lx[-2])
# lx[-1:] += distance * p
# ux[-1:] += distance * p
# contours_perturbed[0].contours = np.array([lx, ly, ux, uy])
# formants = parametric.contour_to_formant(contours_perturbed,
# min_area=5e-6).squeeze()
x0_perturbed
=
[
x
for
x
in
x0
]
x0_perturbed
[
5
]
=
(
1
+
p
)
*
(
x0_perturbed
[
5
]
+
3
)
-
3
formants
=
parametric
.
articulatory_to_formant
(
x0_perturbed
).
squeeze
()
produced_acoustics_matrix
[
n
,
:]
=
formants
auditory_feedback_matrix
[
n
,
:]
=
formants
# received_somatosensory_feedback = parametric.contour_to_task(
# contours_perturbed,
# get_c()
contours
=
parametric
.
articulatory_to_contour
(
x0_sol
)
contours_perturbed
=
contours
.
copy
()
lx
,
ly
,
ux
,
uy
=
contours
[
0
].
contours
distance
=
(
lx
[
-
3
]
-
10
)
lx
[
-
3
:]
+=
distance
*
p
ux
[
-
3
:]
+=
distance
*
p
distance
=
(
lx
[
-
1
]
-
lx
[
-
2
])
lx
[
-
1
:]
+=
distance
*
p
ux
[
-
1
:]
+=
distance
*
p
contours_perturbed
[
0
].
contours
=
np
.
array
([
lx
,
ly
,
ux
,
uy
])
formants
=
parametric
.
contour_to_formant
(
contours_perturbed
,
min_area
=
5e-6
).
squeeze
()
received_somatosensory_feedback
=
parametric
.
contour_to_task
(
contours_perturbed
,
get_c
()
)
# x0_perturbed = [x for x in x0]
# x0_perturbed[5] = (1+p) * (x0_perturbed[5] + 3) - 3
# formants = parametric.articulatory_to_formant(x0_perturbed).squeeze()
# produced_acoustics_matrix[n, :] = formants
# auditory_feedback_matrix[n, :] = formants
# received_somatosensory_feedback = parametric.articulatory_to_task(
# x0_perturbed
# )
received_somatosensory_feedback
=
parametric
.
articulatory_to_task
(
x0_perturbed
)
somatosensory_feedback_matrix
[
n
,
:]
=
received_somatosensory_feedback
.
squeeze
()
predicted_acoustics_matrix
[
n
,
:]
=
sensory_prediction
(
...
...
This diff is collapsed.
Click to expand it.
planart/motorsensory/_fit.py
+
1
−
1
View file @
ce27aca1
...
...
@@ -119,7 +119,7 @@ def annealing_simple_xt3c_inversion(config, true_formants, min_x,
rem
=
config
[
'
adaptation optimization
'
][
'
patience
'
]
*
1
local_cost
=
objective
(
x0
,
config
,
true_formants
,
min_x
,
perturbations
,
vowel
)
min_x
,
perturbations
,
vowel
,
initializer
)
local_solution
=
[
x
for
x
in
x0
]
col_len
=
print_first_line
(
config
[
'
adaptation optimization
'
][
'
optimizer
'
])
...
...
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