Identity

class Identity(gain: Float) : Initializer

Initializer that generates the identity matrix. This initializer is only usable for generating 2D matrices. Although identity matrices are undefined for non-square matrices an "identity" matrix is generated. E.g. 2 x 3 "identity" matrix ==> [ 1., 0., 0., 0., 1., 0.]

Throws

Constructors

Identity
Link copied to clipboard
fun Identity(gain: Float = 1.0f)

Creates a Identity initializer.

Functions

apply
Link copied to clipboard
fun apply(fanIn: Int, fanOut: Int, tf: Ops, input: Operand<Float>, name: String): InitializerOperation

Adds an Assign Op to the graph to initialize a tensorflow variable as specified by the initializer.

initialize
Link copied to clipboard
open override fun initialize(fanIn: Int, fanOut: Int, tf: Ops, shape: Operand<Int>, name: String): Operand<Float>

Returns a Tensor object initialized as specified by the initializer.

toString
Link copied to clipboard
open override fun toString(): String

Properties

gain
Link copied to clipboard
val gain: Float = 1.0f

Identity matrix is multiply by this factor