Is it possible to rewrite the algorithm of MLAgents?

We want to create an agent that can play against humans and become stronger.

However, it is not possible to achieve this with the methods currently available in MLAgent.

We are thinking of two ways to achieve this. I would appreciate your opinion on which is better.

  1. Create a machine learning algorithm by myself using C#Script
    The MLAgents algorithm looks like it uses python.
    However, it seems to be difficult to use python in Unity, so my idea is to create it by myself in C#Script.

  2. Rewrite the MLAgents code
    I’m thinking of rewriting or adding the MLAgents code.
    I am not sure if this is possible, so I would like to know.

How about the above two ideas?
I would be grateful for your opinion.

Translated with www.DeepL.com/Translator (free version)

I fail to see the difference between the two options. In any case it seems you want to write a learning algorithm in C#. If that is what you want to do, I can only recommend to use the resources available to you. You could create a ONNX model that has the back propagation operators inside the network. This is a potential solution for simple algorithms like Q-Learning and can be used with Barracuda. For more complex algorithms, I would recommend using a neural network library in C#, but I have not found one that can be easily integrated with ML-Agents yet.