Neural Network predicting Fourier Coef for Segmentation - Help for french beginner

Hi everybody,

I’m trying to develop a neural network in charge of predicting Fourier’s coefficients of a mask from an image. Then I use this coefficients to reconstruct a mask by convulving a gaussian over predicted points.

My implementation of these functions looks like :

My neural network is created using this function :

Capture_nn

All these functions seems to work correctly

Next, I train my model using this function :

and these parameters :

But the problem is, it doesn’t work :cry:
The loss doesn’t decrease, and I didn’t find what.
I’ve tried with different epoch, batch, LR and nothing solves the problem

Can someone have an idea ?

Thank you for all,
A beginner with love

I cannot read the code on my phone since you’ve posted it via screenshots instead of formatted code snippets.
In any case, you could try to overfit a small dataset (e.g. just 10 samples) first to make sure your model architecture is capable of doing so and no other errors are in your training code.

Hi ptrblck,

thanks for your answer and sorry for format’s images I’ve posted.
I’ve already tried to overfit it, and it doesn’t work.
So I tried with different implementation and formula … and it works ! I think problem in the code I posted was in relation with the device, which was not the same for all variables I used