Custom nn with MLAgents

Hi,
I am working on a project and I need to define a custom model of the net, in particular I need to set a conv1d configuration for the inputs. I didn’t find so much on this thread, so I have been posting here hoping you could help me, is it possible to do that? How?. Thanks in advance.
Andrea

One thing you can try is configuring the actual ml-agents code, and basically add the convolutions you want. I did this once by adding an extra layer and customized some parameters and it worked well!

The only limitation is that the barracuda library (which converts the tensorflow model to unity for inference) doesn’t allow all tensorflow operations. I did Conv3D once, successfully trained it, yet wasn’t able to run at inference.

1 Like

ml-agents is a big grown framework by now and is pretty difficult to get into.
You have to look into these files to modify the neural net. As MarkTension stated, you may run into barracuda issues. And to make this straight, ml-agents is not based on TF anymore. It’s done with PyTorch now.

2 Likes

First I want to thank you for your replies. I am actually trying to set my custom nn using Python API, following the information found in this post Q-Learning implementation and I think I’m at a good point. I have read about the limitation of barracuda, but I think that is not a big problem, I can still evaluate the model in other ways (hopefully).
One last question considering that you added the Conv3D, in which part of the code you added it?