Skip to content

Release 0.11.0 #2833

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 89 commits into from
Nov 4, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
765e758
first commit
anupambhatnagar Sep 9, 2019
ebb82d2
adding colon
anupambhatnagar Sep 9, 2019
4650477
changes reflecting comments on github
anupambhatnagar Sep 10, 2019
614bea9
small edits
anupambhatnagar Sep 10, 2019
7da5526
added cloud training unsupported comment
anupambhatnagar Sep 10, 2019
883b343
more small edits
anupambhatnagar Sep 10, 2019
8c8cf81
make docs agree with code (#2612)
Sep 24, 2019
f8dfd68
[protobuf] Update protobufs with patch from circleci. (#2618)
surfnerd Sep 25, 2019
c916801
[ci] Add protobuf generation check as a CI job. (#2617)
surfnerd Sep 25, 2019
1160fb4
Move gRPC code to its own special place (#2621)
surfnerd Sep 25, 2019
4aae592
Better environment shutdown (#2620)
Sep 25, 2019
99e997c
use [] instead of Dictionary.Add to avoid key exception (#2629)
Sep 26, 2019
9370b63
small mypy cleanup (#2637)
Sep 30, 2019
c8ce9c5
added venv setup documentation for windows
anupambhatnagar Sep 30, 2019
71d82bb
Rename protobuf objects to be suffixed with 'Proto' in python and C#.…
surfnerd Sep 30, 2019
e58a1a5
Merge branch 'develop' into release-0.10.0
Sep 30, 2019
fbc8857
Merge pull request #2649 from Unity-Technologies/release-0.10.0
Sep 30, 2019
d873d16
Cleanup visual obs setup (#2647)
Oct 1, 2019
cb1065d
Modified meta_curriculum JSON reading loop to only deal with .json (#…
Vaspra Oct 1, 2019
296020f
Fixed various typos (#2652)
DanAmador Oct 1, 2019
2caf0ba
Rename k_KApiVersion to k_ApiVersion. (#2655)
surfnerd Oct 1, 2019
3a189a0
[migrating] Update migrating docs to call out gRPC service changes. (…
surfnerd Oct 1, 2019
426a2dd
removing docker and windows docs
anupambhatnagar Oct 1, 2019
31977ee
resolving conflicts
anupambhatnagar Oct 1, 2019
60dd1de
removing broken links
anupambhatnagar Oct 1, 2019
79cc770
fixing typos
anupambhatnagar Oct 2, 2019
8f4e603
Fix issue which prevented training when code stripping was enabled (#…
surfnerd Oct 2, 2019
0eb23a3
Use a class for camera res, not dict (#2656)
Oct 2, 2019
7e1ed38
addressing comments from Marwan
anupambhatnagar Oct 3, 2019
c3f37f6
Feature Deprecation : Online Behavioral Cloning (#2659)
vincentpierre Oct 3, 2019
80c1af3
Fix bug when batch size is a non-multiple of sequence length (#2661)
Oct 3, 2019
4b882a5
Fix visual Pyramids and Pushblock scenes (#2672)
Oct 3, 2019
d524f0d
Develop deprecate broadcasting (#2669)
vincentpierre Oct 4, 2019
8066b8f
Removing virus (#2680)
vincentpierre Oct 4, 2019
c38a7fa
C# hierarchical timers (#2198)
Oct 4, 2019
d7a6ed7
Bugfix for LSTM+BC (#2679)
Oct 4, 2019
49b6a49
resolving conflicts
anupambhatnagar Oct 7, 2019
866ed5c
Merge pull request #2515 from Unity-Technologies/ab/docs-updates
anupambhatnagar Oct 7, 2019
6457bbd
Refactor ICommunicator API (#2675)
surfnerd Oct 7, 2019
46a999e
Change docs and ipynb to reflect new import path for UnityEnvironment…
Oct 8, 2019
370972c
exclude bair.berkeley.edu temporarily (#2702)
Oct 9, 2019
e701d44
Develop spawn brains (#2676)
vincentpierre Oct 9, 2019
e84da3f
Barracuda hotfix for TF2 AddV2 support (#2703)
mantasp Oct 9, 2019
b05d828
Fix SAC + LSTM Barracuda inference (#2698)
Oct 9, 2019
a05e669
Remove references to batcher in comments. (#2701)
surfnerd Oct 9, 2019
5ab6d1f
Merge Hotfix 0.10.1 to Develop (#2708)
Oct 10, 2019
8f2aff4
Develop unified version (#2712)
Oct 10, 2019
b165082
check for unecessary list comprehensions (#2707)
Oct 10, 2019
c545d0b
Remove Destructor for RpcCommunicator. (#2716)
surfnerd Oct 10, 2019
8aa48fd
Revert "Develop unified version (#2712)" (#2719)
Oct 10, 2019
b3a54eb
Tick gym_unity version to 0.4.8 (#2711)
Oct 10, 2019
affd875
Fix "memory leak" during inference (#2722)
Oct 11, 2019
54fe1a9
Made gridworld a prefab so we can have more of them at once (#2721)
vincentpierre Oct 11, 2019
e394da3
Made ModelParamLoader static and made a modelRunner for batching at i…
vincentpierre Oct 11, 2019
64a0df7
detect common mock errors (#2723)
Oct 11, 2019
eb60ac7
Revert "exclude bair.berkeley.edu temporarily (#2702)" (#2734)
Oct 15, 2019
7884b0c
Fix rider warnings and format code. (#2730)
surfnerd Oct 15, 2019
fd78219
Speed up processing large vector observations (#2717)
Oct 16, 2019
0963264
Fix crash when SAC is used with Curiosity and Continuous Actions (#2740)
Oct 16, 2019
773ee62
update mypy-protobuf and generate pyi files (#2757)
Oct 18, 2019
9314f24
Added --cpu flag to train using CPU only (#2755)
caioc2 Oct 19, 2019
248b467
Update Learning-Environment-Design-Agents.md (#2764) (#2770)
Oct 21, 2019
a580b31
Fixing unecerrary error with curriculum (#2772)
vincentpierre Oct 21, 2019
4a56460
[WIP] ISensor interface and use for visual observations (#2731)
Oct 22, 2019
e229197
move CacheBrainParameters() and friends out of #if blocks (#2777)
Oct 22, 2019
0b8a088
Add a Yamato pipeline to run C# editmode tests. (#2773)
surfnerd Oct 22, 2019
6fe5783
Better hyperparams for GridWorld/SAC (#2776)
Oct 22, 2019
607af33
Add a standalone build test pipeline to Yamato to check for player sc…
surfnerd Oct 23, 2019
22afeef
1 to 1 Brain to Agent (#2729)
vincentpierre Oct 23, 2019
1a1919a
[bug] Check for non-null event before invoking. Fixes MLA-217. (#2782)
surfnerd Oct 23, 2019
16d1092
migration guide for Visual Observations (#2785)
Oct 23, 2019
18e98fd
fix trailing whitespace in markdown (#2786)
Oct 23, 2019
2979bb0
update visual observations docs (#2787)
Oct 23, 2019
507243b
make RayPerception.Perceive abstract and override in base classes (#2…
Oct 23, 2019
747883d
gym - handle uint8_visual for observation space (#2783)
Oct 24, 2019
eb9943c
add note about Y flip (#2724)
Oct 24, 2019
42118fe
Deploy new versions to pypi (#2789)
Oct 24, 2019
444d3cc
Bump version to 0.11.0.dev0
Oct 24, 2019
c63fb43
Editing documentation : Migrating.md (#2793)
vincentpierre Oct 24, 2019
86f63d9
Update package and communicator versions to 0.11
Oct 28, 2019
a941c50
Remove pip cache fallback for CircleCI
Oct 28, 2019
f6861e6
Limit Tensorflow version for tests to <2.0
Oct 29, 2019
fcd14a7
Use stable bokken image. (#2815)
surfnerd Oct 29, 2019
e2492f8
build fixes for 2018+ (#2808)
Oct 29, 2019
57a6499
Add more editor versions for testing. (#2809)
surfnerd Oct 29, 2019
dfd65a3
class variable for API verison, fix env tests (#2817)
Oct 29, 2019
9503177
fixed area prefab
Hunter-Unity Oct 29, 2019
ac93337
Update NN models for all example scenes (v0.11.0)
Oct 30, 2019
a90477c
Merge branch 'master' into release-0.11.0
Oct 31, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Made ModelParamLoader static and made a modelRunner for batching at i…
…nference (#2718)

* Created the model runner and uses a shared interface with the communicator.

Fixing bugs with dealocation

Removing unnecessary code

Added code comments

Renaming

* Addressing comments

* Modified the constructor of ModelRunner

* Addressing comments

* remaming the _verbose variable

* Addressing comments : Removed the Verbose check in the LearningBrainEditor
  • Loading branch information
vincentpierre authored Oct 11, 2019
commit e394da38fe282c4bc5c5cb0c0958cdd4a8c29ebc
12 changes: 10 additions & 2 deletions UnitySDK/Assets/ML-Agents/Editor/LearningBrainEditor.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using UnityEngine;
using UnityEditor;
using Barracuda;


namespace MLAgents
{
Expand Down Expand Up @@ -57,12 +59,18 @@ public override void OnInspectorGUI()
}
if (m_RequireReload && m_TimeSinceModelReload > k_TimeBetweenModelReloads)
{
brain.ReloadModel();
m_RequireReload = false;
m_TimeSinceModelReload = 0;
}
// Display all failed checks
var failedChecks = brain.GetModelFailedChecks();
D.logEnabled = false;
Barracuda.Model barracudaModel = null;
if (brain.model != null)
{
barracudaModel = ModelLoader.Load(brain.model.Value);
}
var failedChecks = InferenceBrain.BarracudaModelParamLoader.CheckModel(
barracudaModel, brain.brainParameters);
foreach (var check in failedChecks)
{
if (check != null)
Expand Down
44 changes: 34 additions & 10 deletions UnitySDK/Assets/ML-Agents/Scripts/Academy.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
using UnityEngine;
using System.Linq;
using System.Collections.Generic;
using UnityEngine.Serialization;
#if UNITY_EDITOR
using UnityEditor;

#endif
using MLAgents.InferenceBrain;
using Barracuda;

/**
* Welcome to Unity Machine Learning Agents (ML-Agents).
Expand Down Expand Up @@ -179,6 +180,8 @@ bool IsCommunicatorOn
/// Pointer to the communicator currently in use by the Academy.
public ICommunicator Communicator;

private List<ModelRunner> m_ModelRunners = new List<ModelRunner>();

// Flag used to keep track of the first time the Academy is reset.
bool m_FirstAcademyReset;

Expand Down Expand Up @@ -300,7 +303,8 @@ private void InitializeEnvironment()
Communicator = null;
}

if (Communicator != null){
if (Communicator != null)
{
Communicator.QuitCommandReceived += OnQuitCommandReceived;
Communicator.ResetCommandReceived += OnResetCommand;
Communicator.RLInputReceived += OnRLInputReceived;
Expand All @@ -313,13 +317,13 @@ private void InitializeEnvironment()

SetIsInference(!IsCommunicatorOn);

BrainDecideAction += () => {};
DestroyAction += () => {};
AgentSetStatus += i => {};
AgentResetIfDone += () => {};
AgentSendState += () => {};
AgentAct += () => {};
AgentForceReset += () => {};
BrainDecideAction += () => { };
DestroyAction += () => { };
AgentSetStatus += i => { };
AgentResetIfDone += () => { };
AgentSendState += () => { };
AgentAct += () => { };
AgentForceReset += () => { };

ConfigureEnvironment();
}
Expand Down Expand Up @@ -555,6 +559,26 @@ void FixedUpdate()
EnvironmentStep();
}

/// <summary>
/// Creates or retrieves an existing ModelRunner that uses the same NNModel and the InferenceDevice as
/// provided.
/// </summary>
/// <param name="model"> The NNModel the ModelRunner must use </param>
/// <param name="brainParameters"> The brainParameters used to create the ModelRunner </param>
/// <param name="inferenceDevice"> The inference device (CPU or GPU) the ModelRunner will use </param>
/// <returns> The ModelRunner compatible with the input settings</returns>
public ModelRunner GetOrCreateModelRunner(NNModel model, BrainParameters brainParameters, InferenceDevice inferenceDevice)
{
var modelRunner = m_ModelRunners.Find(x => x.HasModel(model, inferenceDevice));
if (modelRunner == null)
{
modelRunner = new ModelRunner(
model, brainParameters, inferenceDevice);
m_ModelRunners.Add(modelRunner);
}
return modelRunner;
}

/// <summary>
/// Cleanup function
/// </summary>
Expand Down
41 changes: 25 additions & 16 deletions UnitySDK/Assets/ML-Agents/Scripts/Grpc/RpcCommunicator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ public void SubscribeBrain(string brainKey, BrainParameters brainParameters)
m_CurrentUnityRlOutput.AgentInfos.Add(
brainKey,
new CommunicatorObjects.UnityRLOutputProto.Types.ListAgentInfoProto());
if (m_CurrentUnityRlInitializationOutput == null){
if (m_CurrentUnityRlInitializationOutput == null)
{
m_CurrentUnityRlInitializationOutput = new CommunicatorObjects.UnityRLInitializationOutputProto();
}
m_CurrentUnityRlInitializationOutput.BrainParameters.Add(brainParameters.ToProto(brainKey, true));
Expand Down Expand Up @@ -175,7 +176,7 @@ private UnityInputProto Initialize(UnityOutputProto unityOutput,
/// <summary>
/// Close the communicator gracefully on both sides of the communication.
/// </summary>
public void Close()
public void Dispose()
{
# if UNITY_EDITOR || UNITY_STANDALONE_WIN || UNITY_STANDALONE_OSX || UNITY_STANDALONE_LINUX
if (!m_IsOpen)
Expand Down Expand Up @@ -206,19 +207,19 @@ private void SendCommandEvent(CommandProto command, EnvironmentParametersProto e
switch (command)
{
case CommandProto.Quit:
{
QuitCommandReceived?.Invoke();
return;
}
{
QuitCommandReceived?.Invoke();
return;
}
case CommandProto.Reset:
{
ResetCommandReceived?.Invoke(environmentParametersProto.ToEnvironmentResetParameters());
return;
}
{
ResetCommandReceived?.Invoke(environmentParametersProto.ToEnvironmentResetParameters());
return;
}
default:
{
return;
}
{
return;
}
}
}

Expand All @@ -231,8 +232,16 @@ private void SendRLInputReceivedEvent(bool isTraining)

#region Sending and retreiving data

public void PutObservations(
string brainKey, IEnumerable<Agent> agents)
/// <summary>
/// Sends the observations. If at least one brain has an agent in need of
/// a decision or if the academy is done, the data is sent via
/// Communicator. Else, a new step is realized. The data can only be
/// sent once all the brains that were part of initialization have tried
/// to send information.
/// </summary>
/// <param name="key">Batch Key.</param>
/// <param name="agents">Agent info.</param>
public void PutObservations(string brainKey, ICollection<Agent> agents)
{
// The brain tried called GiveBrainInfo, update m_hasQueried
m_HasQueried[brainKey] = true;
Expand Down Expand Up @@ -409,7 +418,7 @@ private void HandleOnPlayModeChanged(PlayModeStateChange state)
// This method is run whenever the playmode state is changed.
if (state == PlayModeStateChange.ExitingPlayMode)
{
Close();
Dispose();
}
}

Expand Down
22 changes: 6 additions & 16 deletions UnitySDK/Assets/ML-Agents/Scripts/ICommunicator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ Since the messages are sent back and forth with exchange and simultaneously when
UnityOutput and UnityInput can be extended to provide functionalities beyond RL
UnityRLOutput and UnityRLInput can be extended to provide new RL functionalities
*/
public interface ICommunicator
public interface ICommunicator : IBatchedDecisionMaker
{
/// <summary>
/// Quit was received by the communicator.
Expand Down Expand Up @@ -141,27 +141,17 @@ public interface ICommunicator
/// <param name="brainParameters">The Parameters for the Brain being registered</param>
void SubscribeBrain(string name, BrainParameters brainParameters);

/// <summary>
/// Sends the observations. If at least one brain has an agent in need of
/// a decision or if the academy is done, the data is sent via
/// Communicator. Else, a new step is realized. The data can only be
/// sent once all the brains that were part of initialization have tried
/// to send information.
/// </summary>
/// <param name="key">Batch Key.</param>
/// <param name="agents">Agent info.</param>
void PutObservations(string key, IEnumerable<Agent> agents);

/// <summary>
/// Gets the AgentActions based on the batching key.
/// </summary>
/// <param name="key">A key to identify which actions to get</param>
/// <returns></returns>
Dictionary<Agent, AgentAction> GetActions(string key);

/// <summary>
/// Close the communicator gracefully on both sides of the communication.
/// </summary>
void Close();
}

public interface IBatchedDecisionMaker : IDisposable
{
void PutObservations(string key, ICollection<Agent> agents);
}
}
Loading