Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
task_environment
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
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
Antonio Andriella
task_environment
Commits
d99a5793
Commit
d99a5793
authored
4 years ago
by
Antonio Andriella
Browse files
Options
Downloads
Patches
Plain Diff
new def of features
parent
1d701876
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cognitive_game_env.py
+14
-8
14 additions, 8 deletions
cognitive_game_env.py
with
14 additions
and
8 deletions
cognitive_game_env.py
+
14
−
8
View file @
d99a5793
...
...
@@ -307,9 +307,9 @@ class CognitiveGame:
:param trajs: generated by the expert
:return: Nx3 feature map
"""
max_attempt
=
self
.
n_solution
*
self
.
n_attempt
max_time
=
self
.
timeout
*
self
.
n_solution
*
self
.
n_attempt
N
=
self
.
n_solution
*
self
.
n_attempt
*
self
.
n_
user_action
max_attempt
=
self
.
task_length
*
self
.
n_
max_
attempt
max_time
=
self
.
timeout
*
self
.
task_length
*
self
.
n_
max_
attempt
N
=
(
self
.
task_length
+
1
)
*
self
.
n_
max_
attempt
*
len
(
self
.
user_action
)
feat
=
np
.
ones
([
N
,
4
])
...
...
@@ -318,11 +318,17 @@ class CognitiveGame:
for
traj
in
trajs
:
for
s1
,
a
,
s2
in
traj
.
_t
:
ix
,
iy
,
iz
=
self
.
state_index_to_point
(
s1
)
feat
[
s1
,
0
]
=
0
feat
[
s1
,
1
]
=
0
#max_attempt*ix
feat
[
s1
,
2
]
=
ix
feat
[
s1
,
3
]
=
iy
# feat[s1, 0] = 0
# feat[s1, 1] = 0
feat
[
s1
,
0
]
=
(
ix
)
feat
[
s1
,
1
]
=
(
iy
)
#*(ix+1)
feat
[
s1
,
2
]
=
iz
feat
[
s1
,
3
]
=
a
# for index in range(len(self.action_space)):
# if index == a:
# feat[s1, 3+index] = 1
# else:
# feat[s1, 3 + index] = 0
# for trans in traj:
# if trans[0] == i:
# current_react_time = trans[2]
...
...
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