Vertex Types

While it is not generally expected that implementations should need to define new vertex types, the existing ones are typically useful for dispatching.

Imported to namespace by

using NaiveNASlib.Extend
NaiveNASlib.InputVertexType
InputVertex

Acts as a source of data to the graph and therefore does not need any input vertices to feed it.

Examples

julia> using NaiveNASlib, NaiveNASlib.Extend

julia> InputVertex(1)
InputVertex(1)

julia> InputVertex("input")
InputVertex(input)
source
NaiveNASlib.CompVertexType
CompVertex
CompVertex(c, ins::AbstractVertex...)
CompVertex(c, ins::AbstractArray{<:AbstractVertex}) =

Maps input from input vertices to output through output = c(input...).

Must have at least one input vertex.

Examples

julia> using NaiveNASlib, NaiveNASlib.Extend

julia> CompVertex(+, InputVertex(1), InputVertex(2))
CompVertex(+, inputs=[InputVertex(1), InputVertex(2)])

julia> CompVertex(x -> 4x, InputVertex(1))(2)
8

julia> CompVertex(*, InputVertex(1), InputVertex(2))(2,3)
6
source
NaiveNASlib.MutationVertexType
MutationVertex

Vertex which may be subject to mutation.

The member trait describes the nature of the vertex itself, for example if size changes are absorbed (e.g changing an nin x nout matrix to an nin - Δ x nout matrix) or if they propagate to neighbouring vertices (and if so, how).

source