deepr.examples.movielens.prepros package

Submodules

deepr.examples.movielens.prepros.csv module

CSV Preprocessing for MovieLens.

deepr.examples.movielens.prepros.csv.CSVPrepro(vocab_size, batch_size=512, repeat_size=None, prefetch_size=1, num_parallel_calls=8, num_negatives=None)[source]

CSV Preprocessing for MovieLens.

class deepr.examples.movielens.prepros.csv.RandomNegatives(num_negatives, vocab_size)[source]

Bases: Layer

forward(tensors, mode: Optional[str] = None)

Forward method on one Tensor or a tuple of Tensors.

Parameters:
  • tensors (Union[tf.Tensor, Tuple[tf.Tensor, ...]]) –

    • n_in = 1: one tensor (NOT wrapped in a tuple)

    • n_in > 1: a tuple of tensors

  • mode (str, optional) – Description

Returns:

  • n_out = 1: one tensor (NOT wrapped in a tuple)

  • n_out > 1: a tuple of tensors

Return type:

Union[tf.Tensor, Tuple[tf.Tensor, …]]

class deepr.examples.movielens.prepros.csv.SequenceMask[source]

Bases: Layer

forward(tensors, mode: Optional[str] = None)

Forward method on one Tensor or a tuple of Tensors.

Parameters:
  • tensors (Union[tf.Tensor, Tuple[tf.Tensor, ...]]) –

    • n_in = 1: one tensor (NOT wrapped in a tuple)

    • n_in > 1: a tuple of tensors

  • mode (str, optional) – Description

Returns:

  • n_out = 1: one tensor (NOT wrapped in a tuple)

  • n_out > 1: a tuple of tensors

Return type:

Union[tf.Tensor, Tuple[tf.Tensor, …]]

deepr.examples.movielens.prepros.record module

TF Record Preprocessing for MovieLens.

deepr.examples.movielens.prepros.record.RecordPrepro(min_input_size=3, min_target_size=3, max_input_size=50, max_target_size=50, buffer_size=1024, batch_size=128, repeat_size=None, prefetch_size=1, num_parallel_calls=8)[source]

Default Preprocessing for MovieLens.

class deepr.examples.movielens.prepros.record.SequenceMask[source]

Bases: Layer

forward(tensors, mode: Optional[str] = None)

Forward method on one Tensor or a tuple of Tensors.

Parameters:
  • tensors (Union[tf.Tensor, Tuple[tf.Tensor, ...]]) –

    • n_in = 1: one tensor (NOT wrapped in a tuple)

    • n_in > 1: a tuple of tensors

  • mode (str, optional) – Description

Returns:

  • n_out = 1: one tensor (NOT wrapped in a tuple)

  • n_out > 1: a tuple of tensors

Return type:

Union[tf.Tensor, Tuple[tf.Tensor, …]]

Module contents