Solved by KFrank in post #2 
              
              
                Hi Raouf! 
I don’t follow in detail what you are doing, but be aware that 
the output of a model with a final sigmoid() layer will, of 
course, be different than the output of the analogous model 
that lacks that layer. 
With the sigmoid() layer your model returns probabilities. 
Without the sigmoid…