QA Official

Implementation Based on keras Multilayer LSTM

https://qaofficial.com/post/2019/04/29/24037-implementation-based-on-keras-multilayer-lstm.html 2019-04-29
code is divided into data reading, preprocessing, modeling, training, prediction (test set prediction, future continuous prediction) and result display (this code takes single attribute data set as an example)Data set: https://download.csdn.net/download/chaochaopang0/10405315 # -*- coding: utf-8 -*- """ Created on Tue May 8 14:28:43 2018 @author: lichao_lc """ import numpy as np import matplotlib.pyplot as plt import pandas as pd from keras.layers.core import Dense, Activation, Dropout from keras.models import Sequential import

Keras Learning Essay Based on Theano's Deep Learning Framework-01-FAQ

https://qaofficial.com/post/2019/04/29/23967-keras-learning-essay-based-on-theano#39s-deep-learning-framework-01-faq.html 2019-04-29
http://blog.csdn.net/niuwei22007/article/details/49045909's original address can be viewed for more articles. This article mainly introduces the question-and-answer part of Keras. In fact, it is very simple. It may not be mentioned in detail later. Let's cool it down in advance for easy reading. Keras Introduction: Keras is an extremely simplified and highly modular third-party library of neural networks.Based on Python+Theano development, GPU and CPU operations are fully utilized.

LSTM Model-Emotional Analysis (Text Evaluation Classification)

https://qaofficial.com/post/2019/04/29/24009-lstm-model-emotional-analysis-text-evaluation-classification.html 2019-04-29
import warnings #控制警告错误的输出 warnings.filterwarnings(action='ignore', category=UserWarning, module='gensim') import gensim from gensim.models import word2vec import jieba import tensorflow as tf import numpy as np import time #模块random包含以各种方式生成随机数的函数,其中的randint()

Machine Learning-Classification Problem Evaluation Method

https://qaofficial.com/post/2019/04/29/24090-machine-learning-classification-problem-evaluation-method.html 2019-04-29
Purpose of this article One of the most common problems in machine learning models is classification.After the classification problem is realized, if we evaluate the performance and correctness of the algorithm, it is necessary to summarize here. Common Measures For the result evaluation of classification problems, the main evaluation means are shown in the following table 指标 描述 Scikit-lea

Multi-label Distribution/Multi-label Distribution

https://qaofficial.com/post/2019/04/29/25669-multi-label-distribution/multi-label-distribution.html 2019-04-29
Loss function of multi-label distribution: Different optimization objectives can be formed according to different measurement standards of distance or similarity between distributions.The following uses KL divergence as the distance between probability distributions:\begin{equation}\begin{aligned}\boldsymbol{\theta}^*=& arg\min_{\boldsymbol \theta} \sum_i \sum_j \left ( d_{\boldsymbol x_i}^{y_j} \text{ln } \frac{d_{\boldsymbol x_i}^{y_j} }{p(y_j| \boldsymbol x_i;\boldsymbol \theta)} \right )\\&=arg\max_{\boldsymbol \theta} \sum_i \sum_j d_{\boldsymbol x_i}^{y_j} \text{ln } {p(y_j|\boldsymbol x_i;\boldsymbol \theta)}\end{aligned}\end{equation}Ln (x/y) = lnxlny \ text {ln} (x/y) = \ text

Music Emotion Classification

https://qaofficial.com/post/2019/04/29/24032-music-emotion-classification.html 2019-04-29
Music Emotion Classification Thayer modelThayer's emotional model is a two-dimensional emotional modelThe ordinate represents the energy dimension, which changes from " calm" to " dynamic" and reflects the emotional activity of the subject.The abscissa indicates the pressure dimension.The change from " negative" to " positive" reflects the subjective feelings of the subject, thus dividing musical emotions into four representative categories: excited, angry, sad and relaxed. SVM algorithmSVM(Support Vector Machine) refers to the Support Vector Machine and is a common discrimination method.

Tensorflow Learning Notes: VGG16 Model-Fine Tuning, Cat and Dog Wars, VGGNet's Reorientation Training

https://qaofficial.com/post/2019/04/29/23922-tensorflow-learning-notes-vgg16-model-fine-tuning-cat-and-dog-wars-vggnet#39s-reorientation-training.html 2019-04-29
The collation of the data set of the cat-and-dog war that we introduced earlier has been converted into the special format https://blog.csdn.net/nvidiacuda/article/details/83413837 for Tensorflow. This article introduces the modification of VGG16 model Step 1: Modification of Model The first step is to modify the model (VGG16_model.py file). The original output result here is to judge 1000 different categories, and here is to judge 2 images, namely cats and dogs. Therefore,

Text Emotion Classification

https://qaofficial.com/post/2019/04/29/24031-text-emotion-classification.html 2019-04-29
Movie Text Emotion Classification Github address Kaggle address This task is mainly to classify the emotion of movie review texts, which is mainly divided into positive reviews and negative reviews, so it is a two-classification problem. We can select some common models such as Bayesian and logistic regression. One of the challenges here is the vectorization of text content. Therefore, we first try the vectorization method based on TF-IDF, and

Use Keras to Classify Cats and Dogs

https://qaofficial.com/post/2019/04/29/23900-use-keras-to-classify-cats-and-dogs.html 2019-04-29
This paper introduces an image classification problem. The goal is to get the classification of input images.The method used is to train a convolution neural network. The data set includes thousands of images of cats and dogs.The framework used is Keras library, data set download: write link content here1 download test_set and training_set, including 10000 pictures.The training_set contains two subfolders cats and dogs, each with 8000 pictures about the corresponding category.

Use Word Vector+lstm for Emotional Analysis

https://qaofficial.com/post/2019/04/29/24013-use-word-vector-lstm-for-emotional-analysis.html 2019-04-29
The data set this time is from github, and I am very grateful to the original author for collecting it. The data set is Jingdong's shopping review, which is divided into two texts of positive emotions and negative emotions. Among them, 947 are positive emotion samples and 2142 are negative emotion samples. Use all words to do word vector training.The word vector is trained by gensim, which is very convenient