CYBER CODER 🚀

Aprovecha hasta 70% OFF en CURSOS y CARRERAS

|

Hasta el 07/08 ⏰

CYBER CODER 🚀

Aprovecha hasta 70% OFF en CURSOS y CARRERAS

|

Hasta el 07/08 ⏰

Hasta el 07/08 ⏰

CYBER CODER 🚀

Aprovecha hasta 70% OFF en CURSOS y CARRERAS

Create Your First Deep Learning Model: A Step-by-Step Guide

Giovanna Caneva

Sr. Creative Copywriter at Coderhouse

Artificial Intelligence

Create Your First Deep Learning Model: A Step-by-Step Guide

Publicado el

Create Your First Deep Learning Model: A Step-by-Step Guide


Deep Learning is one of the most fascinating branches of Artificial Intelligence, and learning to create your own model may seem like a challenge but, with the right tools, it's much more accessible than you think. In this tutorial, I'll guide you step by step to create a simple Deep Learning model using Python and TensorFlow, one of the most popular libraries for developing neural networks.


What is Deep Learning?Before we begin, it's useful to understand what exactly Deep Learning is. It's a subfield of Machine Learning that uses deep neural networks to model and solve complex problems. This approach has been revolutionary for applications like image recognition, machine translation and voice assistants.


Step 1: Prepare the development environmentThe first thing you need is to set up your work environment. We're going to use Python together with TensorFlow and Keras, two powerful and popular tools in the Deep Learning community.If you don't yet have these libraries installed, you can do it easily using pip. Open your terminal or console and run the following command:This will install both TensorFlow and Keras, since Keras comes integrated within TensorFlow as of version 2.0.


Step 2: Import the necessary librariesWith TensorFlow installed, the next step is to import the libraries needed to build your model.


Step 3: Load and preprocess the dataFor this example, we'll use a classic dataset: MNIST, which contains images of handwritten digits, ideal for starting to work with neural networks. TensorFlow has this data integrated, so you don't need to download it manually.Here we're loading the dataset and splitting it into training and test data. Then, we normalize the pixel values (initially between 0 and 255) so they're between 0 and 1, which facilitates the model's training.


Step 4: Define the Deep Learning modelNow that we have the data ready, it's time to define the architecture of our neural network. For this tutorial, we're going to create a simple feedforward neural network with an input layer, a hidden layer and an output layer.Explanation of the architecture:Flatten Layer: Flattens the 28x28 pixel images into a 784-element vector.Dense Layer: A fully connected layer with 128 neurons, which uses the ReLU (Rectified Linear Unit) activation function to introduce non-linearity.Dense Layer (output): The final layer has 10 neurons, one for each class (the digits from 0 to 9), and uses the softmax activation, which converts the outputs into probabilities.


Step 5: Compile the modelOnce the architecture is defined, we need to compile the model by specifying the optimizer, the loss function and the evaluation metrics.Adam: It's a popular optimizer that adjusts the model's weights efficiently.Sparse categorical crossentropy: This is the loss function used for multiclass classification problems.Accuracy: We'll evaluate the model using accuracy, that is, the proportion of correct predictions.


Step 6: Train the modelNow we're ready to train the model. We're going to have the model pass several times (epochs) over the training data to adjust the weights of the neural network.In this example, we'll train the model for 5 epochs. You can adjust this number to improve performance, but for this tutorial, 5 will be enough to obtain decent results.


Step 7: Evaluate the modelAfter training the model, we'll evaluate its performance on the test dataset to see how it behaves with data it hasn't seen before.


Step 8: Make predictionsFinally, you can use the trained model to make predictions on new images.The model will return an array with the probabilities for each class (digits from 0 to 9) of each image in the test set. You can obtain the final prediction using argmax() to select the most probable value.


ConclusionCongratulations! You've created your first Deep Learning model using TensorFlow and Keras. This is a simple model, but you've already covered the key concepts, from loading data to evaluating the model. From here, you can experiment with different neural network architectures, change the number of layers or neurons, or try other datasets.At AI Academy, we offer courses that go deeper into these topics, guiding you from the fundamentals to the implementation of more complex neural networks for real applications. Deep Learning is only the beginning, and with the right tools and knowledge, the possibilities are infinite.


Nicolás SeguroAI Manager at Coderhouse

If you'd like to keep exploring this topic, you can also read automation with Make and ChatGPT to create smart no-code workflows.

Recommended Coderhouse courses

If you want to understand and apply artificial intelligence in your work, Coderhouse has programs for all levels:

Sobre el autor

Giovanna Caneva

Hi! People call me Gio 👋🏽 I hold a degree in Advertising with a solid track record in digital marketing and content management across UGC, influencers, paid media & owned media. I've collaborated with industries in the Tech, Beauty, Fashion and Finance worlds, each of which added value to my professional profile from a different angle. 📲 I'm a heavy social media user, which keeps me constantly up to date on trends, vocabulary and best practices across the different platforms. To learn more about my background, feel free to check out my LinkedIn profile!

Global

© 2026 Coderhouse. Todos los derechos reservados.

Global

© 2026 Coderhouse. Todos los derechos reservados.

Global

© 2026 Coderhouse. Todos los derechos reservados.

Global

© 2026 Coderhouse. Todos los derechos reservados.