Deep Learning Primer with Keras

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

内容简介: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-7 / 88.00元

微商不仅仅是一种继传统实体、电商之后的革命性新兴商业形态,更是一种能够写入中国商业史的思潮。龚文祥新著《微商思维》,从道的层面对广大微商人的商业实践智慧进行了高度浓缩与抽象总结,站在更高的视角解读微商背后的商业逻辑与本质。 本书前半部分,主要从本质、品牌、营销等几个方面,阐述了微商思维的内涵及应用场景,帮助读者了解并认识这种革命性的商业思维。 后半部分主要是触电会社群内部各位大咖的实操......一起来看看 《微商思维》 这本书的介绍吧!

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

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

Markdown 在线编辑器

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换