Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
LearningEnvironment
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Armin Co
LearningEnvironment
Commits
6a28131a
Commit
6a28131a
authored
4 years ago
by
Armin Co
Browse files
Options
Downloads
Patches
Plain Diff
Benchmark Configurations
parent
4764b70a
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
benchmarks.py
+43
-7
43 additions, 7 deletions
benchmarks.py
environment_wrapper.py
+5
-0
5 additions, 0 deletions
environment_wrapper.py
with
48 additions
and
7 deletions
benchmarks.py
+
43
−
7
View file @
6a28131a
...
@@ -3,7 +3,7 @@ import environment_wrapper as ew
...
@@ -3,7 +3,7 @@ import environment_wrapper as ew
import
gym
import
gym
from
carla_environment
import
CarlaEnvironment
from
carla_environment
import
CarlaEnvironment
import
copy
import
copy
from
tqdm
import
t
ra
ng
e
import
t
hreadi
ng
c
=
ew
.
Config
()
c
=
ew
.
Config
()
...
@@ -22,6 +22,11 @@ smallNet.name = 'SmallNet'
...
@@ -22,6 +22,11 @@ smallNet.name = 'SmallNet'
smallNet
.
net_layout
=
[
128
,
32
]
smallNet
.
net_layout
=
[
128
,
32
]
smallNet
.
conf_to_name
()
smallNet
.
conf_to_name
()
smallNetDeep
=
copy
.
deepcopy
(
c
)
smallNetDeep
.
name
=
'
SmallNetDepp
'
smallNetDeep
.
net_layout
=
[
128
,
32
,
32
]
smallNetDeep
.
conf_to_name
()
normalNet
=
copy
.
deepcopy
(
c
)
normalNet
=
copy
.
deepcopy
(
c
)
normalNet
.
name
=
'
NormalNet
'
normalNet
.
name
=
'
NormalNet
'
normalNet
.
net_layout
=
[
256
,
128
]
normalNet
.
net_layout
=
[
256
,
128
]
...
@@ -49,10 +54,41 @@ deepNet.name = 'DeppNet'
...
@@ -49,10 +54,41 @@ deepNet.name = 'DeppNet'
deepNet
.
net_layout
=
[
256
,
128
,
128
]
deepNet
.
net_layout
=
[
256
,
128
,
128
]
deepNet
.
conf_to_name
()
deepNet
.
conf_to_name
()
# configurations = [smallNet, normalNet ]
littleNet
=
copy
.
deepcopy
(
c
)
# configurations = [normalSlowDecay, normalSlowLearn]
littleNet
.
name
=
'
LittleNet
'
configurations
=
[
largeNet
,
deepNet
]
littleNet
.
net_layout
=
[
64
,
64
]
littleNet
.
conf_to_name
()
verryLittleNet
=
copy
.
deepcopy
(
c
)
verryLittleNet
.
name
=
'
VerryLittleNet
'
verryLittleNet
.
net_layout
=
[
64
,
32
]
verryLittleNet
.
conf_to_name
()
verryLittleNetDeep
=
copy
.
deepcopy
(
c
)
verryLittleNetDeep
.
name
=
'
VerryLittleNetDeep
'
verryLittleNetDeep
.
net_layout
=
[
64
,
32
,
32
]
verryLittleNetDeep
.
conf_to_name
()
# configuration = smallNet
# configuration = smallNetDeep
# configuration = normalNet
# configuration = normalSlowDecay
# configuration = normalSlowLearn
# configuration = largeNet
# configuration = deepNet
# configuration = verryLittleNet
# configuration = littleNet
# configuration = verryLittleNetDeep
# main.run(configuration)
configurations
=
[
smallNet
,
smallNetDeep
,
normalNet
,
normalSlowDecay
,
normalSlowLearn
,
largeNet
,
deepNet
,
verryLittleNet
,
littleNet
,
verryLittleNetDeep
]
threads
=
[]
for
conf
in
configurations
:
threads
.
append
(
threading
.
Thread
(
target
=
main
.
run
,
args
=
conf
))
for
thread
in
threads
:
thread
.
start
()
configs
=
trange
(
len
(
configurations
),
desc
=
'
Benchmarking configs
'
,
unit
=
"
Configuration
"
)
for
thread
in
threads
:
for
i
in
configs
:
thread
.
join
()
main
.
run
(
configurations
[
i
])
\ No newline at end of file
This diff is collapsed.
Click to expand it.
environment_wrapper.py
+
5
−
0
View file @
6a28131a
...
@@ -106,9 +106,14 @@ def process_logs(avg_score_history, loss, conf):
...
@@ -106,9 +106,14 @@ def process_logs(avg_score_history, loss, conf):
df
.
to_csv
(
conf
.
save_to
+
conf
.
name
+
'
/
'
+
conf
.
name
+
'
.csv
'
)
df
.
to_csv
(
conf
.
save_to
+
conf
.
name
+
'
/
'
+
conf
.
name
+
'
.csv
'
)
"""
Plot the log history
"""
"""
Plot the log history
"""
plt
.
figure
()
plt
.
plot
([
i
+
1
for
i
in
range
(
0
,
len
(
loss
),
2
)],
loss
[::
2
])
plt
.
plot
([
i
+
1
for
i
in
range
(
0
,
len
(
loss
),
2
)],
loss
[::
2
])
plt
.
plot
([
i
+
1
for
i
in
range
(
0
,
len
(
avg_score_history
),
2
)],
avg_score_history
[::
2
],
'
--
'
)
plt
.
plot
([
i
+
1
for
i
in
range
(
0
,
len
(
avg_score_history
),
2
)],
avg_score_history
[::
2
],
'
--
'
)
plt
.
title
(
conf
.
name
)
plt
.
title
(
conf
.
name
)
plt
.
savefig
(
conf
.
save_to
+
conf
.
name
+
'
/
'
+
conf
.
name
+
'
.png
'
,
format
=
"
png
"
)
plt
.
savefig
(
conf
.
save_to
+
conf
.
name
+
'
/
'
+
conf
.
name
+
'
.png
'
,
format
=
"
png
"
)
if
conf
.
render
:
if
conf
.
render
:
plt
.
show
()
plt
.
show
()
def
load_logs
(
file
):
df
=
pd
.
read_csv
(
file
)
return
df
[
"
Score
"
],
df
[
"
Average
"
]
\ No newline at end of file
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