内容简介: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》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!
猜你喜欢:本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
算法问题实战策略
[韩] 具宗万 / 崔盛一 / 人民邮电出版社 / 2015-2 / 119.00元
第一部分 开始解决问题 第二部分 算法分析 第三部分 算法设计范式 第四部分 一些著名的算法 第五部分 基本数据结构 第六部分 树 第七部分 图一起来看看 《算法问题实战策略》 这本书的介绍吧!