Vertex Creation
The functions added by NaiveNASflux are basically Flux-tailored convenience wrappers around those exported by NaiveNASlib.
NaiveNASflux.denseinputvertex
— Functiondenseinputvertex(name, size)
Return an input type vertex with the given name
which promises 2D shaped input with size
number of features suitable for e.g. Flux
s Dense
layer.
Providing the input type is not strictly necessary for the package to work and in many cases a normal inputvertex
will do.
One example of when it is useful is the concat
function which needs to know the input type to automatically determine which dimension to concatenate.
NaiveNASflux.rnninputvertex
— Functionrnninputvertex(name, size)
Return an input type vertex with the given name
which promises 2D shaped input with size
number of features suitable for Flux
s recurrent layers.
Providing the input type is not strictly necessary for the package to work and in many cases a normal inputvertex
will do.
One example of when it is useful is the concat
function which needs to know the input type to automatically determine which dimension to concatenate.
NaiveNASflux.conv1dinputvertex
— Functionconv1dinputvertex(name, nchannel)
Return an input type vertex with the given name
which promises convolution shaped input with nchannel
channels suitable for Flux
s convolution layers.
Equivalent to convinputvertex(name, nchannel, 1)
.
Providing the input type is not strictly necessary for the package to work and in many cases a normal inputvertex
will do.
One example of when it is useful is the concat
function which needs to know the input type to automatically determine which dimension to concatenate.
NaiveNASflux.conv2dinputvertex
— Functionconv2dinputvertex(name, nchannel)
Return an input type vertex with the given name
which promises convolution shaped input with nchannel
channels suitable for Flux
s convolution layers.
Equivalent to convinputvertex(name, nchannel, 2)
.
Providing the input type is not strictly necessary for the package to work and in many cases a normal inputvertex
will do.
One example of when it is useful is the concat
function which needs to know the input type to automatically determine which dimension to concatenate.
NaiveNASflux.conv3dinputvertex
— Functionconv3dinputvertex(name, nchannel)
Return an input type vertex with the given name
which promises convolution shaped input with nchannel
channels suitable for Flux
s convolution layers.
Equivalent to convinputvertex(name, nchannel, 3)
.
Providing the input type is not strictly necessary for the package to work and in many cases a normal inputvertex
will do.
One example of when it is useful is the concat
function which needs to know the input type to automatically determine which dimension to concatenate.
NaiveNASflux.convinputvertex
— Functionconvinputvertex(name, nchannel, ndim)
Return an input type vertex with the given name
which promises convolution shaped input with nchannel
channels and ndim
number of dimensions for feature maps (e.g. 2 for images) suitable for Flux
s convolution layers.
Providing the input type is not strictly necessary for the package to work and in many cases a normal inputvertex
will do.
One example of when it is useful is the concat
function which needs to know the input type to automatically determine which dimension to concatenate.
NaiveNASflux.fluxvertex
— Functionfluxvertex(l, in::AbstractVertex; layerfun=LazyMutable, traitfun=validated())
Return a vertex which wraps the layer l
and has input vertex in
.
Keyword argument layerfun
can be used to wrap the computation, e.g. in an ActivationContribution
.
Keyword argument traitfun
can be used to wrap the MutationTrait
of the vertex in a DecoratingTrait
fluxvertex(name::AbstractString, l, in::AbstractVertex; layerfun=LazyMutable, traitfun=validated())
Return a vertex with name name
which wraps the layer l
and has input vertex in
.
Name is only used when displaying or logging and does not have to be unique (although it probably is a good idea).
Keyword argument layerfun
can be used to wrap the computation, e.g. in an ActivationContribution
.
Keyword argument traitfun
can be used to wrap the MutationTrait
of the vertex in a DecoratingTrait
NaiveNASflux.concat
— Functionconcat(v::AbstractVertex, vs::AbstractVertex...; traitfun=identity, layerfun=identity)
Return a vertex which concatenates input along the activation (e.g. channel if convolution, first dimension if dense) dimension.
Inputs must have compatible activation shapes or an exception will be thrown.
Keyword argument layerfun
can be used to wrap the computation, e.g. in an ActivationContribution
.
Keyword argument traitfun
can be used to wrap the MutationTrait
of the vertex in a DecoratingTrait
See also NaiveNASlib.conc
.
concat(name::AbstractString, v::AbstractVertex, vs::AbstractVertex...; traitfun=identity, layerfun=identity)
Return a vertex with name name
which concatenates input along the activation (e.g. channel if convolution, first dimension if dense) dimension.
Name is only used when displaying or logging and does not have to be unique (although it probably is a good idea).
Inputs must have compatible activation shapes or an exception will be thrown.
Keyword argument layerfun
can be used to wrap the computation, e.g. in an ActivationContribution
.
Keyword argument traitfun
can be used to wrap the MutationTrait
of the vertex in a DecoratingTrait
See also NaiveNASlib.conc
.