Giter Site home page Giter Site logo

Comments (1)

suvoooo avatar suvoooo commented on July 24, 2024 1

Hello, thanks for checking this out.

First, regarding earlystop, I defined it as a function so if you want to include earlystop in callbacks, you need to specify the 'mode' e.g earlystop('acc'). Below I shared a working version of the notebook that I just tried but I would still like to highlight some points regarding training.

  1. If we are using only the clean dataset, the sample size is too low for a reasonably deep network to capture features. That's why augmentation is so necessary for this project.
  2. You can reduce the number of layers (check the shared notebook) and increase the validation size a bit more so that the network can understand what to penalize. This is because without augmentation the sample size is....
  3. Not only mean squared error but you can also try MSE + Log MSE.
      def custom_loss(y_true, y_pred):
         msleObject = tf.keras.losses.MeanSquaredLogarithmicError()
         y_true = tf.cast(y_true, tf.float64)
         y_true = tf.add(y_true, 1e-9)
         y_pred = tf.add(y_pred, 1e-9)
         msleTensor = msleObject(y_true, y_pred)
         mseObject = tf.keras.losses.MeanSquaredError()
         mseTensor = mseObject(y_true, y_pred)
         mseTensor_m = tf.math.scalar_mul(5, mseTensor, name=None) #alpha is hyperparameter
         tot_loss = tf.add(msleTensor, mseTensor_m)
         return tot_loss 
   model.compile(..., loss=custom_loss)

Here, I just went through the VGG16 part to check how bad it gets over epochs.

happy learning and best!

from learn-tensorflow.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.