<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: T Suzuki</title>
    <description>The latest articles on DEV Community by T Suzuki (@tsuz).</description>
    <link>https://dev.to/tsuz</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F210331%2Fd6c840b6-d745-4795-9403-c694fd711859.jpeg</url>
      <title>DEV Community: T Suzuki</title>
      <link>https://dev.to/tsuz</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tsuz"/>
    <language>en</language>
    <item>
      <title>Run Unity ml-agents Examples on Mac</title>
      <dc:creator>T Suzuki</dc:creator>
      <pubDate>Sun, 20 Jun 2021 12:24:08 +0000</pubDate>
      <link>https://dev.to/tsuz/run-unity-ml-agents-examples-on-mac-52p6</link>
      <guid>https://dev.to/tsuz/run-unity-ml-agents-examples-on-mac-52p6</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--KE-_3Afx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ed9i7s67kihmil6w7f2i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--KE-_3Afx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ed9i7s67kihmil6w7f2i.png" alt="Screen Shot 2021-06-20 at 21.15.33"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After watching several videos about how reinforcement learning can be demonstrated using Unity's 3D simulated physics, I tried to set up Unity for the first time. After hours of researching and debugging, I finally was able to compile the code to start learning RL. Since this didn't work out of the box and there was no document that summarized the steps and how to debug etc to make this work (some were partial), I am sharing how you can fix these issues.&lt;/p&gt;

