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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Armin Co
LearningEnvironment
Commits
539b86c7
Commit
539b86c7
authored
4 years ago
by
Armin Co
Browse files
Options
Downloads
Patches
Plain Diff
Prevent conf.name to be : None
parent
89853126
Branches
main
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
agents.py
+1
-1
1 addition, 1 deletion
agents.py
environment_wrapper.py
+2
-2
2 additions, 2 deletions
environment_wrapper.py
run_scripts/benchmarks.py
+2
-2
2 additions, 2 deletions
run_scripts/benchmarks.py
with
5 additions
and
5 deletions
agents.py
+
1
−
1
View file @
539b86c7
...
...
@@ -75,7 +75,7 @@ class DQAgent(QAgent):
def
__init__
(
self
,
conf
):
super
().
__init__
(
conf
)
self
.
q2
=
QNet
(
conf
)
self
.
name
=
'
D_
'
+
self
.
name
self
.
name
=
'
D_
'
+
str
(
self
.
name
)
def
get_action
(
self
,
state
):
if
np
.
random
.
rand
()
<=
self
.
epsilon
:
...
...
This diff is collapsed.
Click to expand it.
environment_wrapper.py
+
2
−
2
View file @
539b86c7
...
...
@@ -31,7 +31,7 @@ class Config:
def
conf_to_name
(
self
):
self
.
name
=
self
.
env_type
+
'
_
'
+
self
.
name
self
.
name
=
str
(
self
.
env_type
)
+
'
_
'
+
str
(
self
.
name
)
for
layer
in
self
.
net_layout
:
self
.
name
+=
'
_
'
+
str
(
layer
)
+
'
_
'
self
.
name
+=
str
(
self
.
eps_decay
)
+
'
_
'
...
...
@@ -102,7 +102,7 @@ def learn_offline(agent, conf):
def
run
(
environment
,
agent
,
episodes
,
render
=
True
,
learn
=
True
,
conf
=
None
):
"""
Run an agent
"""
conf
.
name
+
=
'
on
'
conf
.
name
=
str
(
conf
.
name
)
+
'
on
'
# Set the exploring rate to its minimum.
# (epsilon *greedy*)
if
not
learn
:
...
...
This diff is collapsed.
Click to expand it.
run_scripts/benchmarks.py
+
2
−
2
View file @
539b86c7
...
...
@@ -123,8 +123,8 @@ configuration = c
# configuration = lun
# configuration = ThisHasToBeTooBig
print
(
configuration
.
name
)
configuration
.
agent
=
D
QAgent
(
configuration
)
configuration
.
conf_to_
name
(
)
configuration
.
agent
=
QAgent
(
configuration
)
main
.
run
(
configuration
)
# configurations = [smallNet, smallNetDeep, normalNet, normalSlowDecay, normalSlowLearn, largeNet, deepNet, verryLittleNet, littleNet, verryLittleNetDeep, smallNetDeepSlowLearn, deepNetSlowLearn]
...
...
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