Kursinnhold
Neural Networks with TensorFlow
Neural Networks with TensorFlow
What is Keras?
Introduction
In this course, we're using TensorFlow — one of the most powerful frameworks for building neural networks. But instead of working with it directly, we'll use Keras, which provides a simpler and more intuitive interface.
We'll delve into the core of Keras: its layers, which are the fundamental building blocks of neural networks.
Keras Layers
To recap, in the context of neural networks, a layer is a structured collection of neurons (also called nodes). Each neuron in a layer is typically connected to neurons in the previous and next layers. These connections are defined by weights, which are adjusted during training to help the network learn patterns in the data.
For instance, a standard multi-layer perceptron may look as follows:
Keras, on the other hand, adopts a more modular and flexible approach. In Keras:
- Layers are more granular and specialized: each layer typically performs a specific type of transformation or computation;
- Separation of concerns: instead of a single layer handling both weighted sums and activations, Keras often separates these into different layer types. For instance, a
Dense
layer handles weighted sums, and anActivation
layer handles the activation functions.
All layer types in Keras are implemented as classes within the tensorflow.keras.layers
module. Creating a specific layer involves simply instantiating the corresponding class:
python
Here, Layer
should be replaced with an actual class of a particular layer (e.g, Dense
or Input
).
Takk for tilbakemeldingene dine!