Offboard mode neural network

I need your advice regarding offboard mode.

So I am planing to replace the pid angular rate controller with an AI neural network controller. I got some advice that I can go with ROS2 and offboard mode.

I read the px4 controller architecture and I found that the inner loop attitude controller receive the angular velocity and send the pitch roll yaw torques to the mixer ( I hope this is right wat I understand )

When I started the offboard mode, I set the offboard control message to be true for thrust/torque and all the others like position velocity, etc, are False

Now the question is , if I send the torque thrust command , does that mean all the other fields like position controller , velocity controller and the outer attitude loop controller will be controlled by px4 firmware or I should create algorithm to control them .

Also any other suggestion to replace the pid in the angular rate controller with neural network other than offboard mode ?