Search Unity

Extend vector math

Discussion in 'Editor & General Support' started by ZeHgS, Aug 21, 2018.

  1. ZeHgS

    ZeHgS

    Joined:
    Jun 20, 2015
    Posts:
    117
    Hi guys!

    I am terrible at both programming and math, so I apologize if I'm asking a stupid question.

    I have been studying Machine Learning and I now know how to create very simple neural networks in Matlab. However, I would like to create more advanced applications with visual interfaces and other features. I know how to do this in C# using Unity, but I have no idea whether it is even possible to do it in Matlab, since I'm a complete beginner. For this reason, I would like to stick with what I know and use Unity.

    However, Matlab is highly optimized for Vector math. I think I probably could create most of the basic stuff myself like dot products and element wise multiplication for matrices of the sizes I need but I have heard time and time again how Matlab is super optimized for this and I am afraid if I program this stuff myself it would be unbearably slow.

    So, my questions are:

    1) Does Unity have Matlab like vector math programmed already? Or only for 2, 3 and 4 dimensional vectors?
    2) Are there any free libraries available in the asset store or elsewhere that do this?
    3) Would it be OK to program most of this stuff myself or does it need to be really optimized to come close to Matlab's processing time?

    Thanks a lot!
     
  2. MD_Reptile

    MD_Reptile

    Joined:
    Jan 19, 2012
    Posts:
    2,664
  3. ZeHgS

    ZeHgS

    Joined:
    Jun 20, 2015
    Posts:
    117
    Thanks a lot for the reply Reptile! Ideally, I would prefer an alternative solution that didn't require me to keep Matlab open since I'm gonna be working on pretty simple projects at first, but it's great to know that this is possible, especially for larger, more complex projects I might attempt in the future. Does anyone know the answer to the other questions, however?
     
  4. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
  5. MD_Reptile

    MD_Reptile

    Joined:
    Jan 19, 2012
    Posts:
    2,664
    Umm, @JeffDUnity3D - that's the machine learning section, which isn't related to what he is asking for, I don't think. Was that just a case of reading too fast and seeing M and L in the question? :p
     
  6. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    @MD_Reptile I'm not clear how your post adds value to the thread, which appears to be what you are concerned about? (infinite loop starts...) :) You may be right, but at least I try! ML-Agents allows you to reference TensorFlowSharp and Python scripting which have good support for vector math.
     
  7. MD_Reptile

    MD_Reptile

    Joined:
    Jan 19, 2012
    Posts:
    2,664
    Oh my. I didn't mean to call you out, just stating that it wasn't the same subject :p

    Hope I haven't offended you good sir.