Whoops- been busy with work and ignoring halite , so missed all this.
Lets suppose you have m ships and there are n total objects (your ships, enemy ships, slots etc). let's also suppose that every ship and object has attributes x,y g and w (where g is the kernel width, and w is the weight, which is +1 for your ships and -1 otherwise.
The +1 creates a hill, and the -1 creates a valley.
then you are doing just m*n pairwise distance calculations and exponents, something like
grad_x = 0;grad_y= 0;
for s in my_ships
for o in all_objects
d = (s.x - o.x)**2 + (s.y-o.y)**2
f = o.w * math.exp(-o.g * d)
grad_x += o.w * o.g * f * (s.x - o.x)
grad_y += o.w * o.g * f * (s.y - o.y)
For each iteration of the outer loop, grad_x, grad_y are the x,y components of your direction from s (note, the length of grad_x,grady could be large- this is ok, you just want the direction). i wrote this on my phone so check the syntax but the math is good.
kind regards and hope you are enjoying explorations into machine learning !