FluxML/Flux.jl

Functional equivalents missing for some layers

Open

#2.013 geöffnet am 29. Juni 2022

Auf GitHub ansehen
 (3 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Julia (619 Forks)batch import
enhancementgood first issue

Repository-Metriken

Stars
 (4.725 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 4h 27m) (2 gemergte PRs in 30 T)

Beschreibung

As things stand, only some layers in Flux have direct functional equivalents in NNlib - maxpool and meanpool do, for example, while the adaptive versions of those two layers don't. I know that they're only thin wrappers around maxpool and meanpool themselves, but would it be worth having functions that do the forward pass for these layers? While writing wrapper layers in Metalhead.jl it often feels weird to have entire Flux layers described inside of the forward pass of another layer. An example I'm working on right now is adaptive_avgmax_pool, currently written out as:

function adaptive_avgmax_pool(x, output_size = (1, 1))
    x_avg = AdaptiveMeanPool(output_size)(x)
    x_max = AdaptiveMaxPool(output_size)(x)
    return 0.5 * (x_avg + x_max)
end

While this works perfectly fine, it feels kinda odd to have a layer inside of a function which is gonna be wrapped by a layer 😅 (this may just be a side-effect of having worked with torch quite a bit so I'm not sure if this request is justified or not)

Contributor Guide