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

TensorFlow 2.6 upgrade #1565

Merged
merged 66 commits into from
Dec 6, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
66e5d3c
Change TF and Cuda versions
anargyri Sep 22, 2021
3396f2c
Fix numpy version
anargyri Sep 27, 2021
153099e
Explain numpy version
anargyri Sep 27, 2021
d67955e
Merge branch 'staging' into andreas/tf
anargyri Oct 7, 2021
b572bbe
Merge branch 'staging' into andreas/tf
anargyri Oct 11, 2021
e8bc100
Merge branch 'staging' into andreas/tf
anargyri Oct 11, 2021
68af516
Specify no-binary install for Surprise
anargyri Oct 11, 2021
aafbe1a
Update CUDA version
anargyri Oct 11, 2021
899b43a
Modifications made by tf_upgrade_v2 script provided by TF + fix for i…
anargyri Oct 12, 2021
cb60a2f
Modifications made by tf_upgrade_v2 script provided by TF + fix for i…
anargyri Oct 12, 2021
9f39411
Replace tf.contrib.estimator.build_supervised_input_receiver_fn_from_…
anargyri Oct 12, 2021
edf9b4c
Fix tf_utils
anargyri Oct 13, 2021
a98750b
Merge branch 'andreas/tf' of github.com:microsoft/recommenders into a…
anargyri Oct 13, 2021
10cd5a7
reapply TF2
anargyri Oct 13, 2021
e1560f9
Fix wide and deep tuning notebook
anargyri Oct 13, 2021
d2b03b7
Replace tf.contrib.training.HParams with custom class
anargyri Oct 18, 2021
2efcac0
Fix DKN model
anargyri Oct 19, 2021
e5ec621
Fix XDeepFM hparams
anargyri Oct 19, 2021
f3d0437
Fix tf version
anargyri Oct 20, 2021
ba702e5
Replace tf.logging in notebooks
anargyri Oct 20, 2021
1b83ffe
Fix tf.summary in notebook
anargyri Oct 20, 2021
d258bfe
Hparams for newsrec
anargyri Oct 20, 2021
1d1b211
Fix LSTUR run
anargyri Oct 25, 2021
f205d15
Replace batch_dot with einsum in self attention layer
anargyri Oct 25, 2021
df7ed26
Change Adam in RBM
anargyri Oct 25, 2021
c29bc41
Fix RNNs
anargyri Oct 26, 2021
de2b3f7
Remove TF addons
anargyri Oct 27, 2021
f5d28e4
Remove LazyAdam optimizer
anargyri Oct 28, 2021
b6ceeec
Fix RNN cells import
anargyri Oct 28, 2021
68979f1
Fix sum.py
anargyri Oct 28, 2021
06c93ba
Fix asserts
anargyri Oct 28, 2021
0e57c04
Get fully connected layer from tf-slim
anargyri Oct 28, 2021
26eb236
Update conda script
anargyri Oct 28, 2021
2fd0726
Merge branch 'staging' into andreas/tf
anargyri Oct 29, 2021
6f1d85e
Remove pip installation cell from VAE notebooks
anargyri Oct 29, 2021
774c8eb
Changes required for pymanopt
anargyri Nov 2, 2021
93fb27b
Remove inference from SLIRec notebook
anargyri Nov 4, 2021
1d94f13
Update TF version in notebooks
anargyri Nov 4, 2021
8503c51
Replace pytorch location for cuda 11
anargyri Nov 8, 2021
a743eba
Add no binary pip install option in ADO test pipeline
anargyri Nov 9, 2021
7d36296
Changed version to 1.0.0
anargyri Nov 9, 2021
d5491b7
Edit nvidia docker image name
anargyri Nov 11, 2021
f325a2c
Java version for virtual env
anargyri Nov 11, 2021
11e4c86
Resolved flake8 issues and blacked
anargyri Nov 11, 2021
a8e316d
Whitespace
anargyri Nov 11, 2021
1f9c24a
Add keras in setup.py
anargyri Nov 11, 2021
bd32d2f
Fix Surprise issue in test environments
anargyri Nov 15, 2021
fde38fb
Undo 'Fix Surprise issue in test environments'
anargyri Nov 16, 2021
679d50c
Change heading in sequential notebook
anargyri Nov 16, 2021
7688dc1
Move pandera to core dependencies in order to fix movielens
anargyri Nov 16, 2021
2523447
Fix issue with RLRMC test
anargyri Nov 16, 2021
3ef366a
Remove numpy 1.19 from GitHub workflows
anargyri Nov 17, 2021
ecff395
Fix mock movielens duplicates
anargyri Nov 19, 2021
dd0b29e
Fix mock movielens test
anargyri Nov 24, 2021
8f32dda
Add blank line
anargyri Nov 24, 2021
23ae6e0
Move surprise to experimental
anargyri Nov 26, 2021
55a8199
Update tests and docs for experimental
anargyri Nov 29, 2021
383c475
Update CI tests
anargyri Nov 30, 2021
5c18fb6
Update GitHb actions
anargyri Nov 30, 2021
dfc8eac
No binary option in tox.ini
anargyri Nov 30, 2021
1dc5d5c
Remove experimental from GitHub actions
anargyri Nov 30, 2021
292f139
Disable experimental tests from workflow
anargyri Nov 30, 2021
2bce47a
Wrap surprise import in test
anargyri Nov 30, 2021
2eb8f93
Fix bug in tf_utils
anargyri Nov 30, 2021
bfbb4b0
Ignore coverage errors while reading from source files
anargyri Dec 6, 2021
3eae4b1
Merge branch 'staging' into andreas/tf
anargyri Dec 6, 2021
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
23 changes: 16 additions & 7 deletions recommenders/datasets/movielens.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
pass # so the environment without spark doesn't break

