浏览代码

* Ticked API :

- Ticked API for pypi for mlagents
 - Ticked API for pypi for mlagents_envs
 - Ticked Communication number for API
 - Ticked API for unity-gym

* Ticked the API for the pytest
/develop-generalizationTraining-TrainerController
eshvk 6 年前
当前提交
a50aadda
共有 6 个文件被更改,包括 29 次插入29 次删除
  1. 46
      UnitySDK/Assets/ML-Agents/Scripts/Academy.cs
  2. 2
      gym-unity/setup.py
  3. 2
      ml-agents-envs/mlagents/envs/environment.py
  4. 2
      ml-agents-envs/mlagents/envs/mock_communicator.py
  5. 2
      ml-agents-envs/setup.py
  6. 4
      ml-agents/setup.py

46
UnitySDK/Assets/ML-Agents/Scripts/Academy.cs


/**
* Welcome to Unity Machine Learning Agents (ML-Agents).
*
*
* The ML-Agents toolkit contains five entities: Academy, Brain, Agent, Communicator and
* Python API. The academy, and all its brains and connected agents live within
* a learning environment (herin called Environment), while the communicator

[Tooltip("Frames per second (FPS) engine attempts to maintain.")]
public int targetFrameRate;
/// Initializes a new instance of the
/// Initializes a new instance of the
/// <see cref="EnvironmentConfiguration"/> class.
/// <param name="width">Width of environment window (pixels).</param>
/// <param name="height">Height of environment window (pixels).</param>

}
/// <summary>
/// An Academy is where Agent objects go to train their behaviors. More
/// An Academy is where Agent objects go to train their behaviors. More
/// in a scene is attached to one brain (a single brain may be attached to
/// in a scene is attached to one brain (a single brain may be attached to
/// multiple agents). Currently, this class is expected to be extended to
/// implement the desired academy behavior.
/// </summary>

"docs/Learning-Environment-Design-Academy.md")]
public abstract class Academy : MonoBehaviour
{
[SerializeField]
[SerializeField]
private const string kApiVersion = "API-7";
private const string kApiVersion = "API-8";
/// Used to restore oringal value when deriving Academy modifies it
/// Used to restore oringal value when deriving Academy modifies it
/// Used to restore oringal value when deriving Academy modifies it
/// Used to restore oringal value when deriving Academy modifies it
/// Used to restore oringal value when deriving Academy modifies it
/// Used to restore oringal value when deriving Academy modifies it
private float originalMaximumDeltaTime;
// Fields provided in the Inspector

/// <summary/>
/// <remarks>
/// Default reset parameters are specified in the academy Editor, and can
/// be modified when training with an external Brain by passinga config
/// dictionary at reset.
/// be modified when training with an external Brain by passinga config
/// dictionary at reset.
/// </remarks>
[SerializeField]
[Tooltip("List of custom parameters that can be changed in the " +

/// the same message is not used multiple times.
private ulong lastCommunicatorMessageNumber;
/// If true, the Academy will use inference settings. This field is
/// If true, the Academy will use inference settings. This field is
/// initialized in <see cref="Awake"/> depending on the presence
/// or absence of a communicator. Furthermore, it can be modified by an
/// external Brain during reset via <see cref="SetIsInference"/>.

/// current episode.
bool maxStepReached;
/// The number of episodes completed by the environment. Incremented
/// The number of episodes completed by the environment. Incremented
/// each time a step is taken in the environment. Is reset to 0 during
/// each time a step is taken in the environment. Is reset to 0 during
/// <see cref="AcademyReset"/>.
int stepCount;

// The Academy uses a series of events to communicate with agents and
// brains to facilitate synchronization. More specifically, it ensure
// that all the agents performs their steps in a consistent order (i.e. no
// agent can act based on a decision before another agent has had a chance
// agent can act based on a decision before another agent has had a chance
// Signals to all the Brains at each environment step so they can decide
// Signals to all the Brains at each environment step so they can decide
// actions for their agents.
public event System.Action BrainDecideAction;

// Signals to all the agents at each environment step along with the
// Signals to all the agents at each environment step along with the
// Academy's maxStepReached, done and stepCount values. The agents rely
// on this event to update their own values of max step reached and done
// in addition to aligning on the step count of the global episode.

// if their flag has been set to done (assuming the agent has requested a
// if their flag has been set to done (assuming the agent has requested a
// decision).
public event System.Action AgentResetIfDone;

originalGravity = Physics.gravity;
originalFixedDeltaTime = Time.fixedDeltaTime;
originalMaximumDeltaTime = Time.maximumDeltaTime;
InitializeAcademy();
Communicator communicator = null;

{
brain.SetToControlledExternally();
}
// Try to launch the communicator by usig the arguments passed at launch
try
{

}
/// <summary>
/// Forces the full reset. The done flags are not affected. Is either
/// Forces the full reset. The done flags are not affected. Is either
/// called the first reset at inference and every external reset
/// at training.
/// </summary>

2
gym-unity/setup.py


from setuptools import setup, find_packages
setup(name='gym_unity',
version='0.3.0',
version='0.4.0',
description='Unity Machine Learning Agents Gym Interface',
license='Apache License 2.0',
author='Unity Technologies',

2
ml-agents-envs/mlagents/envs/environment.py


atexit.register(self._close)
self.port = base_port + worker_id
self._buffer_size = 12000
self._version_ = "API-7"
self._version_ = "API-8"
self._loaded = False # If true, this means the environment was successfully loaded
self.proc1 = None # The process that is started. If None, no process was started
self.communicator = self.get_communicator(worker_id, base_port, timeout_wait)

2
ml-agents-envs/mlagents/envs/mock_communicator.py


)
rl_init = UnityRLInitializationOutput(
name="RealFakeAcademy",
version="API-7",
version="API-8",
log_path="",
brain_parameters=[bp]
)

2
ml-agents-envs/setup.py


setup(
name='mlagents_envs',
version='0.7.0',
version='0.8.0',
description='Unity Machine Learning Agents Interface',
url='https://github.com/Unity-Technologies/ml-agents',
author='Unity Technologies',

4
ml-agents/setup.py


setup(
name='mlagents',
version='0.7.0',
version='0.8.0',
description='Unity Machine Learning Agents',
long_description=long_description,
long_description_content_type='text/markdown',

zip_safe=False,
install_requires=[
'mlagents_envs==0.7.0',
'mlagents_envs==0.8.0',
'tensorflow>=1.7,<1.8',
'Pillow>=4.2.1',
'matplotlib',

正在加载...
取消
保存