“Логистическая регрессия с примером Python нейронной сети Python” Ответ

Логистическая регрессия с примером Python нейронной сети Python

sigmoid([0, 2]) = [ 0.5         0.88079708]
Tense Termite

Логистическая регрессия с примером Python нейронной сети Python

- a training set of m_train images labeled as cat (y=1) or non-cat (y=0)
- a test set of m_test images labeled as cat or non-cat
- each image is of shape (num_px, num_px, 3) where 3 is for the 3 channels (RGB). Thus, each image is square (height = num_px) and (width = num_px).

Tense Termite

Логистическая регрессия с примером Python нейронной сети Python

- m_train (number of training examples)
- m_test (number of test examples)
- num_px (= height = width of a training image)
Tense Termite

Логистическая регрессия с примером Python нейронной сети Python

X_flatten = X.reshape(X.shape[0], -1).T      # X.T is the transpose of X
Tense Termite

Логистическая регрессия с примером Python нейронной сети Python

train_set_x = train_set_x_flatten/255.
test_set_x = test_set_x_flatten/255.
Tense Termite

Логистическая регрессия с примером Python нейронной сети Python

import numpy as np
import matplotlib.pyplot as plt
import h5py
import scipy
from PIL import Image
from scipy import ndimage

%matplotlib inline
Tense Termite

Логистическая регрессия с примером Python нейронной сети Python

print ("sigmoid([0, 2]) = " + str(sigmoid(np.array([0,2]))))
Tense Termite

Логистическая регрессия с примером Python нейронной сети Python

# Loading the data (cat/non-cat)
train_set_x_orig, train_set_y, test_set_x_orig, test_set_y, classes = load_dataset()
Tense Termite

Логистическая регрессия с примером Python нейронной сети Python

dim = 2
w, b = initialize_with_zeros(dim)
print ("w = " + str(w))
print ("b = " + str(b))
Tense Termite

Логистическая регрессия с примером Python нейронной сети Python

y = [1], it's a 'cat' picture.
Tense Termite

Ответы похожие на “Логистическая регрессия с примером Python нейронной сети Python”

Вопросы похожие на “Логистическая регрессия с примером Python нейронной сети Python”

Больше похожих ответов на “Логистическая регрессия с примером Python нейронной сети Python” по Python

Смотреть популярные ответы по языку

Смотреть другие языки программирования