For the complete documentation index, see llms.txt. This page is also available as Markdown.

Parameter Spaces

Parameter space types for Arbiter hyperparameter search — continuous, integer, discrete, boolean, fixed, and composite spaces.

Overview

A ParameterSpace<T> defines the set of valid values for a single hyperparameter. Arbiter uses parameter spaces to sample candidate configurations during random search, or to enumerate all combinations during grid search.

All parameter spaces are in the arbiter-core module and live under org.deeplearning4j.arbiter.optimize.parameter.


Primitive Parameter Spaces

ContinuousParameterSpace

[source]

Defines a continuous range of double values with a uniform distribution between a minimum and maximum.

// Uniform in [0.0001, 0.01]
ParameterSpace<Double> learningRate = new ContinuousParameterSpace(0.0001, 0.01);

Constructor:

ContinuousParameterSpace(double min, double max)

Usage in layer builder:

new DenseLayerSpace.Builder()
    .l2(new ContinuousParameterSpace(1e-6, 1e-3))
    .build();

For scale-sensitive hyperparameters like learning rate, consider LogUniformDistribution which is more likely to sample values across orders of magnitude evenly. ContinuousParameterSpace samples uniformly in linear space, which over-samples the high end.


IntegerParameterSpace

[source]

Defines an integer range with a uniform distribution.

Constructor:

Min and max are both inclusive.

Accessor methods:


DiscreteParameterSpace

[source]

Defines an unordered set of discrete values. The search strategy samples uniformly from the set.

Constructor:

The type parameter T can be any Java object, including arrays:

With custom loss functions:


BooleanSpace

[source]

Samples true or false with equal probability. Internally, the space maps from a continuous value: values <= 0.5 map to true, values > 0.5 map to false.

Usage:


FixedValue

[source]

A ParameterSpace that always returns the same value. Useful for mixing fixed and variable hyperparameters in the same builder, or for locking a parameter that you want to exclude from the search:

Constructor:


Composite Parameter Spaces

MathOp

[source]

Applies a scalar mathematical operation to another parameter space. This allows you to derive one hyperparameter as a function of another.

Available operations (MathOp.Op):

Op
Description

ADD

result = space + scalar

SUB

result = space - scalar

MUL

result = space * scalar

DIV

result = space / scalar

MOD

result = space % scalar

The scalar is always on the right-hand side. The space value and the scalar must have compatible types.

Full example:

When a candidate is generated, firstLayerSize is sampled once and secondLayerSize is derived from it deterministically. All candidates will satisfy the relationship secondLayerSize = 2 * firstLayerSize.


PairMathOp

[source]

Applies a mathematical operation to two independent parameter spaces. This allows you to create a derived parameter from two sampled values.

Available operations (PairMathOp.Op): ADD, SUB, MUL, DIV, MOD.


Updater Spaces

Arbiter provides updater-specific spaces in org.deeplearning4j.arbiter.optimize.parameter.updater (and org.deeplearning4j.arbiter.conf.updater). These allow the optimizer itself to be part of the hyperparameter search.

AdamSpace

SgdSpace

NesterovSpace

RmsPropSpace

Use DiscreteParameterSpace to include the updater choice itself in the search:


How Arbiter Samples Parameter Spaces

All parameter spaces ultimately map a double[] input (sampled uniformly from [0, 1]) to a concrete value. The mapping varies by space type:

Space
Mapping

ContinuousParameterSpace

min + input[0] * (max - min)

IntegerParameterSpace

(int)(min + input[0] * (max - min + 1)) clamped to [min, max]

DiscreteParameterSpace

values[(int)(input[0] * values.length)]

BooleanSpace

input[0] <= 0.5

FixedValue

always returns the stored value

MathOp

samples the inner space, then applies the operation

For random search, the double[] inputs are drawn uniformly. For grid search, they are enumerated at the specified discretizationCount steps.


Implementing a Custom ParameterSpace

You can implement ParameterSpace<T> to support domain-specific sampling logic:

Usage:


Last updated

Was this helpful?