chemprop.data.dataloader
========================

.. py:module:: chemprop.data.dataloader


Attributes
----------

.. autoapisummary::

   chemprop.data.dataloader.logger


Functions
---------

.. autoapisummary::

   chemprop.data.dataloader.build_dataloader


Module Contents
---------------

.. py:data:: logger

.. py:function:: build_dataloader(dataset, batch_size = 64, num_workers = 0, class_balance = False, seed = None, shuffle = True, drop_last = None, **kwargs)

   Return a :obj:`~torch.utils.data.DataLoader` for :class:`MolGraphDataset`\s

   :param dataset: The dataset containing the molecules or reactions to load.
   :type dataset: MoleculeDataset | ReactionDataset | MulticomponentDataset
   :param batch_size: the batch size to load.
   :type batch_size: int, default=64
   :param num_workers: the number of workers used to build batches.
   :type num_workers: int, default=0
   :param class_balance: Whether to perform class balancing (i.e., use an equal number of positive and negative
                         molecules). Class balance is only available for single task classification datasets. Set
                         shuffle to True in order to get a random subset of the larger class.
   :type class_balance: bool, default=False
   :param seed: the random seed to use for shuffling (only used when `shuffle` is `True`).
   :type seed: int, default=None
   :param shuffle: whether to shuffle the data during sampling.
   :type shuffle: bool, default=True
   :param drop_last: Whether to drop the last batch if it is of size 1 (needed if using batchnorm during training).
                     If None, this will be set automatically.
   :type drop_last: bool, default=None


