# TFL Dev Prof C2-W3, not reaching 99.9 % even after 15 epochs

**URL:** <https://community.deeplearning.ai/t/tfl-dev-prof-c2-w3-not-reaching-99-9-even-after-15-epochs/259016>\
**Category:** Convolutional Neural Networks in TensorFlow\
**Tags:** week-module-3\
**Created:** [January 18, 2023, 12:12pm UTC](https://community.deeplearning.ai/t/tfl-dev-prof-c2-w3-not-reaching-99-9-even-after-15-epochs/259016 "2023-01-18T12:12:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ydsk1234](https://avatars.discourse-cdn.com/v4/letter/y/e8c25b/32.png) [@ydsk1234](https://community.deeplearning.ai/u/ydsk1234)\
**Post date:** [January 18, 2023, 12:12pm UTC](https://community.deeplearning.ai/t/tfl-dev-prof-c2-w3-not-reaching-99-9-even-after-15-epochs/259016/1 "2023-01-18T12:12:19Z")

</div>

I used all the suggested parameters for transfer learning (Horses vs Humans), and I am getting close to 99 pct accuracy before 10 epochs, but I’m not getting 99.9 pct accuracy even after 15 epochs.

I don’t know what could be wrong - as I seem to have all the right parameters.

Here’s the heart of my train\_val\_generators method:

# –

train\_datagen \<= ImageDataGenerator(rescale\<=1./255,  
rotation\_range\<=45,  
width\_shift\_range\<=0.3,  
height\_shift\_range\<=0.3,  
shear\_range\<=0.3,  
zoom\_range\<=0.3,  
horizontal\_flip\<=True,  
fill\_mode\<=‘nearest’)

Here is what my create\_final\_model method looks like:

### ----

x \<= tf.keras.layers.Dense(units=1024, activation=‘relu’)(x)  
x \<= tf.keras.layers.Dropout(0.2)(x)  
x \<= tf.keras.layers.Dense(1, activation=‘sigmoid’)(x)

model \<= Model(inputs=pre\_trained\_model.input, outputs=x) # didn’t understand the input/output

model.compile(optimizer \<= RMSprop(learning\_rate=0.0001),  
loss \<= ‘binary\_crossentropy’,  
metrics \<= [‘accuracy’])

### ----

Pls give me a clue …

---

<div class="post-metadata">

**Author:** ![balaji.ambresh](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/balaji.ambresh/32/128697_2.png) [@balaji.ambresh](https://community.deeplearning.ai/u/balaji.ambresh)\
**Post date:** [January 18, 2023, 12:55pm UTC](https://community.deeplearning.ai/t/tfl-dev-prof-c2-w3-not-reaching-99-9-even-after-15-epochs/259016/2 "2023-01-18T12:55:37Z")

</div>

Learning rate looks too small. Please take up deep learning specialization to understand the details of experimenting model architectures.  
See this [post](https://community.deeplearning.ai/t/validation-and-training-accuracy-just-cant-reach-80/192735/3) as well.

---

<div class="post-metadata">

**Author:** ![ydsk1234](https://avatars.discourse-cdn.com/v4/letter/y/e8c25b/32.png) [@ydsk1234](https://community.deeplearning.ai/u/ydsk1234)\
**Post date:** [January 18, 2023, 1:30pm UTC](https://community.deeplearning.ai/t/tfl-dev-prof-c2-w3-not-reaching-99-9-even-after-15-epochs/259016/3 "2023-01-18T13:30:27Z")

</div>

The learning\_rate is already hard-coded for us in the notebook, so it’s not one of the parameters that can be changed. I know if we tweak a few parameters (like adding more neurons in the Dense layers or adding more hidden layers ) I can bump up my accuracy but for the given notebook those parameters are fixed (shouldn’t be changed). That’s the weird part of this notebook.

Only the places marked as **None** can be replaced/edited. That’s the reason I wasn’t able to tweak the params.

---

<div class="post-metadata">

**Author:** ![balaji.ambresh](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/balaji.ambresh/32/128697_2.png) [@balaji.ambresh](https://community.deeplearning.ai/u/balaji.ambresh)\
**Post date:** [January 18, 2023, 5:42pm UTC](https://community.deeplearning.ai/t/tfl-dev-prof-c2-w3-not-reaching-99-9-even-after-15-epochs/259016/4 "2023-01-18T17:42:28Z")

</div>

You can change the learning rate and even the optimizer. As long as you pass the 99.9% accuracy within 10 epochs, you’re good to go.
