Skip to content

Instantly share code, notes, and snippets.

@sbugrov
Created April 21, 2018 22:19
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 sbugrov/57681b9ed32e4b3c3f9f11ff88399f0b to your computer and use it in GitHub Desktop.
Save sbugrov/57681b9ed32e4b3c3f9f11ff88399f0b to your computer and use it in GitHub Desktop.
vector <float> relu(const vector <float>& z){
int size = z.size();
vector <float> output;
for( int i = 0; i < size; ++i ) {
if (z[i] < 0){
output.push_back(0.0);
}
else output.push_back(z[i]);
}
return output;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment