Blocked with the alpaca_model


I’m quite lost with the alpaca model. I guess I’m not understanding the Functional API or maybe my Python level is not good enough.
I understand what I want to do but I’m totally lost with the syntax.
For instance, data augmentation: How am I supposed to proceed?

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

Will this apply the data_augmentation to input of the model?
Then the x in the pre-code…

x = preprocess_input(None) 

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

# add the new Binary classification layers
# use global avg pooling to summarize the info in each channel
x = None()(x) 
# include dropout with probability of 0.2 to avoid overfitting
x = None(None)(x)

Are this x to be changed by something else by me or is it a real variable x to be later processed?

Is there open hours to support with questions like this one?


That line of code should be “x = data_augmentation(inputs)”.

In general, your job is to replace the “None” statements with code that implements the correct layer.

So “x = preprocess_input(None)” should replace “None” with “x”. This line of code modifies the ‘x’ data in-place by passing it through the preprocess_input() layer.

The discussion forum is open all the time, but when a mentor is available depends on where the mentors live and what hours they are available.

The mentors are all volunteers from the community, so we don’t have regular hours.

1 Like

Ok, thank you. I managed to finish the assignment but mainly thanks to the guidelines. I feel very unsecure in general with TensorFlow code. I will have to go deeper on it at some point.