QA Official

talk about sigmod and softmax 2019-03-30
1. Common ground 1, the value range is 0 ~ 1 interval, said probability, probability is naturally the value range 2, can be used as the output layer function of the classification task 2. Differences 1, sigmod as output layer function to solve the two classification task, the output value is a decimal;In addition, it can be used as an activation function of the hidden layer. In addition, activation function is the core reason to explain the nonlinearity of neural network.

Keras Function Introduction 2019-03-29
PS: If weights need to be shared (i.e. do not reinitialize), One way: Use global variables (this will only be initialized once and will not be reinitialized afterwards) Another way: do not use global variables, and manually enter the weights every time you initialize (too much trouble, not recommended) ---------------------------------------------------------------------------------------------------------------- PS: (Understanding LSTM Parameters return_sequences and return_state in keras API) ----------------------------------------------------------------------------------------------------------------

Keras for Iris dataset classification 2019-03-29
Keras for Iris dataset classification Python Implements Classification Code Keras Neural Network-Classification Problem. # -*- coding: utf-8 -*- import numpy as np # 用来做矩阵运算 import pandas as pd # 用来做数据分析 from keras.models import Sequential # 模型&序列串行的类 from keras.layers import Dense # 隐含层的节

Linux Setting python3.5+Keras 2019-03-29
1. Directly execute these two commands:sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 100sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 150To switch to Python2, perform:sudo update-alternatives --config python 2. Installing Keras $ sudo pip install --upgrade keras

faster-rcnn Learning Notes (1) 2019-03-29
Status quo: I don't know much about the underlying code of CAFE, I have limited knowledge about the architecture of CAFE, and I know more about the design ideas of CAFE. I want to learn caffe carefully for the next period of time, but at present, the faster-rcnn attached to caffe is the one that deals most with in-depth learning. let's first learn the whole process of faster-rcnn and the

keras Learning II: Application of Neural Network Model 2019-03-29
Introduction keras provides two models, one is Sequential, which translates into a sequential model.The other is Functional, which translates into a functional model.The two can be distinguished from each other by their usage form. The sequence model can be regarded as an object-oriented method, and a series of objects cooperate to complete the task.The function model is a series of procedure calls to complete the task. The concept ofsequence model

keras model for prediction considerations 2019-03-29
Why is the training error much higher than the test error? A Keras model has two modes: training mode and testing mode.Some regular mechanisms, such as Dropout, L1/L2 regular items will not be enabled in test mode. In addition, the training error is the average of the errors of each batch of training data.In the training process, the error of batch at the beginning of each epoch is larger, while the error of the following batch is smaller.

keras parameter adjustment, optimization, some settings, etc 2019-03-29
1. Turn off GPU and only use CPU Before importtensorflow, add: import os os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID" # see issue #152 os.environ["CUDA_VISIBLE_DEVICES"] = Specifies which GPU to use import os os.environ["CUDA_VISIBLE_DEVICES"] = "2"2. Set the proportion of GPU memory occupied by keras: import os import tensorflow as tf import keras.backend.tensorflow_backend as K def get_session(gpu_fraction=0.3): '''Assume that you have 6GB of GPU memory and want to allocate ~2GB''' num_threads = os.environ.get('OMP_NUM_THREADS') gpu_options

pytorch learning textCNN implementation 2019-03-29
I have been learning pytorch recently, so I try to use pytorch to implement textCNN, PS (others on Git implement textCNN).Pytorch is better than tensorflow in that it is easy to learn and suitable for beginners. First of all, we should pay attention to the data preprocessing of this sample. The data I used is the Chinese text classification data set THUCNews, which is generated by filtering historical data from

svm Common Kernel Functions 2019-03-29
SVM kernel function selection plays a vital role in its performance, especially for those linearly inseparable data, so kernel function selection is very important in SVM algorithm.As for the kernel technique, we know that its purpose is to make the data separable in the feature space by mapping the linearly inseparable data in the input space into a high latitude feature space. We define this mapping as (x) \ phi (x), then we can change the solution of constrained optimization problem into \begin{matrix}min_\alpha & \frac12\sum_{i = 1}^N\sum_{j = 1}^N\alpha_i \alpha_jy_iy_j(\phi_i\cdot\phi_j) - \sum_{i=1}^N\alpha_i \\s.