QA Official

talk about sigmod and softmax

https://qaofficial.com/post/2019/03/30/23762-talk-about-sigmod-and-softmax.html 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

https://qaofficial.com/post/2019/03/29/24814-keras-function-introduction.html 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: https://blog.csdn.net/u011327333/article/details/78501054 (Understanding LSTM Parameters return_sequences and return_state in keras API) ----------------------------------------------------------------------------------------------------------------

Keras for Iris dataset classification

https://qaofficial.com/post/2019/03/29/24599-keras-for-iris-dataset-classification.html 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

https://qaofficial.com/post/2019/03/29/24381-linux-setting-python3.5-keras.html 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)

https://qaofficial.com/post/2019/03/29/23888-faster-rcnn-learning-notes-1.html 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

https://qaofficial.com/post/2019/03/29/24889-keras-learning-ii-application-of-neural-network-model.html 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

https://qaofficial.com/post/2019/03/29/24888-keras-model-for-prediction-considerations.html 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

https://qaofficial.com/post/2019/03/29/24849-keras-parameter-adjustment-optimization-some-settings-etc.html 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

https://qaofficial.com/post/2019/03/29/24264-pytorch-learning-textcnn-implementation.html 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

https://qaofficial.com/post/2019/03/29/24150-svm-common-kernel-functions.html 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.