import pandera as pa
import pandera.extensions as extensions
from pandera import Field
from pandera.typing import Series

Expand Down Expand Up @@ -575,6 +576,11 @@ def extract_movielens(size, rating_path, item_path, zip_path):
shutil.copyfileobj(zf, f)


# For more information on data synthesis, see https://pandera.readthedocs.io/en/latest/data_synthesis_strategies.html
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awesome! ❤️

@extensions.register_check_method(statistics=["columns"], supported_types=pd.DataFrame)
def unique_columns(df, *, columns):
return not df[columns].duplicated().any()

class MockMovielensSchema(pa.SchemaModel):
"""
Mock dataset schema to generate fake data for testing purpose.
Expand All @@ -589,12 +595,15 @@ class MockMovielensSchema(pa.SchemaModel):

# Some notebooks will do a cross join with userID and itemID,
# a sparse range for these IDs can slow down the notebook tests
userID: Series[int] = Field(in_range={"min_value": 1, "max_value": 10})
itemID: Series[int] = Field(in_range={"min_value": 1, "max_value": 10})
rating: Series[float] = Field(in_range={"min_value": 1, "max_value": 5})
timestamp: Series[int]
title: Series[str] = Field(eq="foo")
genre: Series[str] = Field(eq="genreA|0")
userID: Series[int] = Field(in_range={"min_value": 1, "max_value": 50}, alias=DEFAULT_USER_COL)
itemID: Series[int] = Field(in_range={"min_value": 1, "max_value": 50}, alias=DEFAULT_ITEM_COL)
rating: Series[float] = Field(in_range={"min_value": 1, "max_value": 5}, alias=DEFAULT_RATING_COL)
timestamp: Series[int] = Field(alias=DEFAULT_TIMESTAMP_COL)
title: Series[str] = Field(eq="foo", alias=DEFAULT_TITLE_COL)
genre: Series[str] = Field(eq="genreA|0", alias=DEFAULT_GENRE_COL)

class Config:
unique_columns = ()

@classmethod
def get_df(
Expand Down Expand Up @@ -630,7 +639,7 @@ def get_df(
schema = schema.remove_columns([DEFAULT_GENRE_COL])

random.seed(seed)
# For more information on data synthesis, see https://pandera.readthedocs.io/en/latest/data_synthesis_strategies.html
schema.checks = [pa.Check.unique_columns([DEFAULT_USER_COL, DEFAULT_ITEM_COL])]
return schema.example(size=size)

@classmethod
Expand Down
3 changes: 3 additions & 0 deletions tests/unit/recommenders/datasets/test_movielens.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
DATA_FORMAT,
MOCK_DATA_FORMAT,
DEFAULT_HEADER,
DEFAULT_ITEM_COL,
DEFAULT_USER_COL
)
from recommenders.utils.constants import DEFAULT_GENRE_COL, DEFAULT_TITLE_COL

Expand Down Expand Up @@ -124,6 +126,7 @@ def test_load_pandas_df_mock_100__with_default_param__succeed():
df = load_pandas_df("mock100")
assert type(df) == pandas.DataFrame
assert len(df) == 100
assert not df[[DEFAULT_USER_COL, DEFAULT_ITEM_COL]].duplicated().any()


@pytest.mark.spark
Expand Down