garage.tf.optimizers.utils

Utilities for TensorFlow optimizers.

sliced_fun(f, n_slices)

Divide function f’s inputs into several slices.

Evaluate f on those slices, and then average the result. It is useful when memory is not enough to process all data at once. Assume: 1. each of f’s inputs is iterable and composed of multiple “samples” 2. outputs can be averaged over “samples”

class LazyDict(**kwargs)

An immutable, lazily-evaluated dict.

get(self, key, default=None)

Implement dict.get.

set(self, key, value)

Implement dict.set.