Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
emoUS-public
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
general
dsml
emoUS-public
Commits
f15a6fa4
Commit
f15a6fa4
authored
2 years ago
by
Carel van Niekerk
Browse files
Options
Downloads
Patches
Plain Diff
Auto save distributions and mutual info
parent
8a231167
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
convlab/dst/setsumbt/tracker.py
+4
-4
4 additions, 4 deletions
convlab/dst/setsumbt/tracker.py
with
4 additions
and
4 deletions
convlab/dst/setsumbt/tracker.py
+
4
−
4
View file @
f15a6fa4
...
@@ -263,7 +263,7 @@ class SetSUMBTTracker(DST):
...
@@ -263,7 +263,7 @@ class SetSUMBTTracker(DST):
new_state
[
'
turn_pooled_representation
'
]
=
outputs
.
turn_pooled_representation
.
reshape
(
-
1
)
new_state
[
'
turn_pooled_representation
'
]
=
outputs
.
turn_pooled_representation
.
reshape
(
-
1
)
self
.
state
=
new_state
self
.
state
=
new_state
self
.
info_dict
[
'
belief_state
'
]
=
copy
.
deepcopy
(
dict
(
new_state
))
#
self.info_dict['belief_state'] = copy.deepcopy(dict(new_state))
return
self
.
state
return
self
.
state
...
@@ -281,7 +281,8 @@ class SetSUMBTTracker(DST):
...
@@ -281,7 +281,8 @@ class SetSUMBTTracker(DST):
with
torch
.
no_grad
():
with
torch
.
no_grad
():
features
[
'
hidden_state
'
]
=
self
.
hidden_states
features
[
'
hidden_state
'
]
=
self
.
hidden_states
features
[
'
get_turn_pooled_representation
'
]
=
self
.
return_turn_pooled_representation
features
[
'
get_turn_pooled_representation
'
]
=
self
.
return_turn_pooled_representation
features
[
'
calculate_state_mutual_info
'
]
=
self
.
return_belief_state_mutual_info
mutual_info
=
self
.
return_belief_state_mutual_info
or
self
.
store_full_belief_state
features
[
'
calculate_state_mutual_info
'
]
=
mutual_info
outputs
=
self
.
model
(
**
features
)
outputs
=
self
.
model
(
**
features
)
self
.
hidden_states
=
outputs
.
hidden_state
self
.
hidden_states
=
outputs
.
hidden_state
...
@@ -293,7 +294,6 @@ class SetSUMBTTracker(DST):
...
@@ -293,7 +294,6 @@ class SetSUMBTTracker(DST):
if
self
.
store_full_belief_state
:
if
self
.
store_full_belief_state
:
self
.
info_dict
[
'
belief_state_distributions
'
]
=
outputs
.
belief_state
self
.
info_dict
[
'
belief_state_distributions
'
]
=
outputs
.
belief_state
if
state_mutual_info
is
not
None
:
self
.
info_dict
[
'
belief_state_knowledge_uncertainty
'
]
=
outputs
.
belief_state_mutual_information
self
.
info_dict
[
'
belief_state_knowledge_uncertainty
'
]
=
outputs
.
belief_state_mutual_information
# Obtain model output probabilities
# Obtain model output probabilities
...
...
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