neuralogic.nn.optim package

Subpackages

Submodules

neuralogic.nn.optim.adam module

class Adam(lr: float = 0.001, betas: tuple[float, float] = (0.9, 0.999), eps: float = 1e-08, lr_decay: LRDecay | None = None)[source]

Bases: Optimizer

Adam optimizer. It implements the Adaptive Moment Estimation (Adam) algorithm.

property betas: tuple[float, float]
property eps: float
initialize() Any[source]

Initializes the Java representation of the Adam optimizer.

Returns:

The Java optimizer object.

Return type:

Any

neuralogic.nn.optim.optimizer module

class Optimizer(lr: float, lr_decay: LRDecay | None = None)[source]

Bases: object

Base class for all optimizers. Optimizers are used to update the weights of the neural network during training.

get_lr_decay() Any | None[source]

Initializes and returns the learning rate decay object.

Returns:

The Java learning rate decay object, or None if no decay is set.

Return type:

Any

initialize() Any[source]

Initializes the Java representation of the optimizer.

Returns:

The Java optimizer object.

Return type:

Any

property lr: float

Returns the current learning rate.

Returns:

Current learning rate.

Return type:

float

name() str[source]

neuralogic.nn.optim.sgd module

class SGD(lr: float = 0.1, lr_decay: LRDecay | None = None)[source]

Bases: Optimizer

Stochastic Gradient Descent (SGD) optimizer.

initialize() Any[source]

Initializes the Java representation of the SGD optimizer.

Returns:

The Java optimizer object.

Return type:

Any

Module contents

class Adam(lr: float = 0.001, betas: tuple[float, float] = (0.9, 0.999), eps: float = 1e-08, lr_decay: LRDecay | None = None)[source]

Bases: Optimizer

Adam optimizer. It implements the Adaptive Moment Estimation (Adam) algorithm.

property betas: tuple[float, float]
property eps: float
initialize() Any[source]

Initializes the Java representation of the Adam optimizer.

Returns:

The Java optimizer object.

Return type:

Any

class Optimizer(lr: float, lr_decay: LRDecay | None = None)[source]

Bases: object

Base class for all optimizers. Optimizers are used to update the weights of the neural network during training.

get_lr_decay() Any | None[source]

Initializes and returns the learning rate decay object.

Returns:

The Java learning rate decay object, or None if no decay is set.

Return type:

Any

initialize() Any[source]

Initializes the Java representation of the optimizer.

Returns:

The Java optimizer object.

Return type:

Any

property lr: float

Returns the current learning rate.

Returns:

Current learning rate.

Return type:

float

name() str[source]
class SGD(lr: float = 0.1, lr_decay: LRDecay | None = None)[source]

Bases: Optimizer

Stochastic Gradient Descent (SGD) optimizer.

initialize() Any[source]

Initializes the Java representation of the SGD optimizer.

Returns:

The Java optimizer object.

Return type:

Any