An unofficial pytorch implementation of FM-RT:
Yang Liu, Xianzhuo Xia, Liang Chen, Xiangnan He, Carl Yang, Zibin Zheng. Certifiable Robustness to Discrete Adversarial Perturbations for Factorization Machines, in SIGIR 2020
The paper used a FM as:
FMRT2.py
is the corresponding implementation.
However, I cannot see similar metrics. Before FMRT, the avg-max 1.12
, while the paper showed 1.60
.
So I followed the formula Rendle adopted, which is
Then I use FMRT.py
by default. It dismissed elements on the diagonal.
Here's the performance comparison:
src/
BaseModel.py
: The base class encapsulates device initialization, train & test tasks for rank, classification and regression.FMRT.py
: Derived from BaseModel. Include training and evaling methods.dataset.py
: Derived fromtorch.util.data.Dataset
FeatureDataset
: Dataset for FM.
main.py
: You can look for descriptions of args with-h
../benchmarks/datasets/
For FM, We use torchfm with few changes.