abstract class MXNet::Initializer

Overview

The base class of an initializer.

Custom initializers can be created by subclassing Initializer and implementing the required function #init_array. By default, the created initializer will be registered under its simplified class name (class.name.split("::").last.downcase) but it may also be registered under another name by calling #register.

class CustomInit < MXNet::Initializer
  register :myinit
  def init_array(array)
    array[0..-1] = 1.0
  end
end

Direct Known Subclasses

Defined in:

mxnet/initializer.cr

Class Method Summary

Instance Method Summary

Class Method Detail

def self.create(initializer) #

[View source]

Instance Method Detail

abstract def init_array(array : NDArray) #

Override to initialize array.

Parameters

  • array (NDArray) Array to initialize.

[View source]