Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
A-MFEA-RL
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
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Aritz
A-MFEA-RL
Commits
2396b54b
Commit
2396b54b
authored
4 years ago
by
Aritz
Browse files
Options
Downloads
Patches
Plain Diff
Udate exp.py so it matches the rest of updates
parent
1b1ffa9b
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
exp.py
+16
-1
16 additions, 1 deletion
exp.py
with
16 additions
and
1 deletion
exp.py
+
16
−
1
View file @
2396b54b
...
...
@@ -10,6 +10,10 @@ from utils.callback import callback_function as cb
from
utils.utils
import
load_compressed_pickle
as
lp
from
pickle
import
dump
as
pdump
PATH_TO_METAWORLD_FILE
=
'
./metaworld/envs/mujoco/sawyer_xyz/sawyer_xyz_env.py
'
PATH_TO_FIXED
=
'
./exp_type/sawyer_xyz_env_fixed.py
'
PATH_TO_RANDOM
=
'
./exp_type/sawyer_xyz_env_random.py
'
def
end_exp
():
shutil
.
rmtree
(
'
/tmp/amfearl/
'
,
ignore_errors
=
True
)
...
...
@@ -25,6 +29,9 @@ if __name__ == "__main__":
parser
.
add_argument
(
'
-p
'
,
dest
=
'
path
'
,
type
=
str
,
default
=
"
summary
"
)
parser
.
add_argument
(
'
-t
'
,
dest
=
'
threads
'
,
type
=
int
,
default
=
None
)
parser
.
add_argument
(
'
-exp
'
,
dest
=
'
experiment
'
,
type
=
int
,
default
=
0
)
parser
.
add_argument
(
'
-r
'
,
dest
=
'
random
'
,
type
=
int
,
default
=
1
,
help
=
"
0 - fixed ; 1 (default) - random
"
)
args
=
parser
.
parse_args
()
filename
=
args
.
path
...
...
@@ -39,6 +46,14 @@ if __name__ == "__main__":
envs
=
[]
# Copy required files to make episodes' initialization random
if
args
.
random
:
shutil
.
copyfile
(
PATH_TO_RANDOM
,
PATH_TO_METAWORLD_FILE
)
print
(
"
Experiment configured for random reinitialization
"
)
else
:
shutil
.
copyfile
(
PATH_TO_FIXED
,
PATH_TO_METAWORLD_FILE
)
print
(
"
Experiment configured for fixed reinitialization
"
)
if
args
.
experiment
==
0
:
# TOY EXPERIMENT
print
(
'
Loading compressed_TOY.pbz2, this may take a few seconds...
'
)
...
...
@@ -66,7 +81,7 @@ if __name__ == "__main__":
for
i
in
range
(
len
(
tasks
)):
pdump
(
tasks
[
i
],
open
(
'
/tmp/amfearl/
'
+
str
(
i
)
+
'
.pickle
'
,
'
wb
'
))
mfea
.
mfea
(
tasks
,
rmp
=
0.8
,
gen
=
1000
,
pop
=
1
0
,
episodes
=
1
0
,
mfea
.
mfea
(
tasks
,
rmp
=
0.8
,
gen
=
1000
,
pop
=
6
0
,
episodes
=
30
0
,
D_multitask
=
dim
,
callback
=
cb
,
f_name
=
filename
,
num_threads
=
args
.
threads
)
...
...
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