Python self study notes - Chapter 3 control structure and exceptions

1. Control structure Python implements conditional branching through if statement and loop through while statement and for...in statement. There are other conditional expressions, like the ternary operators in Java or C. 1.1. Conditional branch The most common syntax for Python conditional branch statements: if boolean_expression1: suite1 e ...

Posted on Mon, 17 Feb 2020 00:32:07 -0800 by lhaynes

Linear Regression &Softmax classification model & multi-layer perceptron

Linear regression after class questions Full connection layer and I / O shape If you are implementing a fully connected layer, the input shape of the fully connected layer is 7 × 8, and the output shape is 7 × 1, where 7 is the batch size, then the shape of the weight parameter w and th ...

Posted on Fri, 14 Feb 2020 07:45:51 -0800 by David-fethiye

Two solutions to over fitting

This paper mainly studies the book of dive into DL pytorch. So most of the content of this blog comes from this book. The framework uses pytorch, and the development tool is pycharm Refer to hands-on deep learning Reference link https://github.com/ShusenTang/Dive-into-DL-PyTorchhttps://github.com/zergta ...

Posted on Wed, 12 Feb 2020 04:41:51 -0800 by baw

Notes on knowledge points of softmax regression

The basic concept of softmax Softmax regression, like linear regression, is also a single-layer neural network. The output layer of softmax regression is also a full connection layer. The classification problem needs to get discrete prediction output. A simple way is to output the valueAs the predi ...

Posted on Tue, 11 Feb 2020 22:14:50 -0800 by mickey9801

Python learning notes -- Chapter 2: Python basic syntax elements

Part I data types This is just a brief introduction (for zero basic scholars). If you want to see a detailed introduction of data types, please click here 1. Basic types: number, string, Boolean 1.1 number type int integer 2 float floating point number with decimal 2.0 Complex complex a+bj ...

Posted on Tue, 04 Feb 2020 21:54:48 -0800 by VMinder

Pandas 10 - options and customization

Pandas 10 - options and customization Article directory Pandas 10 - options and customization 1, About custom behavior 2, Use case 1. Get option (param) get 1.1 display.max? Rows 1.2 display.max'columns 2. Set option (param, value) setting 2.1 display.max_rows 2.2 display.max_columns 3. Reset ...

Posted on Sun, 26 Jan 2020 20:57:27 -0800 by printf

Common operations of strings in python

1. find checks whether str is included in mystr. If it is the index value at the beginning, otherwise - 1 is returned In [5]: mystr='hello world itcast and hahaitcast' In [6]: mystr.find('world') Out[6]: 6 In [7]: mystr.find('heihei') Out[7]: -1 2. index is the same as find, but str does not report an exception in mystr In [8]: mystr.index('itc ...

Posted on Wed, 11 Dec 2019 08:24:33 -0800 by FUNKAM35

python self-study diary 10 - file

Exposing yourself to errors as much as possible is a faster way to grow up. Sending errors proves that you need to acquire new knowledge. 1. Write a function sed that takes the following parameters, a pattern string, a substitution string, and two file names; read the first file and write the content to the second If a pattern string appears an ...

Posted on Mon, 11 Nov 2019 11:32:29 -0800 by dasmon777

Use of Python module and import method of self built module

Module usageModular: Modular pyth1.on basic way to organize code A python script can be run by itself or imported into another script. When the script is imported and run, we call it module. All point p files can be imported as a module The module name is the same as the file name of the script. For example, if we write a script named hello.pv ...

Posted on Fri, 01 Nov 2019 07:03:43 -0700 by vigge89

python self study diary 7 - Dictionary

Learning to break complex problems into basic problems is the right way to learn 1. Write a function, read in words.txt, and save them as keys in a dictionary After that, you can use in to check whether a word is in the dictionary. It's not difficult. Read the word list first, then use the word as the key, and use the empty character as the val ...

Posted on Mon, 28 Oct 2019 09:42:01 -0700 by jervo