Skip to content

Instantly share code, notes, and snippets.

@adash333
Created July 20, 2017 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adash333/224665f48fedb4686da8fd2c3df3f522 to your computer and use it in GitHub Desktop.
Save adash333/224665f48fedb4686da8fd2c3df3f522 to your computer and use it in GitHub Desktop.
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
rng = np.random.RandomState(123)
d = 2 # データの次元
N = 10 # 各パターンのデータ数
mean = 5 # ニューロンが発火するデータの平均値
x1 = rng.randn(N, d) + np.array([0, 0])
x2 = rng.randn(N, d) + np.array([mean, mean])
x = np.concatenate((x1, x2), axis = 0)
# matplotlibで描画
x1_x, x1_y, x2_x, x2_y = [], [], [], []
for i in range(N):
x1_x.append(x1[i][0])
x1_y.append(x1[i][1])
x2_x.append(x2[i][0])
x2_y.append(x2[i][1])
print(x1_x)
print(x1_y)
plt.plot(x1_x, x1_y,"o")
plt.plot(x2_x, x2_y,"^")
plt.xlim([-4,8])
plt.ylim([-6,12])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment