I’d try with 2 hidden layers of 64 nodes each first. That should fit in with just a base64 encoding so you can concentrate on training + forward pass.
If you find it’s too small of a network you can try larger.
To answer your question you can also try base85 or for further gains try (ab)using unicode. Codingame counts characters, not bytes.
1 Like
jacek1
July 8, 2023, 9:29am
#70
Assuming c++ code locally and in codingame, unicode characters for codingame · GitHub
This approach should be translatable to python easily I believe.
If I’m counting right, your current net has 124405. With one less hidden layer that would be 84205. That would leave ~16000 characters for other code.
1 Like
the unicode method is genius!
I will try to train a smaller network first and then try the unicode idea later.
Thanks for both of your help!
After a long time I am back in coding game.
I found this:
(D-600/20000) : sqrt((nextCPx - x)²+(nextCPy – y)²)-600/20000
angleScalD : ?
angleCrossD : ?
vScalD/1000 : ((nextCPx-x)*vx+(nextCPy-y)*vy)/(SQRT((nextCPx-x)²+(nextCPy-y)²))/1000
vCrossD/1000 : SIN(ACOS(((nextCPx-x)vx+(nextCPy-y)vy)/((SQRT((nextCPx-x)²+(nextCPy-y)²)) (SQRT(vx²+vy²)))))) (SQRT(vx²+vy²))/1000
nextDirScalD : (((nextCPx-x)(nextnextCPx-nextCPx)+(nextCPy-y) (nextnextCPy-nextCPy))/((SQRT((nextCPx-x)²+(nextCPy-y)²))*(SQRT((nextnextCPx-nextCPx)²+(nextnextCPy-nextCPy)²))))
nextDirCrossD : SIN(ACOS((((nextCPx-x)(nextnextCPx-nextCPx)+(nextCPy-y) (nextnextCPy-nextCPy))/((SQRT((nextCPx-x)²+(nextCPy-y)²))*(SQRT((nextnextCPx-nextCPx)²+(nextnextCPy-nextCPy)²))))))
(distanceCP1CP2-1200)/10000 : (SQRT((nextnextCPx-nextCPx)²+(nextnextCPy-nextCPy)²)-1200)/10000
Someone know how to calculate angleScalD and angleCrossD ?
double angleScalD = dot(vec2ByAngle(angle), vec2(1.0,0.0));
double angleCrossD = cross(vec2ByAngle(angle), vec2(1.0,0.0));
How to have angleNextDir??
double angleScalD = dot(vec2ByAngle(angle), vec2(1.0,0.0));
double angleCrossD = cross(vec2ByAngle(angle), vec2(1.0,0.0));
int vScalD = (int)(normVdot(vec2ByAngle(angleV), vec2(1.0,0.0)));
int vCrossD = (int)(normV cross(vec2ByAngle(angleV), vec2(1.0,0.0)));
double nextDirScalD = dot(vec2ByAngle(angleNextDir), vec2(1.0, 0.0));
double nextDirCrossD = cross(vec2ByAngle(angleNextDir), vec2(1.0, 0.0));
I have now a working NN and know how to translate the input into the NN
But I didnt find how to translate the output of NN into the game , the second term is the thrust but I dont know how to convert the first term into the destination of the pod.
Any ideas ?
jacek1
November 12, 2023, 7:32pm
#75
In expert mode you can provide angle (-18,18) and thrust. When you provide destination the referee just translates it into angles internally.
5DN1L
November 12, 2023, 8:50pm
#76
I think Pedro1994 is talking about Mad Pod Racing.
Dr_Meyss:
int x = checkpoint[_p1.check_point].x - 3*_p1.speed.x;
int y = checkpoint[_p1.check_point].y - 3*_p1.speed.y;
or
float anglef = _p1.angletot;
float angleRad = anglef * PI / 180.f;
Vector2 dird = {cos(angleRad)*10000 , sin(angleRad)*10000};
cout << dird.x << " " dird.y << " " << thrust << endl;
You train your NN on all the track ? or on a random checkpoint ? Mine run on all the track , but I don’t know how to converge the NN for all the tracks ?
PLease can you help me ? Sorry to bother you !!!
Did you train your NN on all the tracks, or in a random checkpoints?
i use PPO and train on all the tracks , but my NN converge only if train on only one track? How to learn multiple track ?
Thanks !!!
fenrir1
October 28, 2024, 8:14pm
#82
Hi,
I create a batch of matches, where each match use a different race (generated like done by the referee). Of course, in the input of the NN I gave it the checkpoints positions.
Regards,