How to create any custom object in TensorFlow? 



News and Events 

How to create any custom object in TensorFlow? 

On Friday, September 22, at 11:00 a.m., in the meeting room C-301 of the Escuela Técnica Superior de Ingenieros de Telecounicación (ETSIT) of the Universidad Politécnica de Madrid (UPM), a workshop on TensorFlow took place, organized by Marcos Rodrigo, PhD student of the Grupo de Tratamiento de Imágenes (GTI).


IMG 20230922 WA0008


The main topic of the workshop was: "How to create any custom object in TensorFlow".

The main purpose of this workshop is to sharpen our skills with the TensorFlow framework by customizing each and every component employed during the creation, training, and evaluation of deep learning models. To this end, we will meet regularly in order to put them into practice. The main elements that will be addressed throughout the workshop are:

      • Tensors and Variables
      • Loss functions
      • Activation functions
      • Initializers
      • Regularizers
      • Constraints
      • Metrics
      • Layers
      • Models
      • Losses & Metrics based on model internals
      • Gradients
      • Training loops
      • TensorFlow internals (Graph, AutoGraph & Tracing)

During the first session of the workshop, we briefly introduced the TensorFlow framework and practiced with basic tensor and variable operations (initialization, indexing, mathematic operations, type conversions, etc.). We also discussed custom loss functions (via function definition and subclassing) using the Huber loss as an example. Finally, we presented how to save and load models with custom components, which will be applicable for all custom components we create throughout this workshop.


IMG 20230922 WA0017