keras_input_explanation
Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
keras_input_explanation [2020/10/03 12:22] – [Input Dimension Clarified] serge | keras_input_explanation [2020/12/27 15:14] (Version actuelle) – serge | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
====== Keras input explanation: | ====== Keras input explanation: | ||
+ | <WRAP center round box 60% centeralign> | ||
+ | **{{tagpage> | ||
+ | </ | ||
+ | <WRAP center round box 60% centeralign> | ||
+ | **[[les_pages_intelligence_artificielle_en_details|Les Pages Intelligence Artificielle en détails]]** | ||
+ | </ | ||
+ | |||
Mise en forme d'un post de **stackoverflow.com** non traduit en français, car très technique ce qui ne se comprend qu'en anglais. | Mise en forme d'un post de **stackoverflow.com** non traduit en français, car très technique ce qui ne se comprend qu'en anglais. | ||
**[[https:// | **[[https:// | ||
+ | |||
+ | =====Ressources===== | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
=====Question===== | =====Question===== | ||
Ligne 28: | Ligne 40: | ||
====The input shape==== | ====The input shape==== | ||
What flows between layers are tensors. Tensors can be seen as matrices, with shapes. \\ | What flows between layers are tensors. Tensors can be seen as matrices, with shapes. \\ | ||
- | In Keras, the input layer itself is not a layer, but a tensor. It's the starting tensor you send to the first hidden layer. This tensor must have the same shape as your training data. \\ | + | In Keras, the input layer itself is not a layer, but a tensor. It's the starting tensor you send to the first hidden layer. |
- | Example: if you have 30 images of 50x50 pixels in RGB (3 channels), the shape of your input data is (30, | + | Example: if you have 30 images of 50x50 pixels in RGB (3 channels), the shape of your input data is (30, |
Each type of layer requires the input with a certain number of dimensions: | Each type of layer requires the input with a certain number of dimensions: | ||
* Dense layers require inputs as (batch_size, | * Dense layers require inputs as (batch_size, | ||
Ligne 37: | Ligne 49: | ||
*if using channels_first: | *if using channels_first: | ||
* 1D convolutions and recurrent layers use (batch_size, | * 1D convolutions and recurrent layers use (batch_size, | ||
- | *Details on how to prepare data for recurrent layers | + | *Details on [[https:// |
Now, the input shape is the only one you must define, because your model cannot know it. Only you know that, based on your training data. \\ | Now, the input shape is the only one you must define, because your model cannot know it. Only you know that, based on your training data. \\ | ||
All the other shapes are calculated automatically based on the units and particularities of each layer. | All the other shapes are calculated automatically based on the units and particularities of each layer. | ||
Ligne 168: | Ligne 181: | ||
- | {{tag>sb ia}} | + | {{tag>sb ia keras}} |
keras_input_explanation.1601727753.txt.gz · Dernière modification : 2020/10/03 12:22 de serge