Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Ozan Catal
Animal Ai Env
Commits
2d5155da
Unverified
Commit
2d5155da
authored
Sep 16, 2019
by
Benjamin Beyret
Committed by
GitHub
Sep 16, 2019
Browse files
merge Dev v1.1.0 - curriculum with yaml files
Dev v1.1.0
parents
6ebfa72e
5fe24394
Changes
25
Hide whitespace changes
Inline
Side-by-side
examples/configs/curriculum/4.yaml
0 → 100644
View file @
2d5155da
!ArenaConfig
arenas
:
0
:
!Arena
t
:
500
items
:
-
!Item
name
:
Wall
positions
:
-
!Vector3
{
x
:
-1
,
y
:
0
,
z
:
10
}
-
!Vector3
{
x
:
-1
,
y
:
0
,
z
:
20
}
-
!Vector3
{
x
:
-1
,
y
:
0
,
z
:
30
}
-
!Vector3
{
x
:
10
,
y
:
0
,
z
:
-1
}
-
!Vector3
{
x
:
20
,
y
:
0
,
z
:
-1
}
colors
:
rotations
:
[
90
,
90
,
90
,
0
,
0
]
sizes
:
-
!Vector3
{
x
:
1
,
y
:
5
,
z
:
9
}
-
!Vector3
{
x
:
1
,
y
:
5
,
z
:
9
}
-
!Vector3
{
x
:
1
,
y
:
5
,
z
:
9
}
-
!Vector3
{
x
:
1
,
y
:
5
,
z
:
9
}
-
!Vector3
{
x
:
1
,
y
:
5
,
z
:
9
}
-
!Item
name
:
GoodGoal
positions
:
-
!Vector3
{
x
:
-1
,
y
:
0
,
z
:
35
}
sizes
:
-
!Vector3
{
x
:
2
,
y
:
2
,
z
:
2
}
-
!Item
name
:
Agent
positions
:
-
!Vector3
{
x
:
-1
,
y
:
1
,
z
:
5
}
\ No newline at end of file
examples/configs/curriculum/5.yaml
0 → 100644
View file @
2d5155da
!ArenaConfig
arenas
:
0
:
!Arena
t
:
500
items
:
-
!Item
name
:
Wall
positions
:
-
!Vector3
{
x
:
-1
,
y
:
0
,
z
:
10
}
-
!Vector3
{
x
:
-1
,
y
:
0
,
z
:
20
}
-
!Vector3
{
x
:
-1
,
y
:
0
,
z
:
30
}
-
!Vector3
{
x
:
10
,
y
:
0
,
z
:
-1
}
-
!Vector3
{
x
:
20
,
y
:
0
,
z
:
-1
}
-
!Vector3
{
x
:
30
,
y
:
0
,
z
:
-1
}
colors
:
rotations
:
[
90
,
90
,
90
,
0
,
0
,
0
]
sizes
:
-
!Vector3
{
x
:
1
,
y
:
5
,
z
:
9
}
-
!Vector3
{
x
:
1
,
y
:
5
,
z
:
9
}
-
!Vector3
{
x
:
1
,
y
:
5
,
z
:
9
}
-
!Vector3
{
x
:
1
,
y
:
5
,
z
:
9
}
-
!Vector3
{
x
:
1
,
y
:
5
,
z
:
9
}
-
!Vector3
{
x
:
1
,
y
:
5
,
z
:
9
}
-
!Item
name
:
GoodGoal
positions
:
-
!Vector3
{
x
:
-1
,
y
:
0
,
z
:
35
}
sizes
:
-
!Vector3
{
x
:
2
,
y
:
2
,
z
:
2
}
-
!Item
name
:
Agent
positions
:
-
!Vector3
{
x
:
-1
,
y
:
1
,
z
:
5
}
\ No newline at end of file
examples/configs/curriculum/Learner.json
0 → 100644
View file @
2d5155da
{
"measure"
:
"reward"
,
"thresholds"
:
[
1.5
,
1.4
,
1.3
,
1.2
,
1.1
],
"min_lesson_length"
:
100
,
"signal_smoothing"
:
true
,
"configuration_files"
:
[
"0.yaml"
,
"1.yaml"
,
"2.yaml"
,
"3.yaml"
,
"4.yaml"
,
"5.yaml"
]
}
\ No newline at end of file
examples/trainCurriculum.py
0 → 100644
View file @
2d5155da
from
animalai_train.trainers.trainer_controller
import
TrainerController
from
animalai.envs
import
UnityEnvironment
from
animalai_train.trainers.meta_curriculum
import
MetaCurriculum
import
random
import
yaml
import
sys
# ML-agents parameters for training
env_path
=
'../env/AnimalAI'
worker_id
=
random
.
randint
(
1
,
100
)
seed
=
10
base_port
=
5005
sub_id
=
1
run_id
=
'train_example_curriculum'
save_freq
=
5000
curriculum_file
=
'configs/curriculum/'
load_model
=
False
train_model
=
True
keep_checkpoints
=
5000
lesson
=
0
run_seed
=
1
trainer_config_path
=
'configs/trainer_config.yaml'
model_path
=
'./models/{run_id}'
.
format
(
run_id
=
run_id
)
summaries_dir
=
'./summaries'
maybe_meta_curriculum
=
MetaCurriculum
(
curriculum_file
)
trainer_config
=
yaml
.
load
(
open
(
trainer_config_path
))
env
=
UnityEnvironment
(
n_arenas
=
1
,
# Change this to train on more arenas
file_name
=
env_path
,
worker_id
=
worker_id
,
seed
=
seed
,
docker_training
=
False
,
play
=
False
)
external_brains
=
{
brain
:
env
.
brains
[
brain
]
for
brain
in
env
.
external_brain_names
}
tc
=
TrainerController
(
model_path
,
summaries_dir
,
run_id
+
'-'
+
str
(
sub_id
),
save_freq
,
maybe_meta_curriculum
,
load_model
,
train_model
,
keep_checkpoints
,
lesson
,
external_brains
,
run_seed
)
tc
.
start_learning
(
env
,
trainer_config
)
examples/trainMLAgents.py
View file @
2d5155da
...
...
@@ -22,7 +22,6 @@ keep_checkpoints = 5000
lesson
=
0
run_seed
=
1
docker_target_name
=
None
no_graphics
=
False
trainer_config_path
=
'configs/trainer_config.yaml'
model_path
=
'./models/{run_id}'
.
format
(
run_id
=
run_id
)
summaries_dir
=
'./summaries'
...
...
@@ -44,7 +43,7 @@ def load_config(trainer_config_path):
.
format
(
trainer_config_path
))
def
init_environment
(
env_path
,
docker_target_name
,
no_graphics
,
worker_id
,
seed
):
def
init_environment
(
env_path
,
docker_target_name
,
worker_id
,
seed
):
if
env_path
is
not
None
:
# Strip out executable extensions if passed
env_path
=
(
env_path
.
strip
()
...
...
@@ -71,7 +70,7 @@ else:
arena_config_in
=
ArenaConfig
(
'configs/exampleTraining.yaml'
)
trainer_config
=
load_config
(
trainer_config_path
)
env
=
init_environment
(
env_path
,
docker_target_name
,
no_graphics
,
worker_id
,
run_seed
)
env
=
init_environment
(
env_path
,
docker_target_name
,
worker_id
,
run_seed
)
external_brains
=
{}
for
brain_name
in
env
.
external_brain_names
:
...
...
Prev
1
2
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment