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
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)
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
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.
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 > 2: is_py3 = True else: reload(sys) sys.setdefaultencoding("utf-8") is_py3 = False def native_word(word, encoding='utf-8'): """
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
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 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
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