C贸mo utilizar TensorFlow 2.0 con Python

1

Redes neuronales con TensorFlow

2

Introducci贸n a TensorFlow 2.0

Manejo y preprocesamiento de datos para redes neuronales

3

Uso de data pipelines

4

C贸mo cargar bases de datos JSON

5

Cargar bases de datos CSV y BASE 64

6

Preprocesamiento y limpieza de datos

7

Keras datasets

8

Datasets generators

9

Aprende a buscar bases de datos para deep learning

10

C贸mo distribuir los datos

11

Crear la red neural, definir capas, compilar, entrenar, evaluar y predicciones

Optimizaci贸n de precisi贸n de modelos

12

M茅todos de regularizaci贸n: overfitting y underfitting

13

Recomendaciones pr谩cticas para ajustar un modelo

14

M茅tricas para medir la eficiencia de un modelo: callback

15

Monitoreo del entrenamiento en tiempo real: early stopping y patience

16

KerasTuner: construyendo el modelo

17

KerasTuner: buscando la mejor configuraci贸n para tu modelo

Almacenamiento y carga de modelos

18

Almacenamiento y carga de modelos: pesos y arquitectura

19

Criterios para almacenar los modelos

Fundamentos de aprendizaje por transferencia

20

Introducci贸n al aprendizaje por transferencia

21

Cu谩ndo utilizar aprendizaje por transferencia

22

Carga de sistemas pre-entrenados en Keras

23

API funcional de Keras

24

Uso sistemas pre-entrenados de TensorFlow Hub

Resultados de entrenamiento

25

Introducci贸n a variables relevantes del TensorBoard

26

An谩lisis y publicaci贸n de resultados del entrenamiento

27

Introducci贸n al despliegue de modelos en producci贸n

28

Siguientes pasos con deep learning

You don't have access to this class

Keep learning! Join and start boosting your career

Aprovecha el precio especial y haz tu profesi贸n a prueba de IA

Antes: $249

Currency
$209
Suscr铆bete

Termina en:

1 D铆as
23 Hrs
58 Min
45 Seg

Introducci贸n al aprendizaje por transferencia

20/28
Resources

Transfer learning is a very valuable technique that allows us to take advantage of models already trained by other devs to use them in our datasets.

Through this module we will understand what transfer learning is, how to load pre-trained systems, how to consume them from third party sources and how to apply them to our projects.

Temario general Transfer Learning

How does transfer learning work?

To understand how transfer learning works let's make an analogy: when you were a child you learned to ride a bicycle, during that learning you understood the concepts of balance, force, speed and so on. In the future, when you learn to ride a motorcycle, you will be able to transfer most of the concepts you have already learned to take advantage of this new learning.

At the machine level, transfer learning is done through the features or characteristics of the model you originally trained. Suppose you have an apple detector and now you want to detect other fruits (oranges, pineapples, etc).

It will not be necessary to retrain a model from the beginning since you already have a configuration that detects shapes and colors, it would be enough to make some iterations on this main model with the new data and you will get a model just as functional.

On the web you can find dozens of configurations that have been trained for months by the hand of great protagonists of deep learning research.

The configuration process will be to remove the final layer of the network that we are going to take advantage of (the original prediction layer) and replace it with our own output configuration.

Arquitectura general CNN

Using a pre-trained network

Before using a pre-trained model it is essential to understand its architecture.

The MobileNet V2 architecture was designed for object detection in embedded and mobile devices, its input is a 300x300 pixel image and through a series of convolutional layers with max pooling all the features to be classified with a neural network system are acquired. If we wanted to use it, it would be enough to delete the last layer and customize it to our needs.

Arquitectura MobileNetV2

For this occasion we will load the Inception version 3 model (another well-known convolutional network architecture). We will import our Keras dependencies and load the configuration from the location where they are stored on disk, create a sequential model and inject it from the first layer (note that the output layer is not included).

Our new output layer is added and the model is configured as untrainable.

