Search Unity

Question Running Regression on Barracuda

Discussion in 'Barracuda' started by cquinteros, Jun 5, 2021.

  1. cquinteros

    cquinteros

    Joined:
    Jun 5, 2021
    Posts:
    1
    Hello,

    **Update**

    We are running a tensorflow regression model in barracuda. We have converted the model into a frozen_graph and then to a ONNX - we have gotten some predictions and have realized that they are not scaled. We are using joblib to pickle our scalers - is there a way to bring them into barracuda?
     
    Last edited: Jun 5, 2021
  2. fguinier

    fguinier

    Unity Technologies

    Joined:
    Sep 14, 2015
    Posts:
    146
    Hi cquinteros,
    > we have gotten some predictions and have realized that they are not scaled.
    Could you explain that part please?

    Are you looking into running inference outside of Barracuda and compare that to Barracuda result? If so we do that quite heavily using Json as an intermediate format, if so let me know i will send you some pointer or code pieces to do so.
     
  3. alexandreribard_unity

    alexandreribard_unity

    Unity Technologies

    Joined:
    Sep 18, 2019
    Posts:
    53
    @cquinteros could you share your onnx model?
    We'll happily look into it!
     
  4. jtmedley21

    jtmedley21

    Joined:
    Aug 30, 2015
    Posts:
    2
    Hi, I am relatively new to Unity and am also attempting to do regression type analysis/prediction with Barracuda. I have been able to follow Classification tutorials that involved converting my tensorflow model to ONNX, then uploading that to Unity and writing a "Classify" method within the C# script. Basically it can recognize a dog and a cat. However, what I am really needing to do is more related to regression. If there are any tutorials or example code you could point me to I would be incredibly grateful for your help. By the way this is purely for educational purposes and I am not making any $$$. Thanks very much for your consideration.
     
  5. fguinier

    fguinier

    Unity Technologies

    Joined:
    Sep 14, 2015
    Posts:
    146
  6. jtmedley21

    jtmedley21

    Joined:
    Aug 30, 2015
    Posts:
    2
    Hi fguinier, thanks for the reply. I am not necessarily new to ML, but definitely so in the Unity / Barracuda environment. I have experience programming basic perceptrons and MLPs from scratch and beyond that I have mostly used Tensorflow in Google CoLab and similar higher level tools like WEKA and DeepLearning4j. I will definitely take a look at that course, but just from a quick glance at the material, I am at least familiar with the concepts. (No doubt I could use a refresher!) Is there any more 'Unity specific' type tutorial or course you could recommend? Thanks again for the quick reply!​
     
  7. fguinier

    fguinier

    Unity Technologies

    Joined:
    Sep 14, 2015
    Posts:
    146