Predict based on given parameters
| 33 | |
| 34 | // Predict based on given parameters |
| 35 | array predict(const array &X, const array &Weights) { |
| 36 | array Z = matmul(X, Weights); |
| 37 | array EZ = exp(Z); |
| 38 | array nrm = sum(EZ, 1); |
| 39 | return batchFunc(EZ, nrm, divide); |
| 40 | } |
| 41 | |
| 42 | void cost(array &J, array &dJ, const array &Weights, const array &X, |
| 43 | const array &Y, double lambda = 1.0) { |
no test coverage detected