Skip to content

Instantly share code, notes, and snippets.

@Sentdex
Created May 14, 2020 15:22
Show Gist options
  • Save Sentdex/454cb20ec5acf0e76ee8ab8448e6266c to your computer and use it in GitHub Desktop.
Save Sentdex/454cb20ec5acf0e76ee8ab8448e6266c to your computer and use it in GitHub Desktop.
create_data
#https://cs231n.github.io/neural-networks-case-study/
def spiral_data(points, classes):
X = np.zeros((points*classes, 2))
y = np.zeros(points*classes, dtype='uint8')
for class_number in range(classes):
ix = range(points*class_number, points*(class_number+1))
r = np.linspace(0.0, 1, points) # radius
t = np.linspace(class_number*4, (class_number+1)*4, points) + np.random.randn(points)*0.2
X[ix] = np.c_[r*np.sin(t*2.5), r*np.cos(t*2.5)]
y[ix] = class_number
return X, y
@XdoxAlex3
Copy link

SKY NET IS COMING

@Hipposhark
Copy link

epicccc

@xiaoyanLi629
Copy link

llollllllllllllll

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment