Skip to main content

Posts

Showing posts with the label non-trainable params

TensorFlow Fine-Tuning: Customize Pre-Trained Models

TensorFlow, an open-source machine learning library, empowers developers to build and train sophisticated models. However, training these models from scratch can be time-consuming and computationally expensive. Fine-tuning pre-trained models offers a solution by leveraging the knowledge gained from previously trained models on large datasets. This approach significantly reduces training time and improves performance. This blog post cover the following topics: What is Fine-Tuning? Why Fine-Tune Pre-Trained Models? How to Fine-Tune Pre-Trained Models in TensorFlow Additional Tips for Fine-Tuning? What is Fine-Tuning? Fine-tuning involves modifying a pre-trained model by adjusting its weights and biases while keeping the overall architecture intact. The pre-trained model serves as a starting point, providing a strong foundation of learned features. Fine-tuning focuses on adapting the model to a specific task or dataset, preserving the generic features while refining them for the tar...

TensorFlow Keras Transfer Learning: A Comprehensive Guide (Python)

Transfer learning is a machine learning technique that allows a model to learn from one task and then apply that knowledge to a different but related task. This can be a very effective way to improve the performance of a model on a new task, especially if the new task has limited data. TensorFlow is a popular open-source machine learning library that provides a variety of tools for transfer learning. In this blog post, we will provide a comprehensive guide to TensorFlow transfer learning, covering the following topics: What is transfer learning? How does transfer learning work? When should you use transfer learning? How to use TensorFlow for transfer learning ? What is Transfer Learning? Transfer learning is a machine learning technique that allows a model to learn from one task and then apply that knowledge to a different but related task. This can be a very effective way to improve the performance of a model on a new task, especially if the new task has limited data. For examp...

Tensorflow Keras Freeze Layers / Unfreeze Layers (Python Example)

Tensorflow keras freeze / unfreeze a specific layer or multiple layers based on layer name. Freezing a layer retains current weights of a layer and does not alter when the model is trained / during model fitting. Simply put the the frozen layers are not trainable. Freezing layer is a technique predominantly used for transfer learning and fine-tuning.These are cases in which we wish to retain layer weights; as this could be an already trained model like resnet , mobilenet,etc. Or we just want to train only certain layers in the current model and not the whole model- we can freeze and unfreeze layers according to our needs and then start the fitting processing. Creating a new tensorflow model using functional api - execute the given code to generate the following model. Generated model is stored in a variable called "model". # viewing the model info # pass "show_trainable=True" # to see whether a layer is trainable model.summary(show_trainable=True) Model: ...

Topics

Show more