Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- vector<vector<float>> dotProduct (vector<vector<float>> inputs, vector<vector<float>> weights, vector<float> biases) {
- short col_count = inputs.size();
- vector<vector<float>> output (col_count);
- for(short i = 0; i < col_count; ++i){
- short row_count = inputs[i].size();
- output[i].resize(row_count);
- for(short k = 0; k < row_count; ++k){
- output[i][k] = inputs[i][k] * weights[i][k] + biases[i];
- }
- }
- return output;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement