Trait Types
Traits are very useful for reasoning about a vertex without having to look at the wrapped computation.
Imported to namespace by
using NaiveNASlib.Extend
NaiveNASlib.trait
— Functiontrait(v)
Return the MutationTrait
for a vertex v
.
NaiveNASlib.base
— Methodbase(t::DecoratingTrait)
Return the trait wrapped by t
.
NaiveNASlib.MutationTrait
— TypeMutationTrait
Base type for traits relevant when mutating.
NaiveNASlib.DecoratingTrait
— TypeDecoratingTrait <: MutationTrait
Avbstract trait which wraps another trait. The wrapped trait of a DecoratingTrait
t
is accessible through base(t)
.
NaiveNASlib.Immutable
— TypeImmutable
Trait for vertices which are immutable. Typically inputs and outputs as those are fixed to the surroundings (e.g a data set).
NaiveNASlib.MutationSizeTrait
— TypeMutationSizeTrait
Base type for mutation traits relevant to size
NaiveNASlib.SizeAbsorb
— TypeSizeAbsorb
Size trait type for which size changes are absorbed, i.e they do not propagate forward.
Note that size changes do propagate backward as changing the input size of a vertex requires that the output size of its input is also changed and vice versa.
NaiveNASlib.SizeTransparent
— TypeSizeTransparent
Base type for mutation traits which are transparent w.r.t size, i.e size changes propagate both forwards and backwards.
Tip: Use with FixedSizeTrait
if the function has parameters which must be aligned with the input and output sizes.
NaiveNASlib.SizeStack
— TypeSizeStack
Transparent size trait type where inputs are stacked, i.e output size is the sum of all input sizes.
NaiveNASlib.SizeInvariant
— TypeSizeInvariant
Transparent size trait type where all input sizes must be equal to the output size, e.g. elementwise operations (including broadcasted).
NaiveNASlib.FixedSizeTrait
— TypeFixedSizeTrait <: DecoratingTrait
Trait which indicates that a vertex is SizeTransparent
while still having a fixed size.
This prevents NaiveNASlib from inferring the size from neighbouring vertices.
As an example, the function x -> 2 .* x
accepts any size of x
, while the function x -> [1,2,3] .* x
is SizeInvariant
but has a fixed size of 3.
Note that FixedSizeTrait
does not imply that the vertex can't change size.