MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / predict

Function predict

examples/machine_learning/softmax_regression.cpp:35–40  ·  view source on GitHub ↗

Predict based on given parameters

Source from the content-addressed store, hash-verified

33
34// Predict based on given parameters
35array 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
42void cost(array &J, array &dJ, const array &Weights, const array &X,
43 const array &Y, double lambda = 1.0) {

Callers 3

costFunction · 0.70
logit_demoFunction · 0.70

Calls 4

expFunction · 0.85
batchFuncFunction · 0.85
matmulFunction · 0.50
sumFunction · 0.50

Tested by

no test coverage detected