homework for CS231n
observerspy / cs231n Goto Github PK
View Code? Open in Web Editor NEWhomework for CS231n 2017
homework for CS231n 2017
Hello,
About assignment1: knn.ipynb
X_tr = np.vstack(X_train_folds[0:j] + X_train_folds[j+1:])
y_tr = np.hstack(y_train_folds[0:j] + y_train_folds[j+1:])
why use differnt stack function?
Thank you.
it is right.
def predict(self, X):
"""
Use the trained weights of this linear classifier to predict labels for
data points.
Inputs:
- X: D x N array of training data. Each column is a D-dimensional point.
Returns:
- y_pred: Predicted labels for the data in X. y_pred is a 1-dimensional
array of length N, and each element is an integer giving the predicted
class.
"""
y_pred = np.zeros(X.shape[1])
but in your assignment1/svm.ipynb:
y_train_pred = svm.predict(X_train)
print ('training accuracy: %f' % (np.mean(y_train == y_train_pred), ))
y_val_pred = svm.predict(X_val)
print ('validation accuracy: %f' % (np.mean(y_val == y_val_pred), ))
this time the shape of X_train is (N, D), therefor y_pred will be (D, )?
FURTHERMORE:
the next step you do :
y_pred = np.argmax(X.dot(self.W), axis=1)
totally changed the shape of y_pred to (N,)
SO , WHY you add the line:
y_pred = np.zeros(X.shape[1])
thanks a lot ! you code and annotation really illuminated me !
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.