浏览代码

resolved conflicts

/develop-generalizationTraining-TrainerController
Vincent Gao 7 年前
当前提交
02df3b34
共有 38 个文件被更改,包括 1632 次插入750 次删除
  1. 2
      docs/Learning-Environment-Design-Brains.md
  2. 2
      docs/Using-Docker.md
  3. 202
      docs/images/internal_brain.png
  4. 1
      python/requirements.txt
  5. 8
      python/tests/test_bc.py
  6. 8
      python/tests/test_ppo.py
  7. 11
      python/tests/test_unityagents.py
  8. 47
      python/tests/test_unitytrainers.py
  9. 14
      python/trainer_config.yaml
  10. 4
      python/unitytrainers/bc/models.py
  11. 77
      python/unitytrainers/bc/trainer.py
  12. 30
      python/unitytrainers/models.py
  13. 2
      python/unitytrainers/ppo/models.py
  14. 16
      python/unitytrainers/ppo/trainer.py
  15. 2
      unity-environment/Assets/ML-Agents/Examples/3DBall/Scripts/Ball3DAgent.cs
  16. 2
      unity-environment/Assets/ML-Agents/Examples/3DBall/Scripts/Ball3DDecision.cs
  17. 2
      unity-environment/Assets/ML-Agents/Examples/3DBall/Scripts/Ball3DHardAgent.cs
  18. 2
      unity-environment/Assets/ML-Agents/Examples/Area/Scripts/AreaAgent.cs
  19. 306
      unity-environment/Assets/ML-Agents/Examples/Banana/BananaImitation.unity
  20. 3
      unity-environment/Assets/ML-Agents/Examples/Hallway/Scripts/HallwayAgent.cs
  21. 461
      unity-environment/Assets/ML-Agents/Examples/Reacher/Scene.unity
  22. 4
      unity-environment/Assets/ML-Agents/Examples/Reacher/Scripts/FlyCamera.cs
  23. 62
      unity-environment/Assets/ML-Agents/Examples/Reacher/Scripts/ReacherAgent.cs
  24. 6
      unity-environment/Assets/ML-Agents/Examples/Reacher/Scripts/ReacherGoal.cs
  25. 964
      unity-environment/Assets/ML-Agents/Examples/Reacher/TFModels/Reacher.bytes
  26. 3
      unity-environment/Assets/ML-Agents/Examples/Reacher/TFModels/Reacher.bytes.meta
  27. 6
      unity-environment/Assets/ML-Agents/Scripts/Agent.cs
  28. 6
      unity-environment/Assets/ML-Agents/Scripts/Brain.cs
  29. 10
      unity-environment/Assets/ML-Agents/Scripts/CoreBrainInternal.cs
  30. 12
      unity-environment/Assets/ML-Agents/Scripts/CoreBrainPlayer.cs
  31. 2
      unity-environment/Assets/ML-Agents/Scripts/ExternalCommunicator.cs
  32. 2
      unity-environment/Assets/ML-Agents/Scripts/Monitor.cs
  33. 54
      unity-environment/Assets/ML-Agents/Scripts/BCTeacherHelper.cs
  34. 3
      docs/Installation-Docker.md
  35. 46
      unity-environment/Assets/ML-Agents/Scripts/TeacherHelper.cs
  36. 0
      /unity-environment/Assets/ML-Agents/Scripts/BCTeacherHelper.cs.meta
  37. 0
      /docs/images/docker_build_settings.png

2
docs/Learning-Environment-Design-Brains.md


* `Graph Model` : This must be the `bytes` file corresponding to the pretrained Tensorflow graph. (You must first drag this file into your Resources folder and then from the Resources folder into the inspector)
* `Graph Scope` : If you set a scope while training your TensorFlow model, all your placeholder name will have a prefix. You must specify that prefix here.
* `Batch Size Node Name` : If the batch size is one of the inputs of your graph, you must specify the name if the placeholder here. The brain will make the batch size equal to the number of agents connected to the brain automatically.
* `State Node Name` : If your graph uses the state as an input, you must specify the name if the placeholder here.
* `Vector Observation Node Name` : If your graph uses a vector observation as an input, you must specify the name if the placeholder here.
* `Recurrent Input Node Name` : If your graph uses a recurrent input / memory as input and outputs new recurrent input / memory, you must specify the name if the input placeholder here.
* `Recurrent Output Node Name` : If your graph uses a recurrent input / memory as input and outputs new recurrent input / memory, you must specify the name if the output placeholder here.
* `Visual Observation Placeholder Name` : If your graph uses observations as input, you must specify it here. Note that the number of observations is equal to the length of `Camera Resolutions` in the brain parameters.

2
docs/Using-Docker.md


Unity environment **has** to be built for the **linux platform**. From the Build Settings Window, please select the architecture to be `x86_64` and choose the build to be `headless` (_This is important because we are running it in a container that does not have graphics drivers installed_).
Save the generated environment in the directory to be mounted (e.g. we have conveniently created an empty directory called at the top level `unity-volume`).
![Build Settings For Docker](../images/docker_build_settings.png)
![Build Settings For Docker](images/docker_build_settings.png)
- Ensure that `unity-volume/<environment-name>.x86_64` and `unity-volume/environment-name_Data`. So for example, `<environment_name>` might be `3Dball` and you might want to ensure that `unity-volume/3Dball.x86_64` and `unity-volume/3Dball_Data` are both present in the directory `unity-volume`.

202
docs/images/internal_brain.png

之前 之后
宽度: 653  |  高度: 221  |  大小: 27 KiB

1
python/requirements.txt


matplotlib
numpy>=1.11.0
jupyter
mock>=2.0.0
pytest>=3.2.2
docopt
pyyaml

8
python/tests/test_bc.py


import mock
import unittest.mock as mock
import pytest
import numpy as np

run_list = [model.sample_action, model.policy]
feed_dict = {model.batch_size: 2,
model.sequence_length: 1,
model.state_in: np.array([[1, 2, 3, 1, 2, 3],
model.vector_in: np.array([[1, 2, 3, 1, 2, 3],
[3, 4, 5, 3, 4, 5]])}
sess.run(run_list, feed_dict=feed_dict)
env.close()

feed_dict = {model.batch_size: 2,
model.dropout_rate: 1.0,
model.sequence_length: 1,
model.state_in: np.array([[1, 2, 3, 1, 2, 3],
model.vector_in: np.array([[1, 2, 3, 1, 2, 3],
model.observation_in[0]: np.ones([2, 40, 30, 3])}
model.visual_in[0]: np.ones([2, 40, 30, 3])}
sess.run(run_list, feed_dict=feed_dict)
env.close()

8
python/tests/test_ppo.py


import mock
import unittest.mock as mock
import pytest
import numpy as np

model.learning_rate]
feed_dict = {model.batch_size: 2,
model.sequence_length: 1,
model.state_in: np.array([[1, 2, 3, 1, 2, 3],
model.vector_in: np.array([[1, 2, 3, 1, 2, 3],
[3, 4, 5, 3, 4, 5]])}
sess.run(run_list, feed_dict=feed_dict)
env.close()

model.learning_rate]
feed_dict = {model.batch_size: 2,
model.sequence_length: 1,
model.state_in: np.array([[1, 2, 3, 1, 2, 3],
model.vector_in: np.array([[1, 2, 3, 1, 2, 3],
model.observation_in[0]: np.ones([2, 40, 30, 3])
model.visual_in[0]: np.ones([2, 40, 30, 3])
}
sess.run(run_list, feed_dict=feed_dict)
env.close()

11
python/tests/test_unityagents.py


import json
import mock
import unittest.mock as mock
import pytest
import struct

"agents": [1,2],
"vectorObservations": [1,2,3,4,5,6,1,2,3,4,5,6],
"rewards": [1,2],
"vectorActions": [1,2,3,4],
"previousVectorActions": [1,2,3,4],
"previousTextActions":["",""],
"memories": [],
"dones": [false, false],
"maxes": [false, false],

"agents": [1,2,3],
"vectorObservations": [1,2,3,4,5,6,7,8,9,1,2,3,4,5,6,7,8,9],
"rewards": [1,2,3],
"vectorActions": [1,2,3,4,5,6],
"previousVectorActions": [1,2,3,4,5,6],
"previousTextActions":["","",""],
"memories": [],
"dones": [false, false, false],
"maxes": [false, false, false],

"agents": [1,2,3],
"vectorObservations": [1,2,3,4,5,6,7,8,9,1,2,3,4,5,6,7,8,9],
"rewards": [1,2,3],
"vectorActions": [1,2,3,4,5,6],
"previousVectorActions": [1,2,3,4,5,6],
"previousTextActions":["","",""],
"memories": [],
"dones": [false, false, true],
"maxes": [false, false, false],

47
python/tests/test_unitytrainers.py


import yaml
import mock
import unittest.mock as mock
import pytest
from unitytrainers.trainer_controller import TrainerController

mock_socket.return_value.accept.return_value = (mock_socket, 0)
mock_socket.recv.return_value.decode.return_value = dummy_start
tc = TrainerController(' ', ' ', 1, None, True, True, False, 1,
1, 1, 1)
1, 1, 1, '', "tests/test_unitytrainers.py")
open_name = '%s.open' % __name__
open_name = 'unitytrainers.trainer_controller' + '.open'
with mock.patch(open_name, create=True) as mock_open:
mock_open.return_value = 0
mock_load.return_value = dummy_config
config = TrainerController._load_config("tests/test_unitytrainers.py")
assert(len(config) == 1)
assert(config['default']['trainer'] == "ppo")
with mock.patch(open_name, create=True) as _:
with mock.patch('subprocess.Popen'):
with mock.patch('socket.socket') as mock_socket:
with mock.patch('glob.glob') as mock_glob:
mock_load.return_value = dummy_config
mock_glob.return_value = ['FakeLaunchPath']
mock_socket.return_value.accept.return_value = (mock_socket, 0)
mock_socket.recv.return_value.decode.return_value = dummy_start
mock_load.return_value = dummy_config
tc = TrainerController(' ', ' ', 1, None, True, True, False, 1,
1, 1, 1, '','')
config = tc._load_config()
assert(len(config) == 1)
assert(config['default']['trainer'] == "ppo")
open_name = '%s.open' % __name__
open_name = 'unitytrainers.trainer_controller' + '.open'
with mock.patch(open_name, create=True) as mock_open:
mock_open.return_value = 0
with mock.patch(open_name, create=True) as _:
with mock.patch('subprocess.Popen'):
with mock.patch('socket.socket') as mock_socket:
with mock.patch('glob.glob') as mock_glob:

tc = TrainerController(' ', ' ', 1, None, True, True, False, 1,
1, 1, 1)
1, 1, 1, '', "tests/test_unitytrainers.py")
config = tc._load_config("tests/test_unitytrainers.py")
config = tc._load_config()
tf.reset_default_graph()
with tf.Session() as sess:
tc._initialize_trainers(config, sess)

# Test for Behavior Cloning Trainer
mock_load.return_value = dummy_bc_config
config = tc._load_config("tests/test_unitytrainers.py")
config = tc._load_config()
tf.reset_default_graph()
with tf.Session() as sess:
tc._initialize_trainers(config, sess)

mock_load.return_value = dummy_bad_config
config = tc._load_config("tests/test_unitytrainers.py")
config = tc._load_config()
tf.reset_default_graph()
with tf.Session() as sess:
with pytest.raises(UnityEnvironmentException):

b = Buffer()
for fake_agent_id in range(4):
for step in range(9):
b[fake_agent_id]['state'].append(
b[fake_agent_id]['vector_observation'].append(
[100 * fake_agent_id + 10 * step + 1,
100 * fake_agent_id + 10 * step + 2,
100 * fake_agent_id + 10 * step + 3]

a = b[1]['state'].get_batch(batch_size=2, training_length=None, sequential=True)
a = b[1]['vector_observation'].get_batch(batch_size=2, training_length=None, sequential=True)
a = b[2]['state'].get_batch(batch_size=2, training_length=3, sequential=True)
a = b[2]['vector_observation'].get_batch(batch_size=2, training_length=3, sequential=True)
a = b[2]['state'].get_batch(batch_size=2, training_length=3, sequential=False)
a = b[2]['vector_observation'].get_batch(batch_size=2, training_length=3, sequential=False)
assert_array(a, np.array([
[[251, 252, 253], [261, 262, 263], [271, 272, 273]],
[[261, 262, 263], [271, 272, 273], [281, 282, 283]]

14
python/trainer_config.yaml


buffer_size: 20240
gamma: 0.995
max_steps: 1e6
summary_freq: 5000
summary_freq: 3000
ReacherBrain:
normalize: true
num_epoch: 3
time_horizon: 1000
batch_size: 2024
buffer_size: 20240
gamma: 0.995
max_steps: 1e6
summary_freq: 3000
BrainWallJumpCC:
max_steps: 2.0e5

trainer: imitation
max_steps: 10000
summary_freq: 1000
brain_to_imitate: ExpertBrain
brain_to_imitate: TeacherBrain
batch_size: 16
batches_per_epoch: 5
num_layers: 4

4
python/unitytrainers/bc/models.py


if brain.vector_action_space_type == "discrete":
self.action_probs = tf.nn.softmax(self.policy)
self.sample_action = tf.cast(tf.multinomial(self.policy, 1, name="action"), tf.int32)
self.true_action = tf.placeholder(shape=[None], dtype=tf.int32, name="expert_action")
self.true_action = tf.placeholder(shape=[None], dtype=tf.int32, name="teacher_action")
self.action_oh = tf.one_hot(self.true_action, self.a_size)
self.loss = tf.reduce_sum(-tf.log(self.action_probs + 1e-10) * self.action_oh)
self.action_percent = tf.reduce_mean(tf.cast(

self.true_action = tf.placeholder(shape=[None, self.a_size], dtype=tf.float32, name="expert_action")
self.true_action = tf.placeholder(shape=[None, self.a_size], dtype=tf.float32, name="teacher_action")
self.loss = tf.reduce_sum(tf.squared_difference(self.true_action, self.sample_action))
optimizer = tf.train.AdamOptimizer(learning_rate=lr)

77
python/unitytrainers/bc/trainer.py


run_list = [self.model.sample_action]
if self.use_observations:
for i, _ in enumerate(agent_brain.visual_observations):
feed_dict[self.model.observation_in[i]] = agent_brain.visual_observations[i]
feed_dict[self.model.visual_in[i]] = agent_brain.visual_observations[i]
feed_dict[self.model.state_in] = agent_brain.vector_observations
feed_dict[self.model.vector_in] = agent_brain.vector_observations
if self.use_recurrent:
if agent_brain.memories.shape[1] == 0:
agent_brain.memories = np.zeros((len(agent_brain.agents), self.m_size))

:param take_action_outputs: The outputs of the take action method.
"""
# Used to collect expert experience into training buffer
info_expert = curr_info[self.brain_to_imitate]
next_info_expert = next_info[self.brain_to_imitate]
for agent_id in info_expert.agents:
self.training_buffer[agent_id].last_brain_info = info_expert
# Used to collect teacher experience into training buffer
info_teacher = curr_info[self.brain_to_imitate]
next_info_teacher = next_info[self.brain_to_imitate]
for agent_id in info_teacher.agents:
self.training_buffer[agent_id].last_brain_info = info_teacher
for agent_id in next_info_expert.agents:
stored_info_expert = self.training_buffer[agent_id].last_brain_info
if stored_info_expert is None:
for agent_id in next_info_teacher.agents:
stored_info_teacher = self.training_buffer[agent_id].last_brain_info
if stored_info_teacher is None:
idx = stored_info_expert.agents.index(agent_id)
next_idx = next_info_expert.agents.index(agent_id)
info_expert_record, info_expert_reset = info_expert.text_observations[idx].lower().split(",")
next_info_expert_record, next_info_expert_reset = next_info_expert.text_observations[idx].\
lower().split(",")
if next_info_expert_reset == "true":
self.training_buffer.reset_update_buffer()
if info_expert_record == "true" and next_info_expert_record == "true":
if not stored_info_expert.local_done[idx]:
idx = stored_info_teacher.agents.index(agent_id)
next_idx = next_info_teacher.agents.index(agent_id)
if info_teacher.text_observations[idx] != "":
info_teacher_record, info_teacher_reset = info_teacher.text_observations[idx].lower().split(",")
next_info_teacher_record, next_info_teacher_reset = next_info_teacher.text_observations[idx].\
lower().split(",")
if next_info_teacher_reset == "true":
self.training_buffer.reset_update_buffer()
else:
info_teacher_record, next_info_teacher_record = "true", "true"
if info_teacher_record == "true" and next_info_teacher_record == "true":
if not stored_info_teacher.local_done[idx]:
for i, _ in enumerate(stored_info_expert.visual_observations):
for i, _ in enumerate(stored_info_teacher.visual_observations):
.append(stored_info_expert.visual_observations[i][idx])
.append(stored_info_teacher.visual_observations[i][idx])
.append(stored_info_expert.vector_observations[idx])
.append(stored_info_teacher.vector_observations[idx])
if stored_info_expert.memories.shape[1] == 0:
stored_info_expert.memories = np.zeros((len(stored_info_expert.agents), self.m_size))
self.training_buffer[agent_id]['memory'].append(stored_info_expert.memories[idx])
self.training_buffer[agent_id]['actions'].append(next_info_expert.previous_vector_actions[next_idx])
if stored_info_teacher.memories.shape[1] == 0:
stored_info_teacher.memories = np.zeros((len(stored_info_teacher.agents), self.m_size))
self.training_buffer[agent_id]['memory'].append(stored_info_teacher.memories[idx])
self.training_buffer[agent_id]['actions'].append(next_info_teacher.
previous_vector_actions[next_idx])
info_student = curr_info[self.brain_name]
next_info_student = next_info[self.brain_name]
for agent_id in info_student.agents:

Processing involves calculating value and advantage targets for model updating step.
:param info: Current AllBrainInfo
"""
info_expert = info[self.brain_to_imitate]
for l in range(len(info_expert.agents)):
if ((info_expert.local_done[l] or
len(self.training_buffer[info_expert.agents[l]]['actions']) > self.trainer_parameters[
info_teacher = info[self.brain_to_imitate]
for l in range(len(info_teacher.agents)):
if ((info_teacher.local_done[l] or
len(self.training_buffer[info_teacher.agents[l]]['actions']) > self.trainer_parameters[
and len(self.training_buffer[info_expert.agents[l]]['actions']) > 0):
agent_id = info_expert.agents[l]
and len(self.training_buffer[info_teacher.agents[l]]['actions']) > 0):
agent_id = info_teacher.agents[l]
self.training_buffer.append_update_buffer(agent_id, batch_size=None,
training_length=self.sequence_length)
self.training_buffer[agent_id].reset_agent()

self.model.batch_size: self.n_sequences,
self.model.sequence_length: self.sequence_length}
if not self.is_continuous:
feed_dict[self.model.state_in] = batch_states.reshape([-1, 1])
feed_dict[self.model.vector_in] = batch_states.reshape([-1, 1])
feed_dict[self.model.state_in] = batch_states.reshape([-1, self.brain.vector_observation_space_size *
feed_dict[self.model.vector_in] = batch_states.reshape([-1, self.brain.vector_observation_space_size *
for i, _ in enumerate(self.model.observation_in):
for i, _ in enumerate(self.model.visual_in):
feed_dict[self.model.observation_in[i]] = _obs.reshape([-1, _w, _h, _c])
feed_dict[self.model.visual_in[i]] = _obs.reshape([-1, _w, _h, _c])
if self.use_recurrent:
feed_dict[self.model.memory_in] = np.zeros([self.n_sequences, self.m_size])

30
python/unitytrainers/models.py


class LearningModel(object):
def __init__(self, m_size, normalize, use_recurrent, brain):
self.brain = brain
self.state_in = None
self.vector_in = None
self.observation_in = []
self.visual_in = []
self.batch_size = tf.placeholder(shape=None, dtype=tf.int32, name='batch_size')
self.sequence_length = tf.placeholder(shape=None, dtype=tf.int32, name='sequence_length')
self.m_size = m_size

else:
c_channels = 3
observation_in = tf.placeholder(shape=[None, o_size_h, o_size_w, c_channels], dtype=tf.float32, name=name)
return observation_in
visual_in = tf.placeholder(shape=[None, o_size_h, o_size_w, c_channels], dtype=tf.float32, name=name)
return visual_in
self.state_in = tf.placeholder(shape=[None, s_size], dtype=tf.float32, name='state')
self.vector_in = tf.placeholder(shape=[None, s_size], dtype=tf.float32, name='vector_observation')
if self.normalize:
self.running_mean = tf.get_variable("running_mean", [s_size], trainable=False, dtype=tf.float32,
initializer=tf.zeros_initializer())

self.update_mean = tf.assign(self.running_mean, self.new_mean)
self.update_variance = tf.assign(self.running_variance, self.new_variance)
self.normalized_state = tf.clip_by_value((self.state_in - self.running_mean) / tf.sqrt(
self.normalized_state = tf.clip_by_value((self.vector_in - self.running_mean) / tf.sqrt(
self.normalized_state = self.state_in
self.normalized_state = self.vector_in
self.state_in = tf.placeholder(shape=[None, 1], dtype=tf.int32, name='state')
self.vector_in = tf.placeholder(shape=[None, 1], dtype=tf.int32, name='vector_observation')
def create_continuous_state_encoder(self, h_size, activation, num_layers):
"""

:param num_layers: number of hidden layers to create.
:return: List of hidden layer tensors.
"""
conv1 = tf.layers.conv2d(self.observation_in[-1], 16, kernel_size=[8, 8], strides=[4, 4],
conv1 = tf.layers.conv2d(self.visual_in[-1], 16, kernel_size=[8, 8], strides=[4, 4],
activation=tf.nn.elu)
conv2 = tf.layers.conv2d(conv1, 32, kernel_size=[4, 4], strides=[2, 2],
activation=tf.nn.elu)

:param num_layers: number of hidden layers to create.
:return: List of hidden layer tensors.
"""
state_in = tf.reshape(self.state_in, [-1])
state_onehot = c_layers.one_hot_encoding(state_in, s_size)
vector_in = tf.reshape(self.vector_in, [-1])
state_onehot = c_layers.one_hot_encoding(vector_in, s_size)
hidden = state_onehot
for j in range(num_layers):
hidden = tf.layers.dense(hidden, h_size, use_bias=False, activation=activation)

else:
activation_fn = self.swish
self.observation_in = []
self.visual_in = []
self.observation_in.append(visual_input)
self.visual_in.append(visual_input)
self.create_vector_input(s_size)
final_hiddens = []

_half_point = int(m_size / 2)
with tf.variable_scope(name):
rnn_cell = tf.contrib.rnn.BasicLSTMCell(_half_point)
lstm_state_in = tf.contrib.rnn.LSTMStateTuple(memory_in[:, :_half_point], memory_in[:, _half_point:])
lstm_vector_in = tf.contrib.rnn.LSTMStateTuple(memory_in[:, :_half_point], memory_in[:, _half_point:])
initial_state=lstm_state_in,
initial_state=lstm_vector_in,
time_major=False,
dtype=tf.float32)

2
python/unitytrainers/ppo/models.py


appropriate PPO agent model for the environment.
:param brain: BrainInfo used to generate specific network graph.
:param lr: Learning rate.
:param h_size: Size of hidden layers/
:param h_size: Size of hidden layers
:param epsilon: Value for policy-divergence threshold.
:param beta: Strength of entropy regularization.
:return: a sub-class of PPOAgent tailored to the environment.

16
python/unitytrainers/ppo/trainer.py


feed_dict[self.model.prev_action] = np.reshape(curr_brain_info.previous_vector_actions, [-1])
if self.use_observations:
for i, _ in enumerate(curr_brain_info.visual_observations):
feed_dict[self.model.observation_in[i]] = curr_brain_info.visual_observations[i]
feed_dict[self.model.visual_in[i]] = curr_brain_info.visual_observations[i]
feed_dict[self.model.state_in] = curr_brain_info.vector_observations
feed_dict[self.model.vector_in] = curr_brain_info.vector_observations
if self.use_recurrent:
if curr_brain_info.memories.shape[1] == 0:
curr_brain_info.memories = np.zeros((len(curr_brain_info.agents), self.m_size))

feed_dict = {self.model.batch_size: len(info.vector_observations), self.model.sequence_length: 1}
if self.use_observations:
for i in range(len(info.visual_observations)):
feed_dict[self.model.observation_in[i]] = info.visual_observations[i]
feed_dict[self.model.visual_in[i]] = info.visual_observations[i]
feed_dict[self.model.state_in] = info.vector_observations
feed_dict[self.model.vector_in] = info.vector_observations
if self.use_recurrent:
if info.memories.shape[1] == 0:
info.memories = np.zeros((len(info.vector_observations), self.m_size))

_buffer['prev_action'][start:end]).reshape([-1])
if self.use_states:
if self.brain.vector_observation_space_type == "continuous":
feed_dict[self.model.state_in] = np.array(
feed_dict[self.model.vector_in] = np.array(
feed_dict[self.model.state_in] = np.array(
feed_dict[self.model.vector_in] = np.array(
for i, _ in enumerate(self.model.observation_in):
for i, _ in enumerate(self.model.visual_in):
feed_dict[self.model.observation_in[i]] = _obs.reshape([-1, _w, _h, _c])
feed_dict[self.model.visual_in[i]] = _obs.reshape([-1, _w, _h, _c])
# Memories are zeros
if self.use_recurrent:
# feed_dict[self.model.memory_in] = np.zeros([batch_size, self.m_size])

2
unity-environment/Assets/ML-Agents/Examples/3DBall/Scripts/Ball3DAgent.cs


public override void AgentAction(float[] act)
{
if (brain.brainParameters.vectorActionSpaceType == StateType.continuous)
if (brain.brainParameters.vectorActionSpaceType == SpaceType.continuous)
{
float action_z = 2f * Mathf.Clamp(act[0], -1f, 1f);
if ((gameObject.transform.rotation.z < 0.25f && action_z > 0f) ||

2
unity-environment/Assets/ML-Agents/Examples/3DBall/Scripts/Ball3DDecision.cs


public float[] Decide(List<float> state, List<Texture2D> observation, float reward, bool done, List<float> memory)
{
if (gameObject.GetComponent<Brain>().brainParameters.vectorActionSpaceType == StateType.continuous)
if (gameObject.GetComponent<Brain>().brainParameters.vectorActionSpaceType == SpaceType.continuous)
{
List<float> act = new List<float>();

2
unity-environment/Assets/ML-Agents/Examples/3DBall/Scripts/Ball3DHardAgent.cs


public override void AgentAction(float[] act)
{
if (brain.brainParameters.vectorActionSpaceType == StateType.continuous)
if (brain.brainParameters.vectorActionSpaceType == SpaceType.continuous)
{
float action_z = 2f * Mathf.Clamp(act[0], -1f, 1f);
if ((gameObject.transform.rotation.z < 0.25f && action_z > 0f) ||

2
unity-environment/Assets/ML-Agents/Examples/Area/Scripts/AreaAgent.cs


float directionZ = 0;
float directionY = 0;
if (brain.brainParameters.vectorActionSpaceType == StateType.continuous)
if (brain.brainParameters.vectorActionSpaceType == SpaceType.continuous)
{
directionX = Mathf.Clamp(act[0], -1f, 1f);
directionZ = Mathf.Clamp(act[1], -1f, 1f);

306
unity-environment/Assets/ML-Agents/Examples/Banana/BananaImitation.unity


- component: {fileID: 7561199}
- component: {fileID: 7561200}
m_Layer: 0
m_Name: ExpertBrain
m_Name: TeacherBrain
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0

vectorObservationSpaceType: 1
brainType: 0
CoreBrains:
- {fileID: 29328243}
- {fileID: 687699474}
- {fileID: 2082760005}
- {fileID: 728415826}
instanceID: 53712
- {fileID: 732354759}
- {fileID: 1117344192}
- {fileID: 714235400}
- {fileID: 2091631578}
instanceID: 12494
--- !u!114 &7561200
MonoBehaviour:
m_ObjectHideFlags: 0

m_Script: {fileID: 11500000, guid: c0205d4e23c794363ba1d78b1e3d7339, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &29328243
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 41e9bda8f3cf1492fa74926a530f6f70, type: 3}
m_Name: (Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)
m_EditorClassIdentifier:
broadcast: 1
continuousPlayerActions:
- key: 119
index: 0
value: 1
- key: 97
index: 1
value: -1
- key: 100
index: 1
value: 1
- key: 32
index: 2
value: 1
- key: 115
index: 0
value: -1
discretePlayerActions:
- key: 119
value: 1
- key: 32
value: 2
- key: 97
value: 3
- key: 100
value: 4
defaultAction: 0
brain: {fileID: 7561199}
--- !u!1001 &85500286
Prefab:
m_ObjectHideFlags: 0

m_PrefabParentObject: {fileID: 4978301839030222, guid: c7684b8f068694edb9b432c4a427e36d,
type: 2}
m_PrefabInternal: {fileID: 93417038}
--- !u!114 &154237818
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 35813a1be64e144f887d7d5f15b963fa, type: 3}
m_Name: (Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)
m_EditorClassIdentifier:
brain: {fileID: 2015024680}
--- !u!1 &192430538
GameObject:
m_ObjectHideFlags: 0

m_Father: {fileID: 0}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &545810891
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 943466ab374444748a364f9d6c3e2fe2, type: 3}
m_Name: (Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)
m_EditorClassIdentifier:
broadcast: 1
brain: {fileID: 7561199}
--- !u!114 &687699474
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 943466ab374444748a364f9d6c3e2fe2, type: 3}
m_Name: (Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)
m_EditorClassIdentifier:
broadcast: 1
brain: {fileID: 7561199}
--- !u!114 &728415826
--- !u!114 &523165459
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}

m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 8b23992c8eb17439887f5e944bf04a40, type: 3}
m_Name: (Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)
m_Name: (Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)
m_EditorClassIdentifier:
broadcast: 1
graphModel: {fileID: 4900000, guid: 2671f35d7452742cb9f019fb5e30d682, type: 3}

minValue: -0.5
maxValue: 0.5
BatchSizePlaceholderName: batch_size
StatePlacholderName: state
VectorObservationPlacholderName: state
ObservationPlaceholderName: []
VisualObservationPlaceholderName: []
--- !u!114 &753967989
--- !u!114 &714235400
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}

m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 8b23992c8eb17439887f5e944bf04a40, type: 3}
m_Name: (Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)
m_Script: {fileID: 11500000, guid: 35813a1be64e144f887d7d5f15b963fa, type: 3}
m_Name: (Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)
m_EditorClassIdentifier:
brain: {fileID: 7561199}
--- !u!114 &732354759
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 41e9bda8f3cf1492fa74926a530f6f70, type: 3}
m_Name: (Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)
graphModel: {fileID: 4900000, guid: 2671f35d7452742cb9f019fb5e30d682, type: 3}
graphScope:
graphPlaceholders:
- name: epsilon
valueType: 1
minValue: -0.5
maxValue: 0.5
BatchSizePlaceholderName: batch_size
StatePlacholderName: state
RecurrentInPlaceholderName: recurrent_in
RecurrentOutPlaceholderName: recurrent_out
ObservationPlaceholderName: []
ActionPlaceholderName: action
PreviousActionPlaceholderName: prev_action
continuousPlayerActions:
- key: 119
index: 0
value: 1
- key: 97
index: 1
value: -1
- key: 100
index: 1
value: 1
- key: 32
index: 2
value: 1
- key: 115
index: 0
value: -1
discretePlayerActions:
- key: 119
value: 1
- key: 32
value: 2
- key: 97
value: 3
- key: 100
value: 4
defaultAction: 0
brain: {fileID: 7561199}
--- !u!1 &762086410
GameObject:

m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 45, y: 45, z: 0}
--- !u!114 &829097546
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 943466ab374444748a364f9d6c3e2fe2, type: 3}
m_Name: (Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)
m_EditorClassIdentifier:
broadcast: 1
brain: {fileID: 7561199}
--- !u!1 &844811898
GameObject:
m_ObjectHideFlags: 0

m_Father: {fileID: 1812954964}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 90, z: 0}
--- !u!114 &963921654
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 41e9bda8f3cf1492fa74926a530f6f70, type: 3}
m_Name: (Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)
m_EditorClassIdentifier:
broadcast: 1
continuousPlayerActions:
- key: 119
index: 0
value: 1
- key: 97
index: 1
value: -1
- key: 100
index: 1
value: 1
- key: 32
index: 2
value: 1
- key: 115
index: 0
value: -1
discretePlayerActions:
- key: 119
value: 1
- key: 32
value: 2
- key: 97
value: 3
- key: 100
value: 4
defaultAction: 0
brain: {fileID: 7561199}
--- !u!1001 &991769960
Prefab:
m_ObjectHideFlags: 0

propertyPath: agentParameters.numberOfActionsBetweenDecisions
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1023049942000704, guid: de088c15c5e19472981198726aca0baa, type: 2}
propertyPath: m_Name
value: TeacherAgent
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: de088c15c5e19472981198726aca0baa, type: 2}
m_IsPrefabParent: 0

m_Script: {fileID: 11500000, guid: d1cf16abc39fb4d6ca81222fc73d1bb5, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &1117344192
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 943466ab374444748a364f9d6c3e2fe2, type: 3}
m_Name: (Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)
m_EditorClassIdentifier:
broadcast: 1
brain: {fileID: 7561199}
--- !u!1 &1196437247
GameObject:
m_ObjectHideFlags: 0

m_Father: {fileID: 0}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1669781038
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 41e9bda8f3cf1492fa74926a530f6f70, type: 3}
m_Name: (Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)
m_EditorClassIdentifier:
broadcast: 1
continuousPlayerActions:
- key: 119
index: 0
value: 1
- key: 97
index: 1
value: -1
- key: 100
index: 1
value: 1
- key: 32
index: 2
value: 1
- key: 115
index: 0
value: -1
discretePlayerActions:
- key: 119
value: 1
- key: 32
value: 2
- key: 97
value: 3
- key: 100
value: 4
defaultAction: 0
brain: {fileID: 7561199}
--- !u!1 &1799584680
GameObject:
m_ObjectHideFlags: 0

vectorObservationSpaceType: 1
brainType: 2
CoreBrains:
- {fileID: 1669781038}
- {fileID: 545810891}
- {fileID: 2144941368}
- {fileID: 753967989}
instanceID: 54598
- {fileID: 963921654}
- {fileID: 829097546}
- {fileID: 154237818}
- {fileID: 523165459}
instanceID: 12662
--- !u!1 &2038164702
GameObject:
m_ObjectHideFlags: 0

m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 2038164702}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!114 &2082760005
--- !u!114 &2091631578
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}

m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 35813a1be64e144f887d7d5f15b963fa, type: 3}
m_Name: (Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)
m_Script: {fileID: 11500000, guid: 8b23992c8eb17439887f5e944bf04a40, type: 3}
m_Name: (Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)
broadcast: 1
graphModel: {fileID: 4900000, guid: 2671f35d7452742cb9f019fb5e30d682, type: 3}
graphScope:
graphPlaceholders:
- name: epsilon
valueType: 1
minValue: -0.5
maxValue: 0.5
BatchSizePlaceholderName: batch_size
VectorObservationPlacholderName: state
RecurrentInPlaceholderName: recurrent_in
RecurrentOutPlaceholderName: recurrent_out
VisualObservationPlaceholderName: []
ActionPlaceholderName: action
PreviousActionPlaceholderName: prev_action
--- !u!114 &2144941368
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 35813a1be64e144f887d7d5f15b963fa, type: 3}
m_Name: (Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)
m_EditorClassIdentifier:
brain: {fileID: 2015024680}

3
unity-environment/Assets/ML-Agents/Examples/Hallway/Scripts/HallwayAgent.cs


Vector3 dirToGo = Vector3.zero;
Vector3 rotateDir = Vector3.zero;
if (brain.brainParameters.vectorActionSpaceType == StateType.continuous)
if (brain.brainParameters.vectorActionSpaceType == SpaceType.continuous)
{
dirToGo = transform.forward * Mathf.Clamp(act[0], -1f, 1f);
rotateDir = transform.up * Mathf.Clamp(act[1], -1f, 1f);

461
unity-environment/Assets/ML-Agents/Examples/Reacher/Scene.unity


--- !u!104 &2
RenderSettings:
m_ObjectHideFlags: 0
serializedVersion: 8
serializedVersion: 9
m_Fog: 0
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
m_FogMode: 3

m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 762086411}
m_IndirectSpecularColor: {r: 0.4465785, g: 0.49641252, b: 0.574817, a: 1}
m_IndirectSpecularColor: {r: 0.4465934, g: 0.49642956, b: 0.5748249, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0

m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 1
m_LightmapEditorSettings:
serializedVersion: 9
serializedVersion: 10
m_TextureWidth: 1024
m_TextureHeight: 1024
m_AtlasSize: 1024
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 1

m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
m_ShowResolutionOverlay: 1
m_LightingDataAsset: {fileID: 0}
m_UseShadowmask: 1
--- !u!196 &4

propertyPath: m_Name
value: Agent (1)
objectReference: {fileID: 0}
- target: {fileID: 114955921823023820, guid: 2f13abef2db804f96bdc7692a1dcf2b2,
type: 2}
propertyPath: agentParameters.maxStep
value: 4000
objectReference: {fileID: 0}
- target: {fileID: 114955921823023820, guid: 2f13abef2db804f96bdc7692a1dcf2b2,
type: 2}
propertyPath: agentParameters.numberOfActionsBetweenDecisions
value: 4
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 2f13abef2db804f96bdc7692a1dcf2b2, type: 2}
m_IsPrefabParent: 0

m_PrefabParentObject: {fileID: 1644872085946016, guid: 2f13abef2db804f96bdc7692a1dcf2b2,
type: 2}
m_PrefabInternal: {fileID: 103720292}
--- !u!114 &105498462
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 41e9bda8f3cf1492fa74926a530f6f70, type: 3}
m_Name: (Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)
m_EditorClassIdentifier:
broadcast: 1
continuousPlayerActions: []
discretePlayerActions: []
defaultAction: -1
brain: {fileID: 846768605}
--- !u!114 &169591833
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 8b23992c8eb17439887f5e944bf04a40, type: 3}
m_Name: (Clone)(Clone)(Clone)(Clone)
m_EditorClassIdentifier:
broadcast: 1
graphModel: {fileID: 4900000, guid: 8db6173148a6f4e7fa654ed627c88d7a, type: 3}
graphScope:
graphPlaceholders: []
BatchSizePlaceholderName: batch_size
VectorObservationPlacholderName: state
RecurrentInPlaceholderName: recurrent_in
RecurrentOutPlaceholderName: recurrent_out
VisualObservationPlaceholderName: []
ActionPlaceholderName: action
PreviousActionPlaceholderName: prev_action
brain: {fileID: 846768605}
--- !u!1001 &201192304
Prefab:
m_ObjectHideFlags: 0

propertyPath: brain
value:
objectReference: {fileID: 846768605}
- target: {fileID: 114955921823023820, guid: 2f13abef2db804f96bdc7692a1dcf2b2,
type: 2}
propertyPath: agentParameters.maxStep
value: 4000
objectReference: {fileID: 0}
- target: {fileID: 114955921823023820, guid: 2f13abef2db804f96bdc7692a1dcf2b2,
type: 2}
propertyPath: agentParameters.numberOfActionsBetweenDecisions
value: 4
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 2f13abef2db804f96bdc7692a1dcf2b2, type: 2}
m_IsPrefabParent: 0

propertyPath: m_Name
value: Agent (13)
objectReference: {fileID: 0}
- target: {fileID: 114955921823023820, guid: 2f13abef2db804f96bdc7692a1dcf2b2,
type: 2}
propertyPath: agentParameters.maxStep
value: 4000
objectReference: {fileID: 0}
- target: {fileID: 114955921823023820, guid: 2f13abef2db804f96bdc7692a1dcf2b2,
type: 2}
propertyPath: agentParameters.numberOfActionsBetweenDecisions
value: 4
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 2f13abef2db804f96bdc7692a1dcf2b2, type: 2}
m_IsPrefabParent: 0

propertyPath: m_Name
value: Agent (22)
objectReference: {fileID: 0}
- target: {fileID: 114955921823023820, guid: 2f13abef2db804f96bdc7692a1dcf2b2,
type: 2}
propertyPath: agentParameters.maxStep
value: 4000
objectReference: {fileID: 0}
- target: {fileID: 114955921823023820, guid: 2f13abef2db804f96bdc7692a1dcf2b2,
type: 2}
propertyPath: agentParameters.numberOfActionsBetweenDecisions
value: 4
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 2f13abef2db804f96bdc7692a1dcf2b2, type: 2}
m_IsPrefabParent: 0

m_PrefabParentObject: {fileID: 1644872085946016, guid: 2f13abef2db804f96bdc7692a1dcf2b2,
type: 2}
m_PrefabInternal: {fileID: 269521201}
--- !u!114 &327113840
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 41e9bda8f3cf1492fa74926a530f6f70, type: 3}
m_Name: (Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)
m_EditorClassIdentifier:
broadcast: 1
continuousPlayerActions: []
discretePlayerActions: []
defaultAction: -1
brain: {fileID: 846768605}
--- !u!1 &330647278
GameObject:
m_ObjectHideFlags: 0

m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_Materials:
- {fileID: 2100000, guid: 3736de91af62e4be7a3d8752592c6c61, type: 2}
m_StaticBatchInfo:

propertyPath: m_Name
value: Agent (20)
objectReference: {fileID: 0}
- target: {fileID: 114955921823023820, guid: 2f13abef2db804f96bdc7692a1dcf2b2,
type: 2}
propertyPath: agentParameters.maxStep
value: 4000
objectReference: {fileID: 0}
- target: {fileID: 114955921823023820, guid: 2f13abef2db804f96bdc7692a1dcf2b2,
type: 2}
propertyPath: agentParameters.numberOfActionsBetweenDecisions
value: 4
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 2f13abef2db804f96bdc7692a1dcf2b2, type: 2}
m_IsPrefabParent: 0

propertyPath: m_Name
value: Agent (31)
objectReference: {fileID: 0}
- target: {fileID: 114955921823023820, guid: 2f13abef2db804f96bdc7692a1dcf2b2,
type: 2}
propertyPath: agentParameters.maxStep
value: 4000
objectReference: {fileID: 0}
- target: {fileID: 114955921823023820, guid: 2f13abef2db804f96bdc7692a1dcf2b2,
type: 2}
propertyPath: agentParameters.numberOfActionsBetweenDecisions
value: 4
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 2f13abef2db804f96bdc7692a1dcf2b2, type: 2}
m_IsPrefabParent: 0

propertyPath: m_Name
value: Agent (24)
objectReference: {fileID: 0}
- target: {fileID: 114955921823023820, guid: 2f13abef2db804f96bdc7692a1dcf2b2,
type: 2}
propertyPath: agentParameters.maxStep
value: 4000
objectReference: {fileID: 0}
- target: {fileID: 114955921823023820, guid: 2f13abef2db804f96bdc7692a1dcf2b2,
type: 2}
propertyPath: agentParameters.numberOfActionsBetweenDecisions
value: 4
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 2f13abef2db804f96bdc7692a1dcf2b2, type: 2}
m_IsPrefabParent: 0

propertyPath: m_Name
value: Agent (12)
objectReference: {fileID: 0}
- target: {fileID: 114955921823023820, guid: 2f13abef2db804f96bdc7692a1dcf2b2,
type: 2}
propertyPath: agentParameters.maxStep
value: 4000
objectReference: {fileID: 0}
- target: {fileID: 114955921823023820, guid: 2f13abef2db804f96bdc7692a1dcf2b2,
type: 2}
propertyPath: agentParameters.numberOfActionsBetweenDecisions
value: 4
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 2f13abef2db804f96bdc7692a1dcf2b2, type: 2}
m_IsPrefabParent: 0

propertyPath: m_Name
value: Agent (5)
objectReference: {fileID: 0}
- target: {fileID: 114955921823023820, guid: 2f13abef2db804f96bdc7692a1dcf2b2,
type: 2}
propertyPath: agentParameters.maxStep
value: 4000
objectReference: {fileID: 0}
- target: {fileID: 114955921823023820, guid: 2f13abef2db804f96bdc7692a1dcf2b2,
type: 2}
propertyPath: agentParameters.numberOfActionsBetweenDecisions
value: 4
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 2f13abef2db804f96bdc7692a1dcf2b2, type: 2}
m_IsPrefabParent: 0

propertyPath: m_Name
value: Agent (9)
objectReference: {fileID: 0}
- target: {fileID: 114955921823023820, guid: 2f13abef2db804f96bdc7692a1dcf2b2,
type: 2}
propertyPath: agentParameters.maxStep
value: 4000
objectReference: {fileID: 0}
- target: {fileID: 114955921823023820, guid: 2f13abef2db804f96bdc7692a1dcf2b2,
type: 2}
propertyPath: agentParameters.numberOfActionsBetweenDecisions
value: 4
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 2f13abef2db804f96bdc7692a1dcf2b2, type: 2}
m_IsPrefabParent: 0

m_PrefabParentObject: {fileID: 1644872085946016, guid: 2f13abef2db804f96bdc7692a1dcf2b2,
type: 2}
m_PrefabInternal: {fileID: 547117383}
--- !u!114 &551611617
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 8b23992c8eb17439887f5e944bf04a40, type: 3}
m_Name: (Clone)(Clone)
m_EditorClassIdentifier:
broadcast: 1
graphModel: {fileID: 4900000, guid: 8db6173148a6f4e7fa654ed627c88d7a, type: 3}
graphScope:
graphPlaceholders:
- name: epsilon
valueType: 1
minValue: -1
maxValue: 1
BatchSizePlaceholderName: batch_size
StatePlacholderName: state
RecurrentInPlaceholderName: recurrent_in
RecurrentOutPlaceholderName: recurrent_out
ObservationPlaceholderName: []
ActionPlaceholderName: action
brain: {fileID: 846768605}
--- !u!1001 &591860098
Prefab:
m_ObjectHideFlags: 0

- target: {fileID: 1395682910799436, guid: 2f13abef2db804f96bdc7692a1dcf2b2, type: 2}
propertyPath: m_Name
value: Agent (3)
objectReference: {fileID: 0}
- target: {fileID: 114955921823023820, guid: 2f13abef2db804f96bdc7692a1dcf2b2,
type: 2}
propertyPath: agentParameters.maxStep
value: 4000
objectReference: {fileID: 0}
- target: {fileID: 114955921823023820, guid: 2f13abef2db804f96bdc7692a1dcf2b2,
type: 2}
propertyPath: agentParameters.numberOfActionsBetweenDecisions
value: 4
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 2f13abef2db804f96bdc7692a1dcf2b2, type: 2}

propertyPath: m_Name
value: Agent (18)
objectReference: {fileID: 0}
- target: {fileID: 114955921823023820, guid: 2f13abef2db804f96bdc7692a1dcf2b2,
type: 2}
propertyPath: agentParameters.maxStep
value: 4000
objectReference: {fileID: 0}
- target: {fileID: 114955921823023820, guid: 2f13abef2db804f96bdc7692a1dcf2b2,
type: 2}
propertyPath: agentParameters.numberOfActionsBetweenDecisions
value: 4
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 2f13abef2db804f96bdc7692a1dcf2b2, type: 2}
m_IsPrefabParent: 0

propertyPath: m_Name
value: Agent (8)
objectReference: {fileID: 0}
- target: {fileID: 114955921823023820, guid: 2f13abef2db804f96bdc7692a1dcf2b2,
type: 2}
propertyPath: agentParameters.maxStep
value: 4000
objectReference: {fileID: 0}
- target: {fileID: 114955921823023820, guid: 2f13abef2db804f96bdc7692a1dcf2b2,
type: 2}
propertyPath: agentParameters.numberOfActionsBetweenDecisions
value: 4
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 2f13abef2db804f96bdc7692a1dcf2b2, type: 2}
m_IsPrefabParent: 0

propertyPath: m_Name
value: Agent (15)
objectReference: {fileID: 0}
- target: {fileID: 114955921823023820, guid: 2f13abef2db804f96bdc7692a1dcf2b2,
type: 2}
propertyPath: agentParameters.maxStep
value: 4000
objectReference: {fileID: 0}
- target: {fileID: 114955921823023820, guid: 2f13abef2db804f96bdc7692a1dcf2b2,
type: 2}
propertyPath: agentParameters.numberOfActionsBetweenDecisions
value: 4
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 2f13abef2db804f96bdc7692a1dcf2b2, type: 2}
m_IsPrefabParent: 0

propertyPath: m_Name
value: Agent (19)
objectReference: {fileID: 0}
- target: {fileID: 114955921823023820, guid: 2f13abef2db804f96bdc7692a1dcf2b2,
type: 2}
propertyPath: agentParameters.maxStep
value: 4000
objectReference: {fileID: 0}
- target: {fileID: 114955921823023820, guid: 2f13abef2db804f96bdc7692a1dcf2b2,
type: 2}
propertyPath: agentParameters.numberOfActionsBetweenDecisions
value: 4
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 2f13abef2db804f96bdc7692a1dcf2b2, type: 2}
m_IsPrefabParent: 0

- component: {fileID: 846768604}
- component: {fileID: 846768605}
m_Layer: 0
m_Name: Brain
m_Name: ReacherBrain
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0

m_Name:
m_EditorClassIdentifier:
brainParameters:
vectorObservationSize: 26
numStackedVectorObservations: 1
vectorObservationSize: 24
numStackedVectorObservations: 3
vectorActionSize: 4
cameraResolutions: []
vectorActionDescriptions:

-
vectorActionSpaceType: 1
vectorObservationSpaceType: 1
brainType: 0
brainType: 3
- {fileID: 327113840}
- {fileID: 1028133595}
- {fileID: 1146467767}
- {fileID: 551611617}
instanceID: 95334
- {fileID: 105498462}
- {fileID: 949391681}
- {fileID: 1042778401}
- {fileID: 169591833}
instanceID: 3972
--- !u!1001 &915173805
Prefab:
m_ObjectHideFlags: 0

propertyPath: m_Name
value: Agent (14)
objectReference: {fileID: 0}
- target: {fileID: 114955921823023820, guid: 2f13abef2db804f96bdc7692a1dcf2b2,
type: 2}
propertyPath: agentParameters.maxStep
value: 4000
objectReference: {fileID: 0}
- target: {fileID: 114955921823023820, guid: 2f13abef2db804f96bdc7692a1dcf2b2,
type: 2}
propertyPath: agentParameters.numberOfActionsBetweenDecisions
value: 4
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 2f13abef2db804f96bdc7692a1dcf2b2, type: 2}
m_IsPrefabParent: 0

m_PrefabParentObject: {fileID: 1644872085946016, guid: 2f13abef2db804f96bdc7692a1dcf2b2,
type: 2}
m_PrefabInternal: {fileID: 915173805}
--- !u!114 &1028133595
--- !u!114 &949391681
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}

m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 943466ab374444748a364f9d6c3e2fe2, type: 3}
m_Name: (Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)
m_Name: (Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)
--- !u!114 &1042778401
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 35813a1be64e144f887d7d5f15b963fa, type: 3}
m_Name: (Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)
m_EditorClassIdentifier:
brain: {fileID: 846768605}
--- !u!1001 &1065008966
Prefab:
m_ObjectHideFlags: 0

propertyPath: m_Name
value: Agent (11)
objectReference: {fileID: 0}
- target: {fileID: 114955921823023820, guid: 2f13abef2db804f96bdc7692a1dcf2b2,
type: 2}
propertyPath: agentParameters.maxStep
value: 4000
objectReference: {fileID: 0}
- target: {fileID: 114955921823023820, guid: 2f13abef2db804f96bdc7692a1dcf2b2,
type: 2}
propertyPath: agentParameters.numberOfActionsBetweenDecisions
value: 4
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 2f13abef2db804f96bdc7692a1dcf2b2, type: 2}
m_IsPrefabParent: 0

m_PrefabParentObject: {fileID: 1644872085946016, guid: 2f13abef2db804f96bdc7692a1dcf2b2,
type: 2}
m_PrefabInternal: {fileID: 1065008966}
--- !u!114 &1146467767
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 35813a1be64e144f887d7d5f15b963fa, type: 3}
m_Name: (Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)(Clone)
m_EditorClassIdentifier:
brain: {fileID: 846768605}
--- !u!1001 &1147289133
Prefab:
m_ObjectHideFlags: 0

propertyPath: m_Name
value: Agent (7)
objectReference: {fileID: 0}
- target: {fileID: 114955921823023820, guid: 2f13abef2db804f96bdc7692a1dcf2b2,
type: 2}
propertyPath: agentParameters.maxStep
value: 4000
objectReference: {fileID: 0}
- target: {fileID: 114955921823023820, guid: 2f13abef2db804f96bdc7692a1dcf2b2,
type: 2}
propertyPath: agentParameters.numberOfActionsBetweenDecisions
value: 4
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 2f13abef2db804f96bdc7692a1dcf2b2, type: 2}
m_IsPrefabParent: 0

propertyPath: m_Name
value: Agent (26)
objectReference: {fileID: 0}
- target: {fileID: 114955921823023820, guid: 2f13abef2db804f96bdc7692a1dcf2b2,
type: 2}
propertyPath: agentParameters.maxStep
value: 4000
objectReference: {fileID: 0}
- target: {fileID: 114955921823023820, guid: 2f13abef2db804f96bdc7692a1dcf2b2,
type: 2}
propertyPath: agentParameters.numberOfActionsBetweenDecisions
value: 4
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 2f13abef2db804f96bdc7692a1dcf2b2, type: 2}
m_IsPrefabParent: 0

propertyPath: m_Name
value: Agent (16)
objectReference: {fileID: 0}
- target: {fileID: 114955921823023820, guid: 2f13abef2db804f96bdc7692a1dcf2b2,
type: 2}
propertyPath: agentParameters.maxStep
value: 4000
objectReference: {fileID: 0}
- target: {fileID: 114955921823023820, guid: 2f13abef2db804f96bdc7692a1dcf2b2,
type: 2}
propertyPath: agentParameters.numberOfActionsBetweenDecisions
value: 4
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 2f13abef2db804f96bdc7692a1dcf2b2, type: 2}
m_IsPrefabParent: 0

propertyPath: m_Name
value: Agent (27)
objectReference: {fileID: 0}
- target: {fileID: 114955921823023820, guid: 2f13abef2db804f96bdc7692a1dcf2b2,
type: 2}
propertyPath: agentParameters.maxStep
value: 4000
objectReference: {fileID: 0}
- target: {fileID: 114955921823023820, guid: 2f13abef2db804f96bdc7692a1dcf2b2,
type: 2}
propertyPath: agentParameters.numberOfActionsBetweenDecisions
value: 4
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 2f13abef2db804f96bdc7692a1dcf2b2, type: 2}
m_IsPrefabParent: 0

propertyPath: m_Name
value: Agent (17)
objectReference: {fileID: 0}
- target: {fileID: 114955921823023820, guid: 2f13abef2db804f96bdc7692a1dcf2b2,
type: 2}
propertyPath: agentParameters.maxStep
value: 4000
objectReference: {fileID: 0}
- target: {fileID: 114955921823023820, guid: 2f13abef2db804f96bdc7692a1dcf2b2,
type: 2}
propertyPath: agentParameters.numberOfActionsBetweenDecisions
value: 4
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 2f13abef2db804f96bdc7692a1dcf2b2, type: 2}
m_IsPrefabParent: 0

propertyPath: m_Name
value: Agent (28)
objectReference: {fileID: 0}
- target: {fileID: 114955921823023820, guid: 2f13abef2db804f96bdc7692a1dcf2b2,
type: 2}
propertyPath: agentParameters.maxStep
value: 4000
objectReference: {fileID: 0}
- target: {fileID: 114955921823023820, guid: 2f13abef2db804f96bdc7692a1dcf2b2,
type: 2}
propertyPath: agentParameters.numberOfActionsBetweenDecisions
value: 4
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 2f13abef2db804f96bdc7692a1dcf2b2, type: 2}
m_IsPrefabParent: 0

propertyPath: m_Name
value: Agent (6)
objectReference: {fileID: 0}
- target: {fileID: 114955921823023820, guid: 2f13abef2db804f96bdc7692a1dcf2b2,
type: 2}
propertyPath: agentParameters.maxStep
value: 4000
objectReference: {fileID: 0}
- target: {fileID: 114955921823023820, guid: 2f13abef2db804f96bdc7692a1dcf2b2,
type: 2}
propertyPath: agentParameters.numberOfActionsBetweenDecisions
value: 4
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 2f13abef2db804f96bdc7692a1dcf2b2, type: 2}
m_IsPrefabParent: 0

trainingConfiguration:
width: 80
height: 80
qualityLevel: 1
qualityLevel: 0
timeScale: 100
targetFrameRate: 60
inferenceConfiguration:

propertyPath: m_Name
value: Agent (23)
objectReference: {fileID: 0}
- target: {fileID: 114955921823023820, guid: 2f13abef2db804f96bdc7692a1dcf2b2,
type: 2}
propertyPath: agentParameters.maxStep
value: 4000
objectReference: {fileID: 0}
- target: {fileID: 114955921823023820, guid: 2f13abef2db804f96bdc7692a1dcf2b2,
type: 2}
propertyPath: agentParameters.numberOfActionsBetweenDecisions
value: 4
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 2f13abef2db804f96bdc7692a1dcf2b2, type: 2}
m_IsPrefabParent: 0

- target: {fileID: 1395682910799436, guid: 2f13abef2db804f96bdc7692a1dcf2b2, type: 2}
propertyPath: m_Name
value: Agent (21)
objectReference: {fileID: 0}
- target: {fileID: 114955921823023820, guid: 2f13abef2db804f96bdc7692a1dcf2b2,
type: 2}
propertyPath: agentParameters.maxStep
value: 4000
objectReference: {fileID: 0}
- target: {fileID: 114955921823023820, guid: 2f13abef2db804f96bdc7692a1dcf2b2,
type: 2}
propertyPath: agentParameters.numberOfActionsBetweenDecisions
value: 4
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 2f13abef2db804f96bdc7692a1dcf2b2, type: 2}

propertyPath: m_Name
value: Agent (2)
objectReference: {fileID: 0}
- target: {fileID: 114955921823023820, guid: 2f13abef2db804f96bdc7692a1dcf2b2,
type: 2}
propertyPath: agentParameters.maxStep
value: 4000
objectReference: {fileID: 0}
- target: {fileID: 114955921823023820, guid: 2f13abef2db804f96bdc7692a1dcf2b2,
type: 2}
propertyPath: agentParameters.numberOfActionsBetweenDecisions
value: 4
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 2f13abef2db804f96bdc7692a1dcf2b2, type: 2}
m_IsPrefabParent: 0

propertyPath: m_Name
value: Agent (10)
objectReference: {fileID: 0}
- target: {fileID: 114955921823023820, guid: 2f13abef2db804f96bdc7692a1dcf2b2,
type: 2}
propertyPath: agentParameters.maxStep
value: 4000
objectReference: {fileID: 0}
- target: {fileID: 114955921823023820, guid: 2f13abef2db804f96bdc7692a1dcf2b2,
type: 2}
propertyPath: agentParameters.numberOfActionsBetweenDecisions
value: 4
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 2f13abef2db804f96bdc7692a1dcf2b2, type: 2}
m_IsPrefabParent: 0

propertyPath: m_Name
value: Agent (30)
objectReference: {fileID: 0}
- target: {fileID: 114955921823023820, guid: 2f13abef2db804f96bdc7692a1dcf2b2,
type: 2}
propertyPath: agentParameters.maxStep
value: 4000
objectReference: {fileID: 0}
- target: {fileID: 114955921823023820, guid: 2f13abef2db804f96bdc7692a1dcf2b2,
type: 2}
propertyPath: agentParameters.numberOfActionsBetweenDecisions
value: 4
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 2f13abef2db804f96bdc7692a1dcf2b2, type: 2}
m_IsPrefabParent: 0

propertyPath: m_Name
value: Agent (29)
objectReference: {fileID: 0}
- target: {fileID: 114955921823023820, guid: 2f13abef2db804f96bdc7692a1dcf2b2,
type: 2}
propertyPath: agentParameters.maxStep
value: 4000
objectReference: {fileID: 0}
- target: {fileID: 114955921823023820, guid: 2f13abef2db804f96bdc7692a1dcf2b2,
type: 2}
propertyPath: agentParameters.numberOfActionsBetweenDecisions
value: 4
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 2f13abef2db804f96bdc7692a1dcf2b2, type: 2}
m_IsPrefabParent: 0

propertyPath: m_Name
value: Agent (4)
objectReference: {fileID: 0}
- target: {fileID: 114955921823023820, guid: 2f13abef2db804f96bdc7692a1dcf2b2,
type: 2}
propertyPath: agentParameters.maxStep
value: 4000
objectReference: {fileID: 0}
- target: {fileID: 114955921823023820, guid: 2f13abef2db804f96bdc7692a1dcf2b2,
type: 2}
propertyPath: agentParameters.numberOfActionsBetweenDecisions
value: 4
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 2f13abef2db804f96bdc7692a1dcf2b2, type: 2}
m_IsPrefabParent: 0

- target: {fileID: 1395682910799436, guid: 2f13abef2db804f96bdc7692a1dcf2b2, type: 2}
propertyPath: m_Name
value: Agent (25)
objectReference: {fileID: 0}
- target: {fileID: 114955921823023820, guid: 2f13abef2db804f96bdc7692a1dcf2b2,
type: 2}
propertyPath: agentParameters.maxStep
value: 4000
objectReference: {fileID: 0}
- target: {fileID: 114955921823023820, guid: 2f13abef2db804f96bdc7692a1dcf2b2,
type: 2}
propertyPath: agentParameters.numberOfActionsBetweenDecisions
value: 4
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 2f13abef2db804f96bdc7692a1dcf2b2, type: 2}

4
unity-environment/Assets/ML-Agents/Examples/Reacher/Scripts/FlyCamera.cs


{
/*
Writen by Windexglow 11-13-10. Use it, edit it, steal it I don't care.
Converted to C# 27-02-13 - no credit wanted.
Simple flycam I made, since I couldn't find any others made public.
Made simple to use (drag and drop, done) for regular keyboard layout
wasd : basic movement
shift : Makes camera accelerate
space : Moves camera on X and Z axis only. So camera doesn't gain any height*/

62
unity-environment/Assets/ML-Agents/Examples/Reacher/Scripts/ReacherAgent.cs


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine;
public class ReacherAgent : Agent {

Rigidbody rbB;
float goalSpeed;
/// <summary>
/// Collect the rigidbodies of the reacher in order to resue them for
/// observations and actions.
/// </summary>
public override void InitializeAgent()
{
rbA = pendulumA.GetComponent<Rigidbody>();

/// <summary>
/// We collect the normalized rotations, angularal velocities, and velocities of both
/// limbs of the reacher as well as the relative position of the target and hand.
/// </summary>
AddVectorObs(pendulumA.transform.rotation.x);
AddVectorObs(pendulumA.transform.rotation.y);
AddVectorObs(pendulumA.transform.rotation.z);
AddVectorObs(pendulumA.transform.rotation.w);
AddVectorObs(pendulumA.transform.rotation.eulerAngles.x / 180.0f - 1.0f);
AddVectorObs(pendulumA.transform.rotation.eulerAngles.y / 180.0f - 1.0f);
AddVectorObs(pendulumA.transform.rotation.eulerAngles.z / 180.0f - 1.0f);
AddVectorObs(rbA.angularVelocity.x);
AddVectorObs(rbA.angularVelocity.y);
AddVectorObs(rbA.angularVelocity.z);

AddVectorObs(pendulumB.transform.rotation.x);
AddVectorObs(pendulumB.transform.rotation.y);
AddVectorObs(pendulumB.transform.rotation.z);
AddVectorObs(pendulumB.transform.rotation.w);
AddVectorObs(pendulumB.transform.rotation.eulerAngles.x / 180.0f - 1.0f);
AddVectorObs(pendulumB.transform.rotation.eulerAngles.y / 180.0f - 1.0f);
AddVectorObs(pendulumB.transform.rotation.eulerAngles.z / 180.0f - 1.0f);
AddVectorObs(rbB.angularVelocity.x);
AddVectorObs(rbB.angularVelocity.y);
AddVectorObs(rbB.angularVelocity.z);

AddVectorObs(goal.transform.position.x - transform.position.x);
AddVectorObs(goal.transform.position.y - transform.position.y);
AddVectorObs(goal.transform.position.z - transform.position.z);
AddVectorObs(hand.transform.position.x - transform.position.x);
AddVectorObs(hand.transform.position.y - transform.position.y);
AddVectorObs(hand.transform.position.z - transform.position.z);
Vector3 localGoalPosition = goal.transform.position - transform.position;
AddVectorObs(localGoalPosition.x);
AddVectorObs(localGoalPosition.y);
AddVectorObs(localGoalPosition.z);
}
Vector3 localHandPosition = hand.transform.position - transform.position;
AddVectorObs(localHandPosition.x);
AddVectorObs(localHandPosition.y);
AddVectorObs(localHandPosition.z);
}
/// <summary>
/// The agent's four actions correspond to torques on each of the two joints.
/// </summary>
public override void AgentAction(float[] act)
{
goalDegree += goalSpeed;

torque_x = Mathf.Clamp(act[2], -1, 1) * 100f;
torque_z = Mathf.Clamp(act[3], -1, 1) * 100f;
rbB.AddTorque(new Vector3(torque_x, 0f, torque_z));
}
}
/// <summary>
/// Used to move the position of the target goal around the agent.
/// </summary>
void UpdateGoalPosition() {
float radians = (goalDegree * Mathf.PI) / 180f;
float goalX = 8f * Mathf.Cos(radians);

}
/// <summary>
/// Resets the position and velocity of the agent and the goal.
/// </summary>
public override void AgentReset()
{
pendulumA.transform.position = new Vector3(0f, -4f, 0f) + transform.position;

goalSpeed = academy.goalSpeed;
goal.transform.localScale = new Vector3(goalSize, goalSize, goalSize);
}
public override void AgentOnDone()
{
}
}

6
unity-environment/Assets/ML-Agents/Examples/Reacher/Scripts/ReacherGoal.cs


}
}
private void OnTriggerStay(Collider other)
private void OnTriggerStay(Collider other)
agent.GetComponent<ReacherAgent>().SetReward( 0.1f);
//agent.GetComponent<PendulumAgent>().done = true;
agent.GetComponent<ReacherAgent>().AddReward(0.01f);
}
}
}

964
unity-environment/Assets/ML-Agents/Examples/Reacher/TFModels/Reacher.bytes
文件差异内容过多而无法显示
查看文件

3
unity-environment/Assets/ML-Agents/Examples/Reacher/TFModels/Reacher.bytes.meta


fileFormatVersion: 2
guid: 8db6173148a6f4e7fa654ed627c88d7a
timeCreated: 1508690694
licenseType: Pro
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

6
unity-environment/Assets/ML-Agents/Scripts/Agent.cs


return;
BrainParameters param = brain.brainParameters;
if (param.vectorActionSpaceType == StateType.continuous)
if (param.vectorActionSpaceType == SpaceType.continuous)
{
_action.vectorActions = new float[param.vectorActionSize];
_info.StoredVectorActions = new float[param.vectorActionSize];

_action.textActions = "";
_info.memories = new List<float>();
_action.memories = new List<float>();
if (param.vectorObservationSpaceType == StateType.continuous)
if (param.vectorObservationSpaceType == SpaceType.continuous)
{
_info.vectorObservation =
new List<float>(param.vectorObservationSize);

CollectObservations();
BrainParameters param = brain.brainParameters;
if (param.vectorObservationSpaceType == StateType.continuous)
if (param.vectorObservationSpaceType == SpaceType.continuous)
{
if (_info.vectorObservation.Count != param.vectorObservationSize)
{

6
unity-environment/Assets/ML-Agents/Scripts/Brain.cs


Internal
}
public enum StateType
public enum SpaceType
{
discrete,
continuous

public string[] vectorActionDescriptions;
/**< \brief The list of strings describing what the actions correpond to */
public StateType vectorActionSpaceType = StateType.discrete;
public SpaceType vectorActionSpaceType = SpaceType.discrete;
public StateType vectorObservationSpaceType = StateType.continuous;
public SpaceType vectorObservationSpaceType = SpaceType.continuous;
/**< \brief Defines if the state is discrete or continuous */
}

10
unity-environment/Assets/ML-Agents/Scripts/CoreBrainInternal.cs


/// Modify only in inspector : Name of the placholder of the batch size
public string BatchSizePlaceholderName = "batch_size";
/// Modify only in inspector : Name of the state placeholder
public string VectorObservationPlacholderName = "state";
public string VectorObservationPlacholderName = "vector_observation";
/// Modify only in inspector : Name of the recurrent input
public string RecurrentInPlaceholderName = "recurrent_in";
/// Modify only in inspector : Name of the recurrent output

if (hasState)
{
int stateLength = 1;
if (brain.brainParameters.vectorObservationSpaceType == StateType.continuous)
if (brain.brainParameters.vectorObservationSpaceType == SpaceType.continuous)
{
stateLength = brain.brainParameters.vectorObservationSize;
}

// Create the state tensor
if (hasState)
{
if (brain.brainParameters.vectorObservationSpaceType == StateType.discrete)
if (brain.brainParameters.vectorObservationSpaceType == SpaceType.discrete)
{
var discreteInputState = new int[currentBatchSize, 1];
for (int i = 0; i < currentBatchSize; i++)

}
if (brain.brainParameters.vectorActionSpaceType == StateType.continuous)
if (brain.brainParameters.vectorActionSpaceType == SpaceType.continuous)
{
var output = networkOutput[0].GetValue() as float[,];
var i = 0;

i++;
}
}
else if (brain.brainParameters.vectorActionSpaceType == StateType.discrete)
else if (brain.brainParameters.vectorActionSpaceType == SpaceType.discrete)
{
long[,] output = networkOutput[0].GetValue() as long[,];
var i = 0;

12
unity-environment/Assets/ML-Agents/Scripts/CoreBrainPlayer.cs


/// decide action
public void DecideAction(Dictionary<Agent, AgentInfo> agentInfo)
{
if (coord != null)
{
coord.GiveBrainInfo(brain, agentInfo);
}
if (brain.brainParameters.vectorActionSpaceType == StateType.continuous)
if (coord != null)
{
coord.GiveBrainInfo(brain, agentInfo);
}
if (brain.brainParameters.vectorActionSpaceType == SpaceType.continuous)
{
foreach (Agent agent in agentInfo.Keys)
{

broadcast = EditorGUILayout.Toggle(new GUIContent("Broadcast",
"If checked, the brain will broadcast states and actions to Python."), broadcast);
var serializedBrain = new SerializedObject(this);
if (brain.brainParameters.vectorActionSpaceType == StateType.continuous)
if (brain.brainParameters.vectorActionSpaceType == SpaceType.continuous)
{
GUILayout.Label("Edit the continuous inputs for your actions", EditorStyles.boldLabel);
var chas = serializedBrain.FindProperty("continuousPlayerActions");

2
unity-environment/Assets/ML-Agents/Scripts/ExternalCommunicator.cs


for (int i = 0; i < current_agents[brainName].Count(); i++)
{
if (brain.brainParameters.vectorActionSpaceType == StateType.continuous)
if (brain.brainParameters.vectorActionSpaceType == SpaceType.continuous)
{
current_agents[brainName][i].UpdateVectorAction(rMessage.vector_action[brainName].GetRange(
i * brain.brainParameters.vectorActionSize, brain.brainParameters.vectorActionSize).ToArray());

2
unity-environment/Assets/ML-Agents/Scripts/Monitor.cs


float paddingwidth = 10 * widthScaler;
float scale = 1f;
var origin = new Vector3(0, Screen.height);
var origin = new Vector3(Screen.width / 2 - keyPixelWidth, Screen.height);
if (!(target == canvas.transform))
{
Vector3 cam2obj = target.position - Camera.main.transform.position;

54
unity-environment/Assets/ML-Agents/Scripts/BCTeacherHelper.cs


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
/// <summary>
/// Behavioral Cloning Helper script. Attach to teacher agent to enable
/// resetting the experience buffer, as well as toggling session recording.
/// </summary>
public class BCTeacherHelper : MonoBehaviour {
bool recordExperiences;
bool resetBuffer;
Agent myAgent;
float bufferResetTime;
public KeyCode recordKey = KeyCode.R;
public KeyCode resetKey = KeyCode.C;
// Use this for initialization
void Start () {
recordExperiences = true;
resetBuffer = false;
myAgent = GetComponent<Agent>();
bufferResetTime = Time.time;
}
// Update is called once per frame
void Update () {
if (Input.GetKeyDown(recordKey))
{
recordExperiences = !recordExperiences;
}
if (Input.GetKeyDown(resetKey))
{
resetBuffer = true;
bufferResetTime = Time.time;
}
else
{
resetBuffer = false;
}
Monitor.Log("Recording experiences " + recordKey.ToString(), recordExperiences.ToString());
float timeSinceBufferReset = Time.time - bufferResetTime;
Monitor.Log("Seconds since buffer reset " + resetKey.ToString(), Mathf.FloorToInt(timeSinceBufferReset));
}
void FixedUpdate()
{
// Convert both bools into single comma separated string. Python makes
// assumption that this structure is preserved.
myAgent.SetTextObs(recordExperiences.ToString() + "," + resetBuffer.ToString());
}
}

3
docs/Installation-Docker.md


# Docker Set-up _[Experimental]_
**Work In Progress**

46
unity-environment/Assets/ML-Agents/Scripts/TeacherHelper.cs


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class TeacherHelper : MonoBehaviour {
bool recordExperiences;
bool resetBuffer;
Agent myAgent;
float bufferResetTime;
// Use this for initialization
void Start () {
recordExperiences = true;
resetBuffer = false;
myAgent = GetComponent<Agent>();
bufferResetTime = Time.time;
}
// Update is called once per frame
void Update () {
if (Input.GetKeyDown(KeyCode.R))
{
recordExperiences = !recordExperiences;
}
if (Input.GetKeyDown(KeyCode.C))
{
resetBuffer = true;
bufferResetTime = Time.time;
}
else
{
resetBuffer = false;
}
Monitor.Log("Recording experiences", recordExperiences.ToString());
float timeSinceBufferReset = Time.time - bufferResetTime;
Monitor.Log("Seconds since buffer reset", Mathf.FloorToInt(timeSinceBufferReset));
}
void FixedUpdate()
{
// Convert both bools into single comma separated string. Python makes
// assumption that this structure is preserved.
myAgent.SetTextObs(recordExperiences.ToString() + "," + resetBuffer.ToString());
}
}

/unity-environment/Assets/ML-Agents/Scripts/TeacherHelper.cs.meta → /unity-environment/Assets/ML-Agents/Scripts/BCTeacherHelper.cs.meta

/images/docker_build_settings.png → /docs/images/docker_build_settings.png

正在加载...
取消
保存