class MicroGrad::Layer(T, N)

Overview

A single layer in the neural network, specified using the T data type and N neuron

Included Modules

Defined in:

micrograd/nn.cr

Constructors

Instance Method Summary

Instance methods inherited from module MicroGrad::Common(T)

activate!(inputs) activate!, parameters : Array(Value(T)) parameters, to_s(io) to_s, zero_grad! zero_grad!

Constructor Detail

def self.new(num_inputs, num_outputs) #

Create a layer with num_inputs and num_outputs


[View source]

Instance Method Detail

def activate!(inputs) #

Activate the neuron, layer or network with the given inputs


[View source]
def neurons : Array(N) #

[View source]
def parameters : Array(Value(T)) #

Retrieve references to all the parameters as an array


[View source]
def to_s(io) #

Prints a concise string representation, typically intended for users, to io


[View source]