````python from tensorflow.keras.layers import Dense from tensorflow.keras.Model import Sequential from tensorflow.keras.applications.inception_v3 import InceptionV3

URL inception model

weights_file = "/tmp/inception_v3_weights_tf_dim_ordering_tf_kernels_notop.h5"

new_model = Sequential() new_model.add(InceptionV3(include_top = False, weights = weights_file))

new_model.add(Dense(num_classes, activation = "softmax")) new_model.layers[0].trainable = False ````.

With this we can leverage hundreds of models already trained by other AI devs.

Contribution created by Sebasti谩n Franco G贸mez.

Contributions 5

Questions 1

Sort by:

Want to see more contributions, questions and answers from the community?

Despu茅s de algunas horas haciendo los ejercicios del curso en Colab, ya no me deja conectar con el con el backend de GPU.
Se煤n indican Colab puede brindar recursos gratuitos pero tiene l铆mites de uso din谩micos que a veces fluct煤an y a que no proporciona recursos garantizados o ilimitados. Colab no publica estos l铆mites, en parte porque pueden (y de hecho, lo hacen) cambiar. Como resultado, los usuarios que utilizan Colab para ejecutar c谩lculos de larga duraci贸n o los que usaron m谩s recursos 煤ltimamente tienen m谩s probabilidades de encontrar l铆mites de uso o de que se restrinja de manera temporal su acceso a las GPU y TPU.

El aprendizaje por transferencia ofrece varias ventajas:

  1. Acelera el entrenamiento: Al aprovechar el conocimiento adquirido en la tarea fuente, el modelo para la tarea objetivo puede aprender m谩s r谩pido y con menos datos. Esto es especialmente 煤til para tareas donde la recopilaci贸n de datos es costosa o dif铆cil.

  1. Mejora el rendimiento: En muchos casos, el aprendizaje por transferencia puede conducir a un mejor rendimiento en la tarea objetivo, incluso si el modelo pre-entrenado no fue dise帽ado espec铆ficamente para esa tarea. Esto se debe a que el modelo pre-entrenado ha aprendido representaciones generales del mundo que pueden ser 煤tiles para una amplia gama de tareas.

  1. Reduce la necesidad de datos: El aprendizaje por transferencia puede ser particularmente beneficioso cuando se dispone de conjuntos de datos peque帽os para la tarea objetivo. Al utilizar un modelo pre-entrenado, el modelo objetivo puede aprender a partir de menos datos de los que necesitar铆a si se entrenara desde cero.

Tipos de aprendizaje por transferencia:

  1. Aprendizaje por transferencia fina (fine-tuning): En este enfoque, se ajusta el modelo pre-entrenado en la tarea objetivo. Esto implica modificar las capas superiores del modelo para que se adapten a los datos espec铆ficos de la tarea objetivo.

  1. Extracci贸n de caracter铆sticas (feature extraction): En este enfoque, se utilizan las capas iniciales del modelo pre-entrenado como extractor de caracter铆sticas. Las caracter铆sticas extra铆das se utilizan luego para entrenar un nuevo modelo lineal o de otro tipo en la tarea objetivo.

Ejemplos

  1. Visi贸n artificial: Se puede utilizar para entrenar modelos de reconocimiento de objetos, clasificaci贸n de im谩genes y segmentaci贸n de im谩genes.
  1. Procesamiento del lenguaje natural: Se puede utilizar para entrenar modelos de traducci贸n autom谩tica, an谩lisis de sentimientos y resumen de texto.
  1. Rob贸tica: Se puede utilizar para entrenar robots para realizar tareas como la navegaci贸n, la manipulaci贸n de objetos y el reconocimiento de voz.

Hugging face es otro foro de modelos m谩s reciente, que aqu铆 en platzi tambi茅n hay un curso para hacer transfer learning con el
https://huggingface.co/

El tema que tanto quer铆a saber 馃槂

muy buena clase