It is happy to know the new package of Tensorflow Recommenders.
ToR[e]cSys is a PyTorch Framework to implement recommendation system algorithms, including but not limited to click-through-rate (CTR) prediction, learning-to-ranking (LTR), and Matrix/Tensor Embedding. The project objective is to develop an ecosystem to experiment, share, reproduce, and deploy in real world in a smooth and easy way (Hope it can be done).
TBU
The complete documentation for ToR[e]cSys is available via ReadTheDocs website.
Thank you for ReadTheDocs! You are the best!
Model Name | Research Paper | Year |
---|---|---|
Word2Vec | Omer Levy et al, 2015. Improving Distributional Similarity with Lessons Learned from Word Embeddings | 2015 |
Model Name | Research Paper | Year |
---|---|---|
TBU |
Model Name | Research Paper | Year |
---|---|---|
Matrix Factorization | / | / |
Starspace | Ledell Wu et al, 2017 StarSpace: Embed All The Things! | 2017 |
Model Name | Research Paper | Year |
---|---|---|
Personalized Re-ranking Model | Changhua Pei et al, 2019. Personalized Re-ranking for Recommendation | 2019 |
There are several ways using ToR[e]cSys to develop a Recommendation System. Before talking about them, we first need to discuss components of ToR[e]cSys.
A model in ToR[e]cSys is constructed by two parts mainly: inputs and model, and they will be wrapped into a sequential module (torecsys.models.sequential) to be trained by Trainer (torecsys.trainer.Trainer). \
For inputs module (torecsys.inputs), it will handle most kinds of inputs in recommendation system, like categorical features, images, etc., with several kinds of methods, including token embedding, pre-trained image models, etc.
For models module (torecsys.models), it will implement some famous models in recommendation system, like Factorization Machine family. I hope I can make the library rich. To construct a model in the module, in addition to the modules implemented in PyTorch, I will also implement some layers in layers which are called by models usually.
After the explanation of ToR[e]cSys, let's move on to the Getting Started
. We can use ToR[e]cSys in the following ways:
- Run by command-line (In development)
> torecsys build --inputs_config='{}' \
--model_config='{"method":"FM", "embed_size": 8, "num_fields": 2}' \
--regularizer_config='{"weight_decay": 0.1}' \
--criterion_config='{"method": "MSELoss"}' \
--optimizer_config='{"method": "SGD", "lr": "0.01"}' \
...
- Run by class method
import torecsys as trs
# build trainer by class method
pipeline = trs.trainer.TorecsysPipeline()
# start to fit the model
trainer = trs.trainer.TorecsysTrainer()
trainer.fit(pipeline)
- Run like PyTorch Module
import torch.nn as nn
import torch.optim
import torecsys as trs
schema = {}
batches = {}
labels = torch.Tensor([])
inputs = trs.inputs.Inputs(schema=schema)
model = trs.models.FactorizationMachineModel()
epochs = 1
optimizer = torch.optim.SGD(params=model.parameters(), lr=1e-4)
criterion = nn.MSELoss()
for i in range(epochs):
optimizer.zero_grad()
outputs = model(**inputs(batches))
loss = criterion(outputs, labels)
loss.backward()
optimizer.step()
For further details, please refer to the example in repository or read the documentation. Hope you enjoy~
TBU
TBU
TBU
- Jasper Li - Developer
ToR[e]cSys is MIT-style licensed, as found in the LICENSE file.