{"id":1101,"date":"2018-04-10T23:34:58","date_gmt":"2018-04-10T21:34:58","guid":{"rendered":"http:\/\/ekhart.pl\/?p=1101"},"modified":"2018-04-10T23:36:28","modified_gmt":"2018-04-10T21:36:28","slug":"experimenting-with-unity-machine-learning-making-a-new-learning-environment","status":"publish","type":"post","link":"https:\/\/ekhart.pl\/index.php\/2018\/04\/10\/experimenting-with-unity-machine-learning-making-a-new-learning-environment\/","title":{"rendered":"Experimenting with Unity Machine Learning &#8211; Making a New Learning Environment"},"content":{"rendered":"<p><span class=\"embed-youtube\" style=\"text-align:center; display: block;\"><iframe loading=\"lazy\" class=\"youtube-player\" width=\"525\" height=\"296\" src=\"https:\/\/www.youtube.com\/embed\/t37W3JjTpJM?version=3&#038;rel=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;fs=1&#038;hl=en-US&#038;autohide=2&#038;wmode=transparent\" allowfullscreen=\"true\" style=\"border:0;\" sandbox=\"allow-scripts allow-same-origin allow-popups allow-presentation allow-popups-to-escape-sandbox\"><\/iframe><\/span><\/p>\n<p>I&#8217;ve <a href=\"https:\/\/github.com\/Unity-Technologies\/ml-agents\/blob\/master\/docs\/Learning-Environment-Create-New.md\">created a new learning <\/a>environment. The tutorial is great, but for me, most interesting part was to train the agent myself.<!--more--><\/p>\n<p>Unfortunately\u00a0<a href=\"https:\/\/github.com\/Unity-Technologies\/ml-agents\/blob\/master\/docs\/Learning-Environment-Create-New.md#testing-the-environment\">Testing the Environment<\/a> explains how to test it in Unity play mode using Player Brain. I want more. So I&#8217;ve tried\u00a0to\u00a0train External Brain for my own. And I&#8217;ve made it!<\/p>\n<p>I renamed Brain in Hierarchy to RollerBrain<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1102\" data-permalink=\"https:\/\/ekhart.pl\/index.php\/2018\/04\/10\/experimenting-with-unity-machine-learning-making-a-new-learning-environment\/rollerbrain\/\" data-orig-file=\"https:\/\/i0.wp.com\/ekhart.pl\/wp-content\/uploads\/2018\/04\/RollerBrain.png?fit=130%2C135&amp;ssl=1\" data-orig-size=\"130,135\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"RollerBrain\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/ekhart.pl\/wp-content\/uploads\/2018\/04\/RollerBrain.png?fit=130%2C135&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/ekhart.pl\/wp-content\/uploads\/2018\/04\/RollerBrain.png?fit=130%2C135&amp;ssl=1\" class=\"alignnone size-full wp-image-1102\" src=\"https:\/\/i0.wp.com\/ekhart.pl\/wp-content\/uploads\/2018\/04\/RollerBrain.png?resize=130%2C135&#038;ssl=1\" alt=\"RollerBrain\" width=\"130\" height=\"135\" data-recalc-dims=\"1\" \/><\/p>\n<p>Then I copied\u00a0 <a href=\"https:\/\/github.com\/Unity-Technologies\/ml-agents\">Unity-Technologies\/ml-agents<\/a> <span style=\"text-decoration: underline;\">\\python\\trainer_config.<\/span>yaml\u00a0SmallWallBrain and create\u00a0RollerBrain with parameters<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1103\" data-permalink=\"https:\/\/ekhart.pl\/index.php\/2018\/04\/10\/experimenting-with-unity-machine-learning-making-a-new-learning-environment\/rollerbrain-yaml\/\" data-orig-file=\"https:\/\/i0.wp.com\/ekhart.pl\/wp-content\/uploads\/2018\/04\/RollerBrain-yaml.png?fit=168%2C147&amp;ssl=1\" data-orig-size=\"168,147\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"RollerBrain yaml\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/ekhart.pl\/wp-content\/uploads\/2018\/04\/RollerBrain-yaml.png?fit=168%2C147&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/ekhart.pl\/wp-content\/uploads\/2018\/04\/RollerBrain-yaml.png?fit=168%2C147&amp;ssl=1\" class=\"alignnone size-full wp-image-1103\" src=\"https:\/\/i0.wp.com\/ekhart.pl\/wp-content\/uploads\/2018\/04\/RollerBrain-yaml.png?resize=168%2C147&#038;ssl=1\" alt=\"RollerBrain yaml\" width=\"168\" height=\"147\" data-recalc-dims=\"1\" \/><\/p>\n<p>Here, you can get working <a href=\"https:\/\/ekhart.pl\/wp-content\/uploads\/2018\/04\/trainer_config.zip\">trainer_config.yaml<\/a> file.<\/p>\n<p>And\u00a0voil\u00e0, as you can see in the video, the agent works perfectly.<\/p>\n<p>Now, it&#8217;s time to understand more deeply how is this all working! ;p<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve created a new learning environment. The tutorial is great, but for me, most interesting part was to train the agent myself.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[58],"tags":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8oxcO-hL","jetpack-related-posts":[],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/ekhart.pl\/index.php\/wp-json\/wp\/v2\/posts\/1101"}],"collection":[{"href":"https:\/\/ekhart.pl\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ekhart.pl\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ekhart.pl\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ekhart.pl\/index.php\/wp-json\/wp\/v2\/comments?post=1101"}],"version-history":[{"count":5,"href":"https:\/\/ekhart.pl\/index.php\/wp-json\/wp\/v2\/posts\/1101\/revisions"}],"predecessor-version":[{"id":1109,"href":"https:\/\/ekhart.pl\/index.php\/wp-json\/wp\/v2\/posts\/1101\/revisions\/1109"}],"wp:attachment":[{"href":"https:\/\/ekhart.pl\/index.php\/wp-json\/wp\/v2\/media?parent=1101"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ekhart.pl\/index.php\/wp-json\/wp\/v2\/categories?post=1101"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ekhart.pl\/index.php\/wp-json\/wp\/v2\/tags?post=1101"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}