&lt;p&gt;Firstly, I followed the steps in &lt;a href="https://www.immersivelimit.com/tutorials/unity-ml-agents-setup"&gt;this tutorial&lt;/a&gt; to download/install Unity and clone the repository from &lt;code&gt;ml-agents&lt;/code&gt;: &lt;br&gt;
At this time, you should have copied &lt;code&gt;ml-agents/Project/Assets/ML-Agents&lt;/code&gt; folder under &lt;code&gt;$PROJ_DIR/Assets&lt;/code&gt; folder. &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--g0OxCYaA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n10lz0nxgh3dv238ame8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--g0OxCYaA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n10lz0nxgh3dv238ame8.png" alt="Screen Shot 2021-06-20 at 20.40.41"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When you press play at the top, it should succeed but in my case, I faced some compile error such as below:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;The type or namespace name 'Input' does not exist in the namespace 'Unity.MLAgents.Extensions'&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;This means, the extensions are provided from &lt;code&gt;Unity-Technologies/ml-agents&lt;/code&gt; repository but this was not copied to the project. So let's copy by going to &lt;code&gt;Window&lt;/code&gt; -&amp;gt; &lt;code&gt;Package Manager&lt;/code&gt; -&amp;gt; &lt;code&gt;plus icon&lt;/code&gt; -&amp;gt; &lt;code&gt;Add package from disk&lt;/code&gt; -&amp;gt; Select &lt;code&gt;ml-agents/com.unity.ml-agents.extensions/package.json&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--hab3JEuM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0yhcjovj414lavlfumsx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hab3JEuM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0yhcjovj414lavlfumsx.png" alt="Screen Shot 2021-06-20 at 20.52.08"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4wbUaMd2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8py4fx0938ax6njl1fwx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4wbUaMd2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8py4fx0938ax6njl1fwx.png" alt="Screen Shot 2021-06-20 at 20.52.21"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If this still gives you error, load &lt;code&gt;ml-agents/com.unity.ml-agents/package.json&lt;/code&gt; and select the correct version according to the &lt;a href="https://github.com/Unity-Technologies/ml-agents/releases/tag/release_18"&gt;release notes&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---LpnFcy6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m7ieno7pwbifi5uhkwr0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---LpnFcy6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m7ieno7pwbifi5uhkwr0.png" alt="Screen Shot 2021-06-20 at 20.55.31"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then I get an error that &lt;code&gt;IInputActionAssetProvider&lt;/code&gt; was not read by the compiler, so once I &lt;a href="https://github.com/Unity-Technologies/ml-agents/blob/d34f3cd6ee078782b22341e4ceb958359069ab60/com.unity.ml-agents.extensions/Runtime/Input/IInputActionAssetProvider.cs#L1"&gt;searched for the code&lt;/a&gt; and it looks like there is a macro flag &lt;code&gt;MLA_INPUT_SYSTEM&lt;/code&gt; which enables this to be read. This is only available using the Input System of 1.1.0-preview.3 according to &lt;a href="https://github.com/Unity-Technologies/ml-agents/blob/d34f3cd6ee078782b22341e4ceb958359069ab60/com.unity.ml-agents.extensions/Runtime/Input/Unity.ML-Agents.Extensions.Input.asmdef#L18-L19"&gt;this code&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;So, I updated Input System's version to &lt;code&gt;1.1.0-preview.3&lt;/code&gt; in the Package Manager. You cannot preview this version unless you enabled preview in the steps above.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--v9-kq2us--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p10rfs8qgeb9jn1jfu84.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--v9-kq2us--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p10rfs8qgeb9jn1jfu84.png" alt="Screen Shot 2021-06-20 at 21.01.58"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Lastly, I came across this error:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;You are trying to read Input using the UnityEngine.Input class, but you have switched active Input handling to Input System package in Player Settings.&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;This error occurs because there is a new and old way of handling input system packages. (why is that? I don't know) In my case, this was pointing to a new version whereas it should have been pointing to the old version. So I updated that by going into &lt;code&gt;Edit&lt;/code&gt; -&amp;gt; &lt;code&gt;Project Settings&lt;/code&gt; -&amp;gt; &lt;code&gt;Player&lt;/code&gt; -&amp;gt; &lt;code&gt;Other Settings&lt;/code&gt; -&amp;gt; &lt;code&gt;Configuration&lt;/code&gt; -&amp;gt; &lt;code&gt;Active Input Handling&lt;/code&gt; -&amp;gt; Select &lt;code&gt;Input Manager (Old)&lt;/code&gt; instead of &lt;code&gt;Input Manager (New)&lt;/code&gt;. This asks you if you want to restart and so you restart it. The &lt;code&gt;Both&lt;/code&gt; setting doesn't get applied upon restart so you want to verify the setting after you restart Unity. If someone can tell me why that is, I'd be appreciated.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--oy2-Oe3s--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zakbc6qjrcju75e7czt1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--oy2-Oe3s--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zakbc6qjrcju75e7czt1.png" alt="Screen Shot 2021-06-20 at 21.05.33"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This finally compiled and worked!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--goi7pEgm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y5y8yvqxkl0m84ykwo4r.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--goi7pEgm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y5y8yvqxkl0m84ykwo4r.gif" alt="ezgif.com-gif-maker (2)"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is my final Environment State:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;ml-agents branch: &lt;code&gt;release_18&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Unity ML Agent version: &lt;code&gt;2.1.0-exp1&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Unity ML Agent Extension version: &lt;code&gt;0.5.0-preview&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Unity Input System version: &lt;code&gt;1.1.0-preview.3&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Active Input Handling: Input Manager (Old)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Happy learning!&lt;/p&gt;

</description>
      <category>unity3d</category>
      <category>machinelearning</category>
    </item>
    <item>
      <title>5 Minute AI Model Deployment on DIY Platforms</title>
      <dc:creator>T Suzuki</dc:creator>
      <pubDate>Tue, 20 Aug 2019 00:04:54 +0000</pubDate>
      <link>https://dev.to/tsuz/5-minute-ai-model-deployment-on-diy-platforms-5egb</link>
      <guid>https://dev.to/tsuz/5-minute-ai-model-deployment-on-diy-platforms-5egb</guid>
      <description>&lt;h3&gt;Background&lt;/h3&gt;

&lt;p&gt;While deploying AI models has often proven to be a reasonable&lt;br&gt;
challenge, DIY platforms are changing the rules of the game with&lt;br&gt;
deployment made both easy and swift, even for the relatively&lt;br&gt;
inexperienced.&lt;br&gt;
For most developers, AI model development seems like a nice touch, but the real challenge begins when they need to create and deploy the models.&lt;/p&gt;

