topic meaning ccc cats, ddd dogs, vvv individual votes are given. Everyone may only like a cat, hate a dog, or like a dog, hate a cat.Ask how many people can be satisfied at most by removing some cats and dogs.
thinking It is not difficult to see that liking a cat, hating a dog and liking a dog, hating a cat may be mutually exclusive.We will also introduce a concept of "
K K-nearest Neighbor k-Nearest Neighbor algorithm
In the picture on the right, which class should the green circle be assigned, is it a red triangle or a blue square?If K=3, because the proportion of red triangles is 2/3, the green circle will be assigned to the red triangle class; if K=5, because the proportion of blue squares is 3/5, the green circle will be assigned to the blue square class.
Keras Official Case Labels (Space Separated): Keras Learning
MLP Multi-classification Problem import keras from keras.models import Sequential from keras.layers import Dense, Dropout, Activation from keras.optimizers import SGD # Generate dummy data import numpy as np x_train = np.random.random((1000, 20)) y_train = keras.utils.to_categorical(np.random.randint(10, size=(1000, 1)), num_classes=10) x_test = np.random.random((100, 20)) y_test = keras.utils.to_categorical(np.random.randint(10, size=(100, 1)), num_classes=10) model = Sequential() # Dense(64) is a fully-connected layer with 64 hidden units.
Dropout Meaning During learning, some features are immediately removed to avoid over-fitting.
Dropout Layer Source Code dropout layer is in core.py under layer
class Dropout(Layer): '''Applies Dropout to the input. Dropout consists in randomly setting a fraction `p` of input units to 0 at each update during training time, which helps prevent overfitting. # Arguments p: float between 0 and 1. Fraction of the input units to drop.
topic You are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of you take turns to remove 1 to 3 stones. The one who removes the last stone will be the winner. You will take the first turn to remove the stones.
Both of you are very clever and have optimal strategies for the game. Write a function to determine whether you can win the game given the number of stones in the heap.
Here we use cifar10 as our experimental database.First download the TensorFlow Models library to use the classes of CIFAR-10 data provided therein. git clone https://github.com/tensorflow/models.git cd models/tutorials/image/cifar10 Start to Build CNN Network import cifar10 import cifar10_input import tensorflow as tf import numpy as np import time max_steps = 3000 # 训练轮数（每一轮一个batch参与训练）
1、abstract Object findAttribute(String name)
in page, request, session (if valid) and application
Scope (scope) looks for the Attribute named name, and returns the object when it is found, but returns null when it is not found.
2、abstract Object getAttribute(String name)
find the attribute related to name in page scope, return the object if found, and return null if not found.
The difference between the two is that the search range is different.
Use import or from...import to import the corresponding module in python.Modules are actually collection files of some functions and classes. They can realize some corresponding functions. When we need to use these functions, we can directly import the corresponding modules into our programs and then we can use them.This is similar to the include header file in C language. In Python, we use import to import the modules we need.
1. Naive Bayesian
1. Naive Bayesian model originates from classical mathematical theory and has stable classification efficiency.
2. It performs well on small-scale data, can handle multiple classification tasks, and is suitable for incremental training, especially when the amount of data exceeds the memory, we can perform incremental training batch by batch.
3, not too sensitive to missing data, the algorithm is relatively simple, and is often used for text classification.
encoding: In order to facilitate computer processing, digitally processed information is called encoding.
Character Digitization: Character Coding
Color Digitization: Color Coding Unicode
Unicode as an International Standard
Only a number corresponding to each character is defined
Unicode does not say how you want to save a word
Which scheme to choose is a coding method for Unicode, that is, what we just said is " implementation" utf-8: