Skip to content

Commit 37a96c3

Browse files
committed
Merge branch 'fix/v0.21.3' into 'release/v0.21.3'
Release v0.21.3 See merge request ai-lab-pmo/mltools/recsys/RePlay!342
2 parents 1ada66a + 0d21918 commit 37a96c3

36 files changed

Lines changed: 967 additions & 654 deletions

docs/pages/modules/data.rst

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,8 @@ See the full example in `examples/09_sasrec_example.ipynb`.
145145
from replay.data.nn import ParquetModule
146146
from replay.nn.transform.template import make_default_sasrec_transforms
147147
148-
metadata = {
149-
"user_id": {},
150-
"item_id": {"shape": 50, "padding": 51},
151-
}
152-
transforms = make_default_sasrec_transforms(tensor_schema, query_column="user_id")
148+
metadata = {"item_id": {"shape": 50, "padding": 51}}
149+
transforms = make_default_sasrec_transforms(tensor_schema)
153150
parquet_datamodule = ParquetModule(
154151
batch_size=64,
155152
metadata=metadata,

docs/pages/modules/redesigned_nn_models.rst

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ ItemTower
7878
.. autoclass:: replay.nn.sequential.ItemTower
7979
:members: __init__, forward
8080

81+
.. FeaturesReader_:
82+
8183
FeaturesReader
8284
``````````````````````````````
8385

@@ -166,6 +168,11 @@ NumericalEmbedding
166168
.. autoclass:: replay.nn.embedding.NumericalEmbedding
167169
:members: __init__, forward, embedding_dim, weight
168170

171+
IdentityEmbedding
172+
``````````````````
173+
.. autoclass:: replay.nn.embedding.IdentityEmbedding
174+
:members: __init__, forward, embedding_dim, weight
175+
169176

170177
Aggregators
171178
___________
@@ -244,14 +251,38 @@ Transforms for ParquetModule
244251
====================================================
245252

246253
This submodule contains a set of standard PyTorch tensor transformations necessary for neural network models.
247-
These Transforms are intended for use with the :ref:`Parquet-Module`. For applying specify a sequence of transformations for every data split as ParquetModule's ``transforms`` parameter.
248-
Specified transformations will be applied per batch on device, then the resulting batch will be used as model input.
254+
Every Transform (transformation) is a child class of ``torch.nn.Module`` which forward pass takes as input a batch (python dictionary)
255+
and returns a copy of input batch with some applyed transformation.
256+
257+
These Transforms are intended for use with the :ref:`Parquet-Module`. `ParquetModule` object gets transformations via `transforms` parameter.
258+
259+
For passing `transforms` parameter correctly, specify a sequence (a list) of transformations for every used data split, for example:
260+
261+
.. code-block:: python
262+
263+
{
264+
"train": [NextTokenTransform(label_field="item_id", shift=1), ...],
265+
"validate": [...]
266+
}
267+
268+
269+
``ParquetModule`` converts every specified list of transformations into ``torch.nn.Sequential``, which will be applied per batch on device,
270+
then the resulting batch after all transformations will be used as model input.
271+
272+
RePlay provides functions that create a standard set of transformations for models that can also be used as the basis
273+
for custom, more complicated sets of transformations. See :ref:`Standard set of transforms for models <transforms-for-models>`.
274+
249275

250276
CopyTransform
251277
__________________
252278
.. autoclass:: replay.nn.transform.CopyTransform
253279
:members: __init__
254280

281+
EqualityMaskTransform
282+
__________________________
283+
.. autoclass:: replay.nn.transform.EqualityMaskTransform
284+
:members: __init__
285+
255286
GroupTransform
256287
__________________
257288
.. autoclass:: replay.nn.transform.GroupTransform
@@ -282,6 +313,11 @@ __________________
282313
.. autoclass:: replay.nn.transform.TrimTransform
283314
:members: __init__
284315

316+
SelectTransform
317+
______________________
318+
.. autoclass:: replay.nn.transform.SelectTransform
319+
:members: __init__
320+
285321
SequenceRollTransform
286322
______________________
287323
.. autoclass:: replay.nn.transform.SequenceRollTransform
@@ -297,6 +333,9 @@ ____________________________________
297333
.. autoclass:: replay.nn.transform.MultiClassNegativeSamplingTransform
298334
:members: __init__
299335

336+
337+
.. _transforms-for-models:
338+
300339
Standard set of transforms for models
301340
_____________________________________
302341

0 commit comments

Comments
 (0)