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

Function normalize

examples/image_processing/deconvolution.cpp:20–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18const float RELAXATION_FACTOR = 0.05f;
19
20array normalize(const array &in) {
21 float mx = max<float>(in.as(f32));
22 float mn = min<float>(in.as(f32));
23 return (in - mn) / (mx - mn);
24}
25
26int main(int argc, char *argv[]) {
27 int device = argc > 1 ? atoi(argv[1]) : 0;

Callers 1

mainFunction · 0.70

Calls 1

asMethod · 0.80

Tested by

no test coverage detected