API

Auto

ChainPlots.chaingraphFunction
chaingraph(m::Flux.Chain)

Return a MetaGraph representing the graph structure of the neural network.

In this case, the first layer must be a layer with fixed input dimension.

See chaingraph for the properties of each node of the graph.

source
ChainPlots.chaingraphMethod
chaingraph(m::Flux.Chain, input_data::Array)

Return a MetaGraph representing the graph structure of the neural network.

Each node represents a neuron of the Chain m and contains the following properties: :layer_number: Int indicating to each layer it belongs ( with 0 indicating the input layer, 1, …, length(m)-1 indicating the hidden layers, and with length(m) indicating the output layer); :layer_type: symbol indicating the layer type it is part of in the Chain (e.g. :Dense, :GRUCell, :Conv, …); :index_in_layer: Tuple indicating the position of the neuron within the layer. The indices cover the size of the layer, which is given by a Tuple, e.g. of the form (n,) for Dense(n,m) and RNN(n,m), or (n₁, …, nₖ,m,d,b) for convolutional layers, and so on; :layer_center: Float64 with the vertical mid-point of the layer it belongs to.

source
ChainPlots.chaingraphMethod
chaingraph(m::Flux.Chain, ldim::Tuple)

Return a MetaGraph representing the graph structure of the neural network with an input of shape ldim.

See chaingraph for the properties of each node of the graph.

source
ChainPlots.chaingraphMethod
chaingraph(l::Union{Flux.Dense,Flux.Recur,Flux.RNNCell,Flux.LSTMCell,Flux.GRUCell})

Return a MetaGraph representing the graph structure of a neural network composed of the single layer l.

source
ChainPlots.get_dimensionsMethod
get_dimensions(m::Flux.Chain, inp::Union{Nothing, Array, Tuple} = nothing)

Return the dimensions of the input and of the output data of each hidden layer.

If input_data is not given, the first layer is required to be a layer with fixed input dimensions, such as Flux.Dense or Flux.Recur, otherwise the given data or shape is used to infer the dimensions of each layer.

source
ChainPlots.neuron_colorMethod
neuron_color(s; neuron_colors = NEURON_COLORS)

Grab the color for each specific type of neuron.

The color depends on the type of layer the neuron belongs to and the colorset given neuron_colors, which defaults to NEURON_COLORS.

source
ChainPlots.neuron_connectionsFunction
neuron_connections(m::Flux.Chain, input_data::Union{Nothing,Array,Tuple} = nothing) -> Vector{Dict{Tuple, Vector{Tuple}}}

Return all the connections from every neuron in each layer to the corresponding neurons in the next layer.

source
ChainPlots.plotchainFunction
plot(m::Flux.Chain, input_data::Union{Nothing,Array,Tuple} = nothing; kargs...)

Plot the topology of Flux.Chain neural network m.

If the first layer accepts an input with arbitrary dimensions, an input_data must be provided, we can be a Vector, an Array, or just a Tuple with the dimensions of the input.

source
ChainPlots.projectionMethod
projection(z, center, max_widths, dimensions)

Transform the indexing of a neuron into its x and y coordinates for plotting.

source
ChainPlots.UnitVectorType
UnitVector{T}

Structure for unit vectors in a linear space

Used for generating a basis to infer the layer connection

source