ai4med.components.optimizers package

class Adam(**args)

Bases: ai4med.components.optimizers.optimizer.Optimizer

Optimizer that implements the Adam algorithm. This uses tf’s AdamOptimizer with details and args information at: https://www.tensorflow.org/api_docs/python/tf/compat/v1/train/AdamOptimizer

get_optimizer(lr)

This is the required method that an optimizer component must implement.

Parameters

lr – the learning rate

Returns

optimizer function

class Momentum(**args)

Bases: ai4med.components.optimizers.optimizer.Optimizer

Optimizer that implements the Momentum algorithm (SGD + momentum). This uses the tf MomentumOptimizer with details and args information at: https://www.tensorflow.org/api_docs/python/tf/compat/v1/train/MomentumOptimizer

get_optimizer(lr)

This is the required method that an optimizer component must implement.

Parameters

lr – the learning rate

Returns

optimizer function

class NovoGrad(**args)

Bases: ai4med.components.optimizers.optimizer.Optimizer

Optimizer that implements the NovoGrad algorithm. Details and args information at: ai4med.libs.optimizers.novograd

get_optimizer(lr)

Returns optimizer function

Parameters

lr – learning rate

Returns: NovoGrad Optimizer function

class Optimizer(**args)

Bases: ai4med.common.graph_component.GraphComponent

Base class of optimizer component.

An optimizer component is also a GraphComponent that builds part of the computation graph.

build(build_ctx: ai4med.common.build_ctx.BuildContext)

A graph building component must implement this method to build parts of the computation graph. While building, this method can use any objects in the build_ctx and put objects into the build_ctx. Therefore, different graph building components can use the build_ctx to share objects.

Parameters

build_ctx (BuildContext) – the build context.

Returns: tensor(s) built

abstract get_optimizer(lr)

This is the required method that an optimizer component must implement.

Parameters

lr – the learning rate

Returns

optimizer function

is_valid_regex(x: str) → bool
© Copyright 2020, NVIDIA. Last updated on Feb 2, 2023.