[Numpy-discussion] ENH: softmax
Marten van Kerkwijk
m.h.vankerkwijk at gmail.com
Wed Mar 14 14:01:18 EDT 2018
On Wed, Mar 14, 2018 at 9:44 AM, Hameer Abbasi
<einstein.edison at gmail.com> wrote:
> I possible, write it as a `gufunc`, so duck arrays can override with
> `__array_ufunc__` if
>
> necessary. -- Marten
>
> Softmax is a very simple combination of elementary `ufunc`s with two inputs,
> the weight vector `w` and the data `x`. Writing it as a `gufunc` would be
> going overboard, IMO. Writing it as a combination of `ufunc`s and avoiding
> Numpy-specific stuff should be good enough.
My mistake - I thought the result was reduced, but you only need a
reduction along the way. Writing this in terms of standard functions
is certainly fine!
-- Marten
More information about the NumPy-Discussion
mailing list