0

I'm trying to build a model to detect multiple attributes in an image.

I'm using the pre-trained inception V3 model. I understand that we have to change the final softmax layer to sigmoid.

I'm loading the model as follows:

with slim.arg_scope(inception.inception_v3_arg_scope()):
                logits, _ = inception.inception_v3(images, num_classes=numClass, is_training=True)

Now how do I change the softmax layer to sigmoid?

gibbidi
  • 183
  • 1
  • 8

1 Answers1

1

If you check the source code for inception_v3, you will see the full arguments available:

def inception_v3(inputs,
                 num_classes=1000,
                 is_training=True,
                 dropout_keep_prob=0.8,
                 min_depth=16,
                 depth_multiplier=1.0,
                 prediction_fn=slim.softmax,
                 spatial_squeeze=True,
                 reuse=None,
                 scope='InceptionV3'):

simply change to prediction_fn=tf.sigmoid

kwotsin
  • 2,882
  • 9
  • 35
  • 62