# How to use custom model in Learning Agents?

**URL:** <https://forums.unrealengine.com/t/how-to-use-custom-model-in-learning-agents/1947225>\
**Category:** AI\
**Tags:** Reinforcement-Learning, unreal-engine, Machine-Learning, Learning-Agents, question\
**Created:** [July 23, 2024, 1:18pm UTC](https://forums.unrealengine.com/t/how-to-use-custom-model-in-learning-agents/1947225 "2024-07-23T13:18:46Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![Deathcalibur](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/deathcalibur/32/1037610_2.png) [@Deathcalibur](https://forums.unrealengine.com/u/Deathcalibur)\
**Post date:** [November 18, 2024, 3:40pm UTC](https://forums.unrealengine.com/t/how-to-use-custom-model-in-learning-agents/1947225/8 "2024-11-18T15:40:20Z")

</div>

I forgot I did a write-up over here with how to use ONNX if you want. The code I provided should be thought of as pseudo-code. I wrote it up in a notepad and did not try to compile it. The idea is you make a sub-class of Policy and add some bits which let LA work with NNE & ONNX:

> [@Background neural networks for leaning agents neural network data assets](https://forums.unrealengine.com/t/background-neural-networks-for-leaning-agents-neural-network-data-assets/2080575/2):
>
> I don’t have an easy to share example that isn’t all mixed up with some proprietary code, but I will give you a quick gist of what to do: // Header #pragma once #include "Containers/Array.h" #include "LearningAgentsActions.h" #include "LearningAgentsObservations.h" #include "LearningAgentsPolicy.h" #include "LearningArray.h" #include "Templates/SharedPointer.h" #include "NNE.h" #include "NNERuntimeCPU.h" #include "NNEModelData.h" UCLASS(BlueprintType, Blueprintable) class FNLEARNINGAGENTSRU…

We haven’t made this part of the LA “official” yet because it has a lot of rough edges that need to be fixed up before it will be “good” for our definition of good. Eventually it will probably come… but for now you need to do a little C++ dev in your game project.

Thanks,  
Brendan

---

_[View the full topic](https://forums.unrealengine.com/t/how-to-use-custom-model-in-learning-agents/1947225)._
