File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -67,8 +67,8 @@ def from_subscriptable(subscriptable) -> Dataset:
67
67
Create ``Dataset`` based on subscriptable i.e. implements
68
68
``__get_item__``. Should only be used for simple examples as a
69
69
``Dataset`` created with this method does not support methods that
70
- require a source dataframe (i.e. `` Dataset.split` ` and
71
- `` Dataset.subset` `)
70
+ require a source dataframe (i.e. :func:` Dataset.split` and
71
+ :func:` Dataset.subset`)
72
72
'''
73
73
return (
74
74
Dataset .from_dataframe (
@@ -284,7 +284,7 @@ def to_concat(dataset_index, inner_index):
284
284
def concat (datasets : List [Dataset ]) -> Dataset [R ]:
285
285
'''
286
286
Concatenate multiple datasets together so that they behave like a
287
- single dataset. Consider using `` Datastream.merge` ` if you have
287
+ single dataset. Consider using :func:` Datastream.merge` if you have
288
288
multiple data sources.
289
289
'''
290
290
from_concat_mapping = Dataset .create_from_concat_mapping (datasets )
Original file line number Diff line number Diff line change @@ -33,7 +33,8 @@ class Datastream(BaseModel, Generic[T]):
33
33
``Datastream[T]`` combines a ``Dataset[T]`` and a sampler into a stream of
34
34
examples. By default the samples are drawn without replacement until the
35
35
full dataset is exhausted. The proportion of the dataset that should be
36
- drawn before allowing replacement can be changed with ``.sample_proportion``.
36
+ drawn before allowing replacement can be changed with
37
+ :func:`Datastream.sample_proportion`.
37
38
38
39
>>> from datastream import Dataset, Datastream
39
40
>>> data_loader = (
@@ -176,7 +177,7 @@ def sample_proportion(
176
177
proportion : float ,
177
178
) -> Datastream [T ]:
178
179
'''
179
- Create new ``Datastream`` with changed proportion. This changes the
180
+ Create new ``Datastream[T] `` with changed proportion. This changes the
180
181
numbers of drawn samples before restarting sampling with new weights
181
182
and allowing sample replacement.
182
183
@@ -195,7 +196,7 @@ def state_dict(self) -> Dict:
195
196
return dict (sampler = self .sampler .state_dict ())
196
197
197
198
def load_state_dict (self , state_dict : Dict ):
198
- '''Load saved state from `` Datastream.state_dict` `.'''
199
+ '''Load saved state from :func:` Datastream.state_dict`.'''
199
200
return self .sampler .load_state_dict (state_dict ['sampler' ])
200
201
201
202
def multi_sample (self : Datastream [T ], n : int ) -> Datastream [T ]:
You can’t perform that action at this time.
0 commit comments