浏览代码
Imitation Learning Helper (#371)
Imitation Learning Helper (#371)
* Add helper class to for Imitation Learning teacher. Allows for clearing buffer "C" and toggling adding info to the buffer "R"./develop-generalizationTraining-TrainerController
GitHub
7 年前
当前提交
69481d2d
共有 20 个文件被更改,包括 362 次插入 和 4588 次删除
-
2python/trainer_config.yaml
-
48python/unitytrainers/bc/trainer.py
-
11python/unitytrainers/buffer.py
-
854unity-environment/Assets/ML-Agents/Examples/Banana/BananaImitation.unity
-
6unity-environment/Assets/ML-Agents/Examples/Banana/Scripts/BananaAcademy.cs
-
1unity-environment/Assets/ML-Agents/Examples/Banana/Scripts/BananaAgent.cs
-
13unity-environment/Assets/ML-Agents/Examples/Banana/Scripts/BananaArea.cs
-
8unity-environment/Assets/ML-Agents/Scripts/Agent.cs
-
10unity-environment/ProjectSettings/EditorBuildSettings.asset
-
1unity-environment/ProjectSettings/GraphicsSettings.asset
-
135unity-environment/ProjectSettings/ProjectSettings.asset
-
2unity-environment/ProjectSettings/ProjectVersion.txt
-
46unity-environment/Assets/ML-Agents/Scripts/TeacherHelper.cs
-
11unity-environment/Assets/ML-Agents/Scripts/TeacherHelper.cs.meta
-
6unity-environment/ProjectSettings/PresetManager.asset
-
1001unity-environment/Assets/ML-Agents/Examples/3DBall/TFModels/ball-EBS_ppo.bytes
-
785unity-environment/Assets/ML-Agents/Examples/3DBall/TFModels/ball.bytes
-
8unity-environment/Assets/ML-Agents/Examples/3DBall/TFModels/ball.bytes.meta
-
1001unity-environment/Assets/ML-Agents/Examples/3DBall/ball-EBS-hard_ppo.bytes
-
1001unity-environment/Assets/ML-Agents/Examples/3DBall/ball-EBS_ppo.bytes
854
unity-environment/Assets/ML-Agents/Examples/Banana/BananaImitation.unity
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
m_EditorVersion: 2017.1.0f3 |
|||
m_EditorVersion: 2018.1.0b6 |
|
|||
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()); |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: d1cf16abc39fb4d6ca81222fc73d1bb5 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
%YAML 1.1 |
|||
%TAG !u! tag:unity3d.com,2011: |
|||
--- !u!1386491679 &1 |
|||
PresetManager: |
|||
m_ObjectHideFlags: 0 |
|||
m_DefaultList: [] |
1001
unity-environment/Assets/ML-Agents/Examples/3DBall/TFModels/ball-EBS_ppo.bytes
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
|
|||
6 |
|||
global_stepConst* |
|||
dtype0* |
|||
value |
|||
B :� |
|||
R |
|||
global_step/readIdentityglobal_step* |
|||
T0* |
|||
_class |
|||
loc:@global_step |
|||
? |
|||
statePlaceholder* |
|||
dtype0* |
|||
shape:��������� |
|||
Y |
|||
running_meanConst* |
|||
dtype0*5 |
|||
value,B*" y,���� q�Ie?��Y>�����N��k= |
|||
U |
|||
running_mean/readIdentityrunning_mean* |
|||
T0* |
|||
_class |
|||
loc:@running_mean |
|||
] |
|||
running_varianceConst* |
|||
dtype0*5 |
|||
value,B*" V@>@�6)@�F�B��!D�,�B�S�B\GE>OC |
|||
a |
|||
running_variance/readIdentityrunning_variance* |
|||
T0*# |
|||
_class |
|||
loc:@running_variance |
|||
- |
|||
subSubstaterunning_mean/read* |
|||
T0 |
|||
6 |
|||
CastCastglobal_step/read* |
|||
|
|||
SrcT0* |
|||
|
|||
DstT0 |
|||
2 |
|||
add/yConst* |
|||
valueB |
|||
* �?* |
|||
dtype0 |
|||
|
|||
addAddCastadd/y* |
|||
T0 |
|||
7 |
|||
truedivRealDivrunning_variance/readadd* |
|||
T0 |
|||
|
|||
SqrtSqrttruediv* |
|||
T0 |
|||
( |
|||
truediv_1RealDivsubSqrt* |
|||
T0 |
|||
G |
|||
normalized_state/Minimum/yConst* |
|||
valueB |
|||
* �@* |
|||
dtype0 |
|||
S |
|||
normalized_state/MinimumMinimum truediv_1normalized_state/Minimum/y* |
|||
T0 |
|||
? |
|||
normalized_state/yConst* |
|||
valueB |
|||
* ��* |
|||
dtype0 |
|||
R |
|||
normalized_stateMaximumnormalized_state/Minimumnormalized_state/y* |
|||
T0 |
|||
� |
|||
dense/kernelConst* |
|||
dtype0*� |
|||
value� B� �"� n��>� k����¬�=� ?��!�>�ϾwŞ��$����k>T� |
|||
���>��J?�ׂ���\>dC=�&>�1�?n5>�߭� \8��侊�t>��)?�D�>P>쐾>[]
?a3(?���>�ǭ>h�1>V^=b�
�HX?��,?,��>v�C��,��±Q>��>���=��4���x��g�>�7?<ٚ>�S>�������>����8Ӿ��=C��>O��=��9���k>�m.�6�$?�W�>��M=W潇c�>|�Ǽ���>N݊>n�:?���>\��<����Ҽ6�ýbD���b��}s�>sƢ�?��<�=�>���>v�R>'�]�����%�K=����>� ��g˾�<K�eK=>#6?�?`�O�!����>�w*�J4�ο�=���7̲=ey�>T8�>�k�>�d>�ċ>a>I �uT;-��>�kL�{��%7��F<K�����4�����9x(�|<�G���V�����~�����;������H{>��<���)�v��xɾ6��>R��<Zu�>3��m�'?�ƌ��=���V>ZE ���-��2���I)�fTg��??L �>h���>���8�����M�=���P�9�#���(?�����0>.q�> �Y���Ӿ }]�6��=�-��ݮP�����=�>'�����E�og����<'��>t�S>���������E��[j>f7�>ˆ���*>���=�����>E�?�#�>�%սD=��!�=�3d>@�R��=�ϧ��X0��;?J�����>�l/�f�־UT�>�D�>?(�>��-�v6��>>V�d��<|7>� |
|||
�>��>|�+�5����ڻ���>�� |
|||
>�u�>��>L���u���Jq`���=1K>;��=
i,�R-@?#�?1�>�����������=)��2�6<V"?W~�=�?}>�����>y������3����_��x�|L�>�2S�� �>T_����e!�>�\"�=L���K�h��-<�8K]>KWJ� |
|||
x�<��U>���;C��>RI����=5�1��>���<��ؾހ�<9��>���NI�> ��(x4<�s���>9��1�yT/<��`�����k�>ϩ�>�J�?Q'���6?��&�=�@�cT�=��߾"��뫾�CB��P�>�A����L��>�[6�!�K�.As>��?S�)�-ݴ=eh�>��>���>6�0? �D=®>��F>+nu>ֈ>��-�T�?�9���@?�^�>��?X:��cP=ɔ�>J�^���(�>�:��D���r�ƾB��>U��>ՠ�>�S��t�<�<?��w�X(���&�L�V�]6���5>V˳�/�2>����c�>��#�5t����=���=��>д�>|(r��z(?&��=Z�5=P��<�H |
|||
?��:�����t>��P����=�Z�>��>��=�U��Q?�F��p���@̼�'w�h�������+ľ�������E |
|||
�>4��>D�߾��<�2�>��+��P��O~ݾ�Uо��$�|���%<G6 �i�G��u�>���f�ݽ
���W
�<,G>n�;�u=6 �>$����>N=a@?Ɇc��j�����wò�j�?�r7?1kG=�V'?�s ?`��6�>^�Q�bڶ>�.ɾ�=�B�ھ@� ��胾���>����6��Hq+�.�!{�?=K��4ƴ>8�>4S��>G����Ⱦ�0)??:�������(?"��/v?������q:#>����%�"�ӊ�>��>W=_=�+�>V�i>]F >"b9����s��>�����,�5?�gT>�J�����4?KV���$����>Q>�����=�:��*R>������>U�?���>�b@�:)4=��!?S�!?}�>Ì?��=��B>x�]��� ���+>��+ൾ7l6<�,<�}1g=�6�=-,t>e&>HO��q�Qʼ>�b��n�=jխ������?U%? �1= 1��sI�����@�.t>+���^>��{>�Y�E�%�l��=�z�����`������� |
|||
�>8�b��o뾸"H>� $�@��>��?]�x>���G䟾��0?]! >�l�r�>��fJ�y�1�J2t��:�>r�ӍU>�w|>�%.>&��n.J�a6>yׇ���6>/'����v��M����>u�?�i!����>(m��W��>u(�������>o<Z�7��A�Ľ�!M���u���Ǿ�\�>�
?By��{^����.�E����=�~Ⱦj�<�C"��N���>���>z]="����W`��T> �7�"6�$�¾�6¾Ι�=� ����$?l���#4罐��=���>(�N=LL^>�:u>g����.+�t>,]1?25<�8#���z��C�>��"���H����q��=��B?%����?>�Z�� �7K?r���'?#�6���<.�+��e_=C|t���?k>O[����4��G�>]�>����I��|��&�>�u�� t>��?�+��e<��ݾ�I龷1|���߾�ɧ>d�>��Ⱦ63���a�=����SQ>���]��=�6� �w>+����ޥ�H�=Yr��-����}�.e�����<�J?wQ?�Z<�GW�p�н���=i��=.-$��`D>K������>}q��>\���+9�!G$���=�6Խz������<��>��~�$��A��>=�����ܭ���%�>�Ӿ��;��=""�6^1=!�es�=g����F��u��=7>���>�>�?P�����35�к6=�ih�<�>|�L?�%:>Q콱��>�������$ :?8T��ü>|�,>����Ǜ=t�V=���s�&��0?��{��*G�Kz>?۾z��>�z���K ��ƴ���ؾoy#>��?>n�����,=T��=����?�UP�&�?{T>xT2�� |
|||
��S�>ِ�� �t��������b?�|<��>5���#O�>�ݳ>Ȝ`������8�}�&��,ƽ�e��N�-�J�>w�>�v@=���=Ծ�>ބ?`�?��>\L���˾�Z��l�> |