get_batch#
- gpjax.fit.get_batch(train_data, batch_size, key)[source]#
Batch the data into mini-batches. Sampling is done with replacement.
- Parameters:
- Return type:
Example
>>> import gpjax as gpx >>> import jax.numpy as jnp >>> import jax.random as jr
>>> X = jnp.linspace(0, 1, 100).reshape(-1, 1) >>> y = jnp.sin(X) >>> D = gpx.Dataset(X=X, y=y)
>>> from gpjax.fit import get_batch >>> batch = get_batch(D, batch_size=16, key=jr.key(0))
- Returns:
The batched dataset.
- Return type:
- Parameters:
Expand for references to
gpjax.fit.get_batch