Thanks a lot for the answer.
I tried your solution but the network behaves exactly like in my second code.
Actually, the network in the second code contains the activation functions, I checked that the architecture was correct also through tensorboard.
The learning rate is 3e-4 but in all cases, the program is identical for both models I have defined, so there are no other elements outside the network that influence the training.
I don’t know, maybe using 2 Sequential blocks in parallel like in the second code can cause problems with backpropagation (I’m just assuming)