&lt;ul&gt;The pain points faced along the way include:

&lt;li&gt;Understanding feature engineering&lt;/li&gt;
&lt;li&gt;Understanding the mathematics behind machine learning models and choosing the correct models&lt;/li&gt;
&lt;li&gt;Designing an interface to access predictive features of AI models&lt;/li&gt;
&lt;li&gt;Implementing an infrastructure to serve the AI models on a cloud or self hosted platform&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As you can see above, these skills require a team of engineers and DevOps which large corporations can afford to hire.&lt;br&gt;
By democratizing AI building, SuperAI creates an enormous value where anyone with meaningful data is able to generate a model and start integrating it back into their application.&lt;/p&gt;

&lt;h3&gt;How it’s done&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Access &lt;a href="https://www.superai.io/?marid=NeG2Cv"&gt;SuperAI&lt;/a&gt;, an AI platform that simplifies model building and deployment.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Signup and create a project. I selected a use case, "Document Classifier". Document classification is to predict the categories from sentences.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--KJGCrYl7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/hpyv4653qh60gom2u9bh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--KJGCrYl7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/hpyv4653qh60gom2u9bh.png"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;While following the instructions on data preparation, I drag-and-dropped the file to upload. It seems to not work if I don't follow the instructions as it is..&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rs6_46vk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/q80w7064urwg19q1ox9c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rs6_46vk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/q80w7064urwg19q1ox9c.png"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;There were some warnings on the data; the platform asks me to choose the target column. The target column is what we want to predict the outcome of. In this case, I want to predict the sentiment so, I chose "sentiment" as the target column and the warning is gone.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--zttV9QU_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/qk8gda5qm9ljj6hxcn0r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zttV9QU_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/qk8gda5qm9ljj6hxcn0r.png"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Now I click the "Train" tab and I can train a model. I've selected 5 minutes as training time but this can be shorter or longer depending on the data size and complexity.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--j1iF8To1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/w743982s8e9ccqvaldfy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--j1iF8To1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/w743982s8e9ccqvaldfy.png"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;After 5 minutes, I was able to get a model here at 94.75% accuracy. That seems good enough for my application.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--46TsqVj9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/rhglty11hnu2lqohh4zz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--46TsqVj9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/rhglty11hnu2lqohh4zz.png"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Now, I want to deploy this model so I click "Stage" with "Deploy" checked&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5Wx_dN2C--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/jeo88rke894t8drhyo06.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5Wx_dN2C--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/jeo88rke894t8drhyo06.png"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;After some time, it seems deployed&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--LtJ8Mxf---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/7mxvx5adstzimux2jii9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--LtJ8Mxf---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/7mxvx5adstzimux2jii9.png"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Now I go to "Predict" tab and test that it's working. I entered a sentence to predict then I was able to get the categorized outcomes with their confidence level.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--NBcH3cZ---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/ew1a961shwmo5m8itcys.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--NBcH3cZ---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/ew1a961shwmo5m8itcys.png"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Then I generated the API key and tested in Terminal to verify the results&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---iZVgUaH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/t3dgou9r2ju2pcu44jw8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---iZVgUaH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/t3dgou9r2ju2pcu44jw8.png"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Great! Now I can integrate this back into my application&lt;br&gt;
It seems like the tip is to understand your data and format it in a way that they accept it. If the data does not make sense, you would expect a model with bad accuracy. If the data is not formatted correctly, it does not seem to parse well.&lt;/p&gt;

&lt;h3&gt;Conclusion&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://www.superai.io/?marid=NeG2Cv"&gt;DIY AI platforms&lt;/a&gt; are changing the rules of the game as far as outputting an AI model relatively good and very quickly.&lt;br&gt;
As long as you understand your data, the rest of the pipeline is quite straightforward. I hope this DIY AI platform improves so that it can handle more use cases and wider range of data formats.&lt;/p&gt;

&lt;p&gt;Thanks for reading,&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
