Skip to content

Keras softmax does not align with tensorflow (python) #985

Description

@SanftMonster

The Model is quite simple:

var model = keras.Sequential(new List<Tensorflow.Keras.ILayer>()
{
    keras.layers.InputLayer(128),
    keras.layers.Dense(64),
    keras.layers.Dense(6),
    //keras.layers.Softmax(-1)
});

When using Softmax, it does not converge, while it converge well after removing it.

In tensorflow (python), the it's just the opposite. The model converge with softmax but does not without softmax.

Both in csharp and python I used sparse_categorical_crossentropy loss and Adam optimizer.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions