Skip to content

Instantly share code, notes, and snippets.

@sidneyarcidiacono
Last active May 17, 2021 20:45
Show Gist options
  • Save sidneyarcidiacono/afaeb2f94765300f029b112886e7b435 to your computer and use it in GitHub Desktop.
Save sidneyarcidiacono/afaeb2f94765300f029b112886e7b435 to your computer and use it in GitHub Desktop.
Batch loading with Spektral
# Here's the trick - we can't just call Keras' fit() method on this model.
# Instead, we have to use Loaders, which Spektral walks us through. Loaders create mini-batches by iterating over the graph
# Since we're using Spektral for an experiment, for our first trial we'll use the recommended loader in the getting started tutorial
# TODO: read up on modes and try other loaders later
from spektral.data import BatchLoader
loader = BatchLoader(data_train, batch_size=32)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment