Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
baselines
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Flatland
baselines
Commits
9b16819f
Commit
9b16819f
authored
5 years ago
by
Erik Nygren
Browse files
Options
Downloads
Patches
Plain Diff
fixed bug where all values are infinite
parent
23e98b59
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
torch_training/render_agent_behavior.py
+1
-2
1 addition, 2 deletions
torch_training/render_agent_behavior.py
utils/observation_utils.py
+2
-0
2 additions, 0 deletions
utils/observation_utils.py
with
3 additions
and
2 deletions
torch_training/render_agent_behavior.py
+
1
−
2
View file @
9b16819f
...
...
@@ -96,14 +96,13 @@ action_dict = dict()
final_action_dict
=
dict
()
scores_window
=
deque
(
maxlen
=
100
)
done_window
=
deque
(
maxlen
=
100
)
time_obs
=
deque
(
maxlen
=
2
)
scores
=
[]
dones_list
=
[]
action_prob
=
[
0
]
*
action_size
agent_obs
=
[
None
]
*
env
.
get_num_agents
()
agent_next_obs
=
[
None
]
*
env
.
get_num_agents
()
agent
=
Agent
(
state_size
,
action_size
,
"
FC
"
,
0
)
with
path
(
torch_training
.
Nets
,
"
navigator_checkpoint
5
00.pth
"
)
as
file_in
:
with
path
(
torch_training
.
Nets
,
"
navigator_checkpoint
11
00.pth
"
)
as
file_in
:
agent
.
qnetwork_local
.
load_state_dict
(
torch
.
load
(
file_in
))
record_images
=
False
...
...
This diff is collapsed.
Click to expand it.
utils/observation_utils.py
+
2
−
0
View file @
9b16819f
...
...
@@ -45,6 +45,8 @@ def norm_obs_clip(obs, clip_min=-1, clip_max=1, fixed_radius=0, normalize_to_ran
min_obs
=
0
# min(max_obs, min_gt(obs, 0))
if
normalize_to_range
:
min_obs
=
min_gt
(
obs
,
0
)
if
min_obs
>
max_obs
:
min_obs
=
max_obs
if
max_obs
==
min_obs
:
return
np
.
clip
(
np
.
array
(
obs
)
/
max_obs
,
clip_min
,
clip_max
)
norm
=
np
.
abs
(
max_obs
-
min_obs
)
...
...
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