Skip to content

Commit

Permalink
Merge branch 'sb-ai-lab:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
wowMalow authored Jan 25, 2024
2 parents 4c4b650 + e3756f6 commit fc163f0
Show file tree
Hide file tree
Showing 48 changed files with 8,170 additions and 2,465 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
run: |
python -m venv venv
. ./venv/bin/activate
pip install --upgrade pip wheel poetry==1.5.1 lightfm
pip install --upgrade pip wheel poetry==1.5.1 lightfm==1.17
poetry cache clear pypi --all
./poetry_wrapper.sh --experimental install --all-extras
- name: Build docs
Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/deploy_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Deploy Docs to Pages

on:
push:
branches: [release]
tags:
- 'v*.*.*'

workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
deploy_docs:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Install full package
run: |
python -m venv venv
. ./venv/bin/activate
pip install --upgrade pip wheel poetry==1.5.1 lightfm==1.17
poetry cache clear pypi --all
./poetry_wrapper.sh --experimental install --all-extras
- name: Build docs
run: |
. ./venv/bin/activate
make -C docs clean html
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: 'docs/_build/html/'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v3
56 changes: 54 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI
name: CI Pipeline

# Controls when the workflow will run
on:
Expand Down Expand Up @@ -28,7 +28,7 @@ jobs:
run: |
python -m venv venv
. ./venv/bin/activate
pip install --upgrade pip wheel poetry==1.5.1 lightfm
pip install --upgrade pip wheel poetry==1.5.1 lightfm==1.17
poetry cache clear pypi --all
./poetry_wrapper.sh --experimental install --all-extras
Expand All @@ -44,3 +44,55 @@ jobs:
run: |
. ./venv/bin/activate
pytest
build_production:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.9"

- name: Install production package
run: |
python -m venv venv
. ./venv/bin/activate
pip install --upgrade pip wheel poetry==1.5.1 poetry-dynamic-versioning
poetry cache clear pypi --all
./poetry_wrapper.sh install --all-extras
- name: Build
run: |
. ./venv/bin/activate
export PACKAGE_SUFFIX=.dev
./poetry_wrapper.sh build
build_experimental:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.9"

- name: Install full package
run: |
python -m venv venv
. ./venv/bin/activate
pip install --upgrade pip wheel poetry==1.5.1 poetry-dynamic-versioning lightfm==1.17
poetry cache clear pypi --all
./poetry_wrapper.sh --experimental install --all-extras
- name: Build
run: |
. ./venv/bin/activate
export PACKAGE_SUFFIX=.preview
./poetry_wrapper.sh --experimental build
77 changes: 77 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Publish to PyPI

on:
push:
branches: [release]
tags:
- 'v*.*.*'

jobs:
publish_experimental:
runs-on: ubuntu-20.04
permissions:
id-token: write
environment:
name: release
url: https://pypi.org/p/replay-rec

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.9"

- name: Install experimental package
run: |
python -m venv venv
. ./venv/bin/activate
pip install --upgrade pip wheel poetry==1.5.1 poetry-dynamic-versioning lightfm==1.17
poetry cache clear pypi --all
./poetry_wrapper.sh --experimental install --all-extras
- name: Build Experimental
run: |
. ./venv/bin/activate
export PACKAGE_SUFFIX=.preview
./poetry_wrapper.sh --experimental build
- name: Publish Experimental
uses: pypa/gh-action-pypi-publish@release/v1

publish_production:
runs-on: ubuntu-20.04
permissions:
id-token: write
environment:
name: release
url: https://pypi.org/p/replay-rec

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.9"

- name: Install production package
run: |
python -m venv venv
. ./venv/bin/activate
pip install --upgrade pip wheel poetry==1.5.1 poetry-dynamic-versioning
poetry cache clear pypi --all
./poetry_wrapper.sh install --all-extras
- name: Build Production
run: |
. ./venv/bin/activate
./poetry_wrapper.sh build
- name: Publish Production
uses: pypa/gh-action-pypi-publish@release/v1
7 changes: 5 additions & 2 deletions docs/pages/modules/models.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ ___________________
"Neural Matrix Factorization (Experimental)", "Python CPU/GPU"
"MultVAE (Experimental)", "Python CPU/GPU"
"DDPG (Experimental)", "Python CPU"
"DT4Rec (Experimental)", "Python CPU/GPU"
"ADMM SLIM (Experimental)", "Python CPU"
"Wrapper for implicit (Experimental)", "Python CPU"
"Wrapper for LightFM (Experimental)", "Python CPU"
Expand Down Expand Up @@ -276,14 +277,16 @@ DDPG (Experimental)
.. autoclass:: replay.experimental.models.DDPG
:special-members: __init__

DT4Rec (Experimental)
```````````````````````````
.. autoclass:: replay.experimental.models.dt4rec.dt4rec.DT4Rec
:special-members: __init__

CQL Recommender (Experimental)
```````````````````````````````````
Conservative Q-Learning (CQL) algorithm is a SAC-based data-driven deep reinforcement learning algorithm,
which achieves state-of-the-art performance in offline RL problems.

\* incompatible with python 3.10

.. image:: /images/cql_comparison.png

.. autoclass:: replay.experimental.models.cql.CQL
Expand Down
7 changes: 7 additions & 0 deletions docs/pages/modules/scenarios.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Scenarios
==========
.. automodule:: replay.scenarios
.. automodule:: replay.experimental.scenarios.obp_wrapper


Fallback
Expand All @@ -14,3 +15,9 @@ Two Stage Scenario (Experimental)
.. autoclass:: replay.experimental.scenarios.TwoStagesScenario
:special-members: __init__
:members: fit, predict, optimize

Ofline Policy Learners
-----------------------
.. autoclass:: replay.experimental.scenarios.obp_wrapper.OBPOfflinePolicyLearner
:special-members: __init__
:members: predict, optimize
457 changes: 302 additions & 155 deletions examples/09_sasrec_example.ipynb

Large diffs are not rendered by default.

Loading

0 comments on commit fc163f0

Please sign in to comment.