Deep Learning Primer with Keras

栏目: IT技术 · 发布时间: 6年前

内容简介:Keras is a deep learning framework that sits on top of backend frameworks like TensorFlow.Keras is excellent because it allows you to experiment with different neural-nets with great speed! It sits atop other excellent frameworks like TensorFlow, and lends

What is Keras?

Keras is a deep learning framework that sits on top of backend frameworks like TensorFlow.

Why use Keras?

Keras is excellent because it allows you to experiment with different neural-nets with great speed! It sits atop other excellent frameworks like TensorFlow, and lends well to the experienced as well as to novice data scientists! It doesn’t require nearly as much code to get up and running!

Keras provides you with the flexibility to build all types of architectures; that could be recurrent neural networks, convolutional neural networks, simple neural networks, deep neural networks, etc.

What’s the difference?

You may be asking yourself what the difference is between Keras and TensorFlow… let’s clear that up! Keras is actually integrated into TensorFlow. It’s a wrapper around the TensorFlow backend (Technically, you could use Keras with a variety of potential backends). What does that mean? Pretty much that you are able to make any Keras call you need from within TensorFlow. You get to enjoy the TensorFlow backend while leveraging the simplicity of Keras.

What problems do neural nets work best with?

Feature Extraction

What is the main difference between a neural network and traditional machine learning? Feature Extraction! Traditionally, whoever is operating a machine learning model is performing all tasks related to feature extraction. What makes a neural network different is that they are very good at performing that step for you.

Unstructured data

When it comes to data that isn’t tabular by nature and comes in a very unstructured format; ie audio, video, etc.; it is difficult to perform feature engineering. Your handy dandy neural net is going to perform far better at this type of task.

When you don’t need interpretation

When it comes to a neural net, you don’t have a lot of visibility into the results of your model. While this can be good, depending on the application of the neural net, this can also be tricky. If you can correctly classify an image as a horse, then great! You did it; you don’t really need to know how your neural net figured it out; whereas for other problems, that may be a key aspect to the model’s value.

What does a neural network look like?

Your most basic neural network is going to consist of three main layers:

Your input layer, which is going to consist of all of your training data,

Your hidden layer(s), this is where all parameter weighting will take place,

Then finally your output layer — where your prediction will be served up!

Weight tuning

When it comes to the weights applied in the hidden layers of a neural network, there are a couple of main things that we use to help optimize our neural net for the right weight. One of those things is the use of an activation function to determine the weights. Activation functions help your network identify complex non-linear patterns in your data. You might find yourself using sigmoid, tanh, relu, and softmax.

Get your hands dirty!

You’ll want to import the required packages from Keras. Sequential allows you to instantiate your model, & layers allow you to add each layer, base, hidden, & output. Furthermore, the model.add() calls are how we go about adding each layer to a deep learning network all the way through the final output layer.

# load libraries
from keras.models import Sequential
from keras.layers import Dense# instantiate model
model = Sequential()# here you can add your hidden layer
model.add(Dense(4, input_shape=(2,), activation="relu"))# one neuron output!
model.add(Dense(1))
model.summary()

Conclusion

If you’ve made it all the way down here then you’ve successfully run your first neural network! I hope this quick intro to Keras was informative & helpful. Let me know if there are other topics or principles you’d like to hear more about. Until then, Happy Data-sciencing!


以上所述就是小编给大家介绍的《Deep Learning Primer with Keras》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

注意力商人

注意力商人

吳修銘 / 黃庭敏 / 天下雜誌 / 2018-4-2 / NT$650

電子郵件,免費!照片分享,無上限! 你是否想過,隨手可得的免費內容、便利的免費服務,到底都是誰在付費? 如果商品免費,那你就不是消費者,而是商品! 你我可能都不知不覺地把自己賣給了注意力商人! 「『媒體轉型、網路演化與資訊浪潮」此一主題最具洞見的作者。』──黃哲斌(資深媒體人) 「這是少有的關注產業發展的傳播史,對現在或未來的『注意力產業』」中人來說,不可不讀。」──......一起来看看 《注意力商人》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

Markdown 在线编辑器
Markdown 在线编辑器

Markdown 在线编辑器