Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor fixes to the Random Deletion Layer #286

Merged
merged 1 commit into from
Aug 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion keras_nlp/layers/random_deletion.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class RandomDeletion(keras.layers.Layer):
indicates that should not be considered a candidate for deletion.
Unlike the `skip_fn` argument, this argument need not be
tracable--it can be any python function.
seed: A seed for the rng.
seed: A seed for the random number generator.

Examples:

Expand Down
2 changes: 2 additions & 0 deletions keras_nlp/layers/random_deletion_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ def skip_py_fn(word):
output = tf.strings.reduce_join(augmented, separator=" ", axis=-1)
self.assertAllEqual(output.shape, tf.convert_to_tensor(inputs).shape)
exp_output = [b"Hey like", b"Keras Tensorflow"]
for i in range(output.shape[0]):
self.assertAllEqual(output[i], exp_output[i])

def test_get_config_and_from_config(self):
augmenter = random_deletion.RandomDeletion(
Expand Down