Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
FayazRahman committed Sep 15, 2023
1 parent 9cade19 commit 4461304
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
18 changes: 10 additions & 8 deletions deeplake/core/seed.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,32 +15,34 @@ def seed(self, seed: Optional[int] = None):
"""Set random seed to the deeplake engines
Args:
seed (int, optional): Integer seed for initializing the computational engines, used for bringing reproducibility to random operations. Set to None to reset the seed. Defaults to None.
seed (int, optional): Integer seed for initializing the computational engines, used for bringing reproducibility to random operations.
Set to ``None`` to reset the seed. Defaults to ``None``.
Raises:
TypeError: If the provided value type is not supported.
Background
----------
Specify a seed to train models and run randomized Deep Lake operations reproducibly. Feature affected are:
Specify a seed to train models and run randomized Deep Lake operations reproducibly. Features affected are:
- dataloader shuffling
- Dataloader shuffling
- Sampling and random operations in Tensor Query Language (TQL)
- ``dataset.random_split``
- :meth:`Dataset.random_split <deeplake.core.dataset.Dataset.random_split>`
The random seed can be specified using :meth:`deeplake.random.seed`::
The random seed can be specified using ``deeplake.random.seed``:
import deeplake
deeplake.random.seed(0)
>>> import deeplake
>>> deeplake.random.seed(0)
Random number generators in other libraries
-------------------------------------------
The Deep Lake random seed does not affect random number generators in other libraries such as ``numpy``.
However, seeds in other libraries will affect code where Deep Lake uses those libraries, but it will not impact the methods above where Deep Lake uses its internal seed.
However, seeds in other libraries will affect code where Deep Lake uses those libraries, but it will not impact
the methods above where Deep Lake uses its internal seed.
"""
if seed is None or isinstance(seed, int):
Expand Down
1 change: 1 addition & 0 deletions docs/source/Datasets.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ Dataset Operations
Dataset.flush
Dataset.clear_cache
Dataset.size_approx
Dataset.random_split

Dataset Visualization
~~~~~~~~~~~~~~~~~~~~~
Expand Down

0 comments on commit 4461304

Please sign in to comment.