Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the programming environment Jupyter in the introduction to Keras deep learning

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

Keras deep learning entry programming environment Jupyter is what, I believe that many inexperienced people are helpless about this, this article summarizes the causes of the problem and solutions, through this article I hope you can solve this problem.

I. Running Jupyter

Jupyter in the editing process, each edit a piece of code, you can run a piece of code, the results of the run will also be displayed directly under the code, easy to view. In data science, where frequent data cleansing, viewing, and drawing is required, this interactive development environment is highly desirable.

All the results of running and editing will be saved in a file. As long as you share the file with others later, you can see a series of operations.

Jupyter Paragraph-based editing mode:

Start jupyter, the system prompts the following error:

C:\WINDOWS\system32>jupyter notebook

AttributeError: type object 'IOLoop' has no attribute 'initialized'

Reason:

Tornado version is too high, as shown in the figure below as 5.1.1, does not support jupyter notebook.

conda install tornado=4.5

Start jupyter, start successfully

To facilitate file management, specify the working path to start:

jupyter notebook D:\g_learn\jupyter

Second, through Jupter, to carry out Keras environment inspection:

Create a python file named keras_evn, save it

Python version check, enter command! python --version,[shift +enter] to run the basic package import check,[shift +enter] to run, normal check installation version three, Python to implement the perceptron, in order to understand the role of keras API:

Forward propagation: Input through the input layer and compute the output all the way forward.

Backpropagation: The process of updating weights backward through output. Difference * learning rate to update weights.

Chain rule: calculus derivative rule, used to find a derivative of a complex function, is a common method in calculus derivative operation. The derivative of a composite function will be the product of the derivatives of the finite functions that make up the composite at the corresponding points, one after the other like a chain, hence the chain rule.

Linear Perceptron: Classify data according to features. Through this algorithm, you can find a curve, surface, or hyperplane, which can be represented as a line in a two-dimensional graph. When the dimension is greater than 3, it is a hyperplane, n-1 dimension.

In a two-dimensional space, generate some points, generate a line, divide the original points. Perceptual machines classify random points to see differences.

The results are as follows:

Keras Hello world - Minist handwriting recognition:

Keras Foundation Module:

In juypter, use SHIFT+TAB to quickly view function parameters

Minist Handwriting Recognition Import Data Set| model| layer| Optimizer

Loading data from the dataset, training set and test set, takes a while

Training set 60000 pieces 28*28, test set

This is the visual package, shown in gray, plus the parameter cmap="gray"

To see if this picture is a 5, convert the picture to a one-dimensional vector and look at it.

And you can see that this is a value between 0 and 255.

And you can see that this is a value between 0 and 255.

We expect that by narrowing the values to 0-1, the neural network will converge faster.

Keras provides tools to convert vectors into second-order matrices with to_categorical, which is 0-9, so there are 10.

Building the model, the rest of the work is left to the neural network. Input Layer-Hidden Layer-Output Layer

The above model is built, and the neural network is compiled through compile: optimizer, loss function, and artificial judgment can be made through [accuracy].

Training the model and optimizing it five times, you can see that the accuracy is getting higher and higher, and the loss is getting smaller and smaller.

Evaluate the effectiveness of the model with evaluate

'activations', activation function' applications', have trained models 'callbacks', callback function engine is the core code of layer layers including keras implemented network layers, convolution layers, etc. losses function, measure good or bad in training metricsmodels functional programming, and sequential programming optimizer A method to update weights preprocessing module regularizersutils tool module wrappers packaging module

After reading the above, do you know how to program Jupyter in Keras Deep Learning Introduction? If you still want to learn more skills or want to know more related content, welcome to pay attention to the industry information channel, thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report