QA Official

Regular Items L1 and L2 Added to Loss Function in Linear Regression

RegularizationAlmost all machine learning can see that an additional term is added after the loss function. There are two commonly used additional terms, generally called 1-norm and 2-norm in English, L1 regularization and L2 regularization in Chinese, or ℓ1-norm and ℓ2-norm. L1 regularization and L2 regularization can be regarded as penalty terms of loss function.L1 regularization refers to the sum of the absolute values of each element in the weight vector w, which is usually expressed as ||w||1L2 regularization refers to the sum of squares of each element in the weight vector w and then the square root is calculated (it can be seen that the L2 regularization term of Ridge regression has a square sign), which is usually expressed as ||w||2

Several binary encoding functions of sklearn involved: OneHotEncoder (), LabelEncoder (), LabelBinarizer (), MultiLabelBinarizer ()

https://qaofficial.com/post/2019/03/29/23656-several-binary-encoding-functions-of-sklearn-involved-onehotencoder-labelencoder-labelbinarizer-multilabelbinarizer.html 2019-03-29
Transferred from http://blog.csdn.net/haramshen/article/details/53169963 Several binary encoding functions of sklearn involved: OneHotEncoder (), LabelEncoder (), LabelBinarizer (), MultiLabelBinarizer () 1. Code Block import pandas as pd from sklearn.preprocessing import OneHotEncoder from sklearn.preprocessing import LabelEncoder from sklearn.preprocessing import LabelBinarizer from sklearn.preprocessing import MultiLabelBinarizer testdata = pd.DataFrame({'pet': ['cat', 'dog', 'dog', 'fish'],'age': [4 , 6, 3, 3], 'salary':[4, 5, 1, 1]}) 1 2 3 4 5 6 7 8 1 2 3 4 5

TensorFlow Detailed Understanding of Cat and Dog Identification (1)-Read Your Data Set

dataset downloadLink: https://pan.baidu.com/s/1SlNAPf3NbgPyf93XluM7Fg Password: hpn4 Data set has 12,500 cat and 12,500 dog respectively Read Data SetAfter reading the data set and consulting so many documents, it is generally understood that there are roughly two methods for reading the data set. 1, Mr. cheng picture list, and label list, the picture name and label corresponding, then read the production iterator (I think this method is generally used in, the picture name can clearly know label)

Transfer Learning Skills and Experience Summary on How to Better finetune Model

https://qaofficial.com/post/2019/03/29/24500-transfer-learning-skills-and-experience-summary-on-how-to-better-finetune-model.html 2019-03-29
This article refers to the following article https://blog.csdn.net/u014381600/article/details/71511794 https://blog.csdn.net/qq_28659831/article/details/78985797 It is only convenient for you to learn and use. If there is infringement, please contact and delete it. article reference translated from cs231n 其实我们常用的直接finetune pre-trained model就属于迁移学习（Transf

[ Neural Network ] Layers in ]keras

https://qaofficial.com/post/2019/03/29/24413-neural-network-layers-in-keras.html 2019-03-29
Core Full Connection Layer: Dense Activation Layer: Adds an activation function to the output of a layer Dropout layer: randomly disconnect a certain percentage (b) of input neuron connections each time parameters are updated to prevent over-fitting Flatten layer: used to " flatten" the input, i.e. to unidimensional the multi-dimensional input, which is commonly used in the transition from convolution layer to full connection layer. Reshape layer: used to convert the input shape to a specific shape Permute layer: rearrange the input dimensions according to a given mode, for example, this layer may be used when RNN and CNN network need to be connected.

implementation of text multi-classification model code based on softmax

https://qaofficial.com/post/2019/03/29/23766-implementation-of-text-multi-classification-model-code-based-on-softmax.html 2019-03-29
For multi-classification problems, you can use softmax, but the effect is not so good, let's use it as an algorithm trainer. First is the code for data set processing: file name: data_loader.py # coding: utf-8 import sys from collections import Counter import pdb import numpy as np import tensorflow.contrib.keras as kr if sys.version_info[0] > 2: is_py3 = True else: reload(sys) sys.setdefaultencoding("utf-8") is_py3 = False def native_word(word, encoding='utf-8'): """

keras-30 seconds to build neural network

https://qaofficial.com/post/2019/03/29/24890-keras-30-seconds-to-build-neural-network.html 2019-03-29
keras is an advanced neural network API written in python and can run on TensorFlow or Theano.It focuses on fast implementation and easy use.Has the following advantages: * Simple and fast prototype building through user-friendly, modular and extensible implementation. * Support convolution neural network, circulation neural network and their combination. * Runs seamlessly on CPU and GPU. keras supports python2.7-3.5 30 seconds to learn keras keras' core data structure is

socket Error Analysis of Linux Network Programming

https://qaofficial.com/post/2019/03/29/23618-socket-error-analysis-of-linux-network-programming.html 2019-03-29
The article was reprinted from http://blog.csdn.net/nellson/article/details/5669935 without any source.Socket error code: EINTR： 4Blocked operations are interrupted by unblocked calls.This error will be encountered if the send and receive timeout is set.Socket in blocking mode only.When reading or writing a blocked socket,-1 returns with the error number INTR.In addition, if EINTR (errno = 4) occurs and the error description is Interrupted system call, the operation should also continue.If the recv returns a value of 0, then the connection has been disconnected and the receive operation should end.

Keras Introduction, Keras Builds Basic Neural Network Ensemble

https://qaofficial.com/post/2019/03/28/23554-keras-introduction-keras-builds-basic-neural-network-ensemble.html 2019-03-28
Keras Introduction Keras is a high-level neural network API that constructs neural networks for training and testing. It is written in Python language and can use TensorFlow, Theano and CNTK as back ends.Strictly speaking, Keras cannot be called a deep learning framework. It is more like a deep learning interface, which is built on a third-party framework.The over-encapsulation of Keras leads to its inflexibility and slow running speed.However, Keras is

Keras Learning Notes: Sequential Model

https://qaofficial.com/post/2019/03/28/23527-keras-learning-notes-sequential-model.html 2019-03-28
directory: This series refers to official documents. Official documentsThis is the previous article that keras can refer to: This is kerasLearning Notes Keras: Some Basic Concepts Some Basic ConceptsKeras: Frequently Asked Questions Learning Notes: Keras Frequently Asked QuestionsKeras Installation and Configuration Guide under Windows: Keras Installation and Configuration Guide under Windows Quick Start Sequential Model sequence model is a linear stack of multiple network layers, that is, " one road