Skip to content

Instantly share code, notes, and snippets.

@sbugrov
Last active March 10, 2022 12:54
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sbugrov/f58d3b655c318b5ca2b4b4cbe7615257 to your computer and use it in GitHub Desktop.
Save sbugrov/f58d3b655c318b5ca2b4b4cbe7615257 to your computer and use it in GitHub Desktop.
int main(int argc, const char * argv[]) {
for (unsigned i = 0; i != 50; ++i) {
vector<float> pred = sigmoid(dot(X, W, 4, 4, 1 ) );
vector<float> pred_error = y - pred;
vector<float> pred_delta = pred_error * sigmoid_d(pred);
vector<float> W_delta = dot(transpose( &X[0], 4, 4 ), pred_delta, 4, 4, 1);
W = W + W_delta;
};
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment