arrayfire / arrayfire-ml

ArrayFire's Machine Learning Library.
BSD 3-Clause "New" or "Revised" License
102 stars 23 forks source link

First attempt at ReLU #31

Closed plavin closed 7 years ago

plavin commented 7 years ago

I'm getting a segfault when I run this, haven't figured out why yet. I'll look more later.

Error:

libc++abi.dylib: terminating with uncaught exception of type af::exception: ArrayFire Exception (Input types are not the same:205):
In function af_err af_matmul(af_array *, const af_array, const af_array, const af_mat_prop, const af_mat_prop)
In file src/api/c/blas.cpp:133
Type mismatch inputs

In function af::array af::matmulNT(const af::array &, const af::array &)
In file src/api/cpp/blas.cpp:28
Abort trap: 6
pavanky commented 7 years ago

@plavin Instead of having a autograd::relu function, it is better to implement an autograd::max function.

You can then call autograd::max(var, 0) from nn::Relu::forward