Deep Learning Primer with Keras

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

内容简介: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》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

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

编码的奥秘

编码的奥秘

Charles Petzold / 伍卫国、王宣政、孙燕妮 / 机械工业出版社 / 2000-9-1 / 24.00

渴望交流是大多数人的天性。在本书中,“编码”通常指一种在人和机器之间进行信息转换的系统。换句话说、编码即是交流。有时我们将编码看得很神秘,其实大多数编码并非都是这样。大多数的编码都需要被很好地理解,因为它们是人类交流的基础。――《编码的奥秘》 手电筒、英国人入侵、黑色的猫和跷跷板与计算机有什么必然联系?本书向我们展示了使用语言的一些直观方法并创造新的方法来进行相互之间的交流。此书使我们明白了......一起来看看 《编码的奥秘》 这本书的介绍吧!

URL 编码/解码
URL 编码/解码

URL 编码/解码

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具