Skip to content

Instantly share code, notes, and snippets.

View ground0state's full-sized avatar

abetan ground0state

View GitHub Profile
import tensorflow as tf
import keras
from tensorflow.python.keras.datasets import cifar10
from tensorflow.python.keras.utils import to_categorical
from tensorflow.python.keras.models import Sequential
from tensorflow.python.keras.layers import Conv2D, MaxPooling2D, Dropout, Flatten, Dense
from tensorflow.python.keras.callbacks import TensorBoard
(x_train, y_train), (x_test, y_test) = cifar10.load_data()
import tensorflow as tf
(x_train, y_train), (x_test, y_test) = tf.keras.datasets.boston_housing.load_data()
x_train_mean = x_train.mean(axis=0)
x_train_std = x_train.std(axis=0)
y_train_mean = y_train.mean()
y_train_std = y_train.std()
x_train = (x_train-x_train_mean)/x_train_std
@ground0state
ground0state / DNN.py
Last active May 29, 2019 12:26
TensorFlowの基礎の基礎的な書き方
import numpy as np
import tensorflow as tf
from sklearn import datasets
from sklearn.model_selection import train_test_split
from sklearn.utils import shuffle
import matplotlib.pyplot as plt
# シードを設定
np.random.seed(0)