Package org.jetbrains.kotlinx.dl.api.core.layer

Types

InitializerOperation
Link copied to clipboard
data class InitializerOperation(assign: Operand<Float>, initialValue: Operand<Float>)

A class that keeps information which allows to initialize KVariable.

KVariable
Link copied to clipboard
data class KVariable(name: String, shape: Shape, variable: Variable<Float>, initializerOperation: InitializerOperation, regularizer: Regularizer?)

A class that keeps information about a single parameter of the Layer.

Layer
Link copied to clipboard
abstract class Layer(name: String)

Base abstract class for all layers.

NoGradients
Link copied to clipboard
interface NoGradients

Marker interface for layers that has no gradients for graph, described in forward method.

ParametrizedLayer
Link copied to clipboard
interface ParametrizedLayer

Represents a Layer with parameters.

TrainableLayer
Link copied to clipboard
interface TrainableLayer : ParametrizedLayer

Represents a ParametrizedLayer that can be trained.

Functions

freeze
Link copied to clipboard
fun Layer.freeze()

Freezes layer weights, so they won't be changed during training.

initialize
Link copied to clipboard
fun ParametrizedLayer.initialize(session: Session)

Initializes this layers variables using provided initializer operands.

initializeVariables
Link copied to clipboard
fun List<Layer>.initializeVariables(session: Session)

Initializes variables for ParametrizedLayer instances using provided initializer operands.

unfreeze
Link copied to clipboard
fun Layer.unfreeze()

Unfreezes layer weights, allowing to change them during training.

Properties

isTrainable
Link copied to clipboard
val Layer.isTrainable: Boolean

Returns true if this Layer is trainable, false otherwise. Always returns false for layers not implementing TrainableLayer.

paramCount
Link copied to clipboard
val Layer.paramCount: Int

Returns the number of parameters in this layer. If layer is not a ParametrizedLayer, returns zero.

weights
Link copied to clipboard
var Layer.weights: Map<String, Array<*>>

Weights of this layer. Require parent model to be set on the layer.