Question
# create the data Nclass = 500 D = 2 # dimensionality of input M = 3 # hidden layer size K = 3 #
# create the data Nclass = 500 D = 2 # dimensionality of input M = 3 # hidden layer size K = 3 # number of classes
X1 = np.random.randn(Nclass, D) + np.array([0, -2]) X2 = np.random.randn(Nclass, D) + np.array([2, 2]) X3 = np.random.randn(Nclass, D) + np.array([-2, 2]) X = np.vstack([X1, X2, X3])
Y = np.array([0]*Nclass + [1]*Nclass + [2]*Nclass) N = len(Y) # turn Y into an indicator matrix for training T = np.zeros((N, K)) for i in range(N): T[i, Y[i]] = 1
After T = np.zeros((N, K)) for i in range(N): T[i, Y[i]] = 1 step: What would t look like?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started