- Deep Learning with Keras
- Antonio Gulli Sujit Pal
- 170字
- 2021-07-02 23:58:01
The first example of Keras code
The initial building block of Keras is a model, and the simplest model is called sequential. A sequential Keras model is a linear pipeline (a stack) of neural networks layers. This code fragment defines a single layer with 12 artificial neurons, and it expects 8 input variables (also known as features):
from keras.models import Sequential
model = Sequential()
model.add(Dense(12, input_dim=8, kernel_initializer='random_uniform'))
Each neuron can be initialized with specific weights. Keras provides a few choices, the most common of which are listed as follows:
- random_uniform: Weights are initialized to uniformly random small values in (-0.05, 0.05). In other words, any value within the given interval is equally likely to be drawn.
- random_normal: Weights are initialized according to a Gaussian, with a zero mean and small standard deviation of 0.05. For those of you who are not familiar with a Gaussian, think about a symmetric bell curve shape.
- zero: All weights are initialized to zero.
A full list is available at https://keras.io/initializations/.
推薦閱讀
- Mastering Delphi Programming:A Complete Reference Guide
- The Applied AI and Natural Language Processing Workshop
- 硬件產品經理手冊:手把手構建智能硬件產品
- OUYA Game Development by Example
- CC2530單片機技術與應用
- Practical Machine Learning with R
- SiFive 經典RISC-V FE310微控制器原理與實踐
- 基于Proteus仿真的51單片機應用
- BeagleBone Robotic Projects
- Spring Cloud微服務和分布式系統實踐
- 單片機原理及應用:基于C51+Proteus仿真
- Intel FPGA權威設計指南:基于Quartus Prime Pro 19集成開發環境
- 計算機組裝與維護(慕課版)
- Deep Learning with Keras
- 施耐德M241/251可編程序控制器應用技術