Course 4- Week 2-Assignment 2

base_model.trainable = False

# create the input layer (Same as the imageNetv2 input size)
inputs = tf.keras.Input(shape=input_shape) 

# apply data augmentation to the inputs
x = data_augmentation(inputs)

# data preprocessing using the same weights the model was trained on
x = preprocess_input(inputs) 

# set training to False to avoid keeping track of statistics in the batch norm layer
x = base_model(x, training=False) 

# add the new Binary classification layers

# use global avg pooling to summarize the info in each channel
x = tf.keras.layers.GlobalAvgPool2D()(x) 
# include dropout with probability of 0.2 to avoid overfitting
x = tf.keras.layers.Dropout(0.2)(x)
    
# use a prediction layer with one neuron (as a binary classifier only needs one)
prediction_layer = tf.keras.layers.Dense(1)
outputs=prediction_layer(x)

### END CODE HE

model = tf.keras.Model(inputs, outputs)

return model

pls help to write binary classification layers

Please do not post your code on the Forum. The course Honor Code does not allow it.

You can post your question, and copies of any error messages or assert logs.