Skip to main content
ToolPotion
AI Advisor
Submit a Tool (Free)

Attentional Factorization Machine

This GitHub repository provides a TensorFlow implementation of the Attentional Factorization Machine (AFM) model. It allows users to train and evaluate AFM for tasks like recommendation systems, learning the weight of feature interactions through attention networks. The project includes code, data examples, and instructions for quick setup and performance comparison.

View Repository
Share
View Repository
Share

The Attentional Factorization Machine (AFM) is a sophisticated model designed to enhance the performance of factorization machines by learning the importance of feature interactions through attention networks. This repository offers a direct TensorFlow implementation of the AFM model, building upon the foundational concepts of Factorization Machines (FM).

Read More

The project is based on the research paper "Attentional Factorization Machines: Learning the Weight of Feature Interactions via Attention Networks" by Jun Xiao, Hao Ye, Xiangnan He, Hanwang Zhang, Fei Wu, and Tat-Seng Chua, presented at IJCAI 2017. The implementation supports both regression and classification tasks, optimizing for RMSE.

Users can leverage this code to replicate the research findings or apply AFM to their own datasets. The repository provides clear instructions for setting up the environment, which requires TensorFlow (version 1.0.1), NumPy, and Scikit-learn. Datasets should follow the input format of the LibFM toolkit, with an example using the MovieLens dataset for personalized tag recommendation.

The included quick example demonstrates how to train an FM model first for pretraining, and then use these weights to train the AFM model. This approach allows for a direct comparison of performance between standard FM and the enhanced AFM. The code also includes functionalities for evaluating the trained models on test datasets.

This implementation is particularly valuable for researchers and practitioners in the fields of recommender systems, machine learning, and deep learning who are looking to improve the accuracy and interpretability of their models by effectively capturing the nuances of feature interactions. The attention mechanism allows the model to dynamically weigh the importance of different feature pairs, leading to more precise predictions.

  • CategoryAI Models & LLMs
  • Pricing ModelOpen source
  • DeploymentCloud, Self-hosted
  • PlatformsWeb

  • TensorFlow implementation of Attentional Factorization Machine (AFM)

  • Supports regression and classification tasks

  • Optimizes for RMSE

  • Learns the weight of feature interactions via attention networks

  • Includes implementation of Factorization Machines (FM) for pretraining

  • Uses one-hot encoding for feature vector conversion

  • Compatible with LibFM dataset format

  • Provides example usage with MovieLens dataset

  • Includes scripts for training and evaluation

  • Codebase includes AFM.py, FM.py, and LoadData.py

  • Supports model pretraining

  1. Set up environment: Install TensorFlow (v1.0.1), NumPy, and Scikit-learn.

  2. Prepare dataset: Format data according to LibFM toolkit specifications.

  3. Train FM model: Execute `python FM.py` with specified dataset and parameters for pretraining.

  4. Train AFM model: Execute `python AFM.py` using the pretrained FM weights.

  5. Evaluate model: Run `python FM.py` or `python AFM.py` with the `--process evaluate` flag.

  • Recommender Systems
  • Tag Recommendation
  • Click-Through Rate Prediction
  • Feature Interaction Learning
  • Machine Learning Model Development

From GitHub

Attentional Factorization Machine Reviews

Loading...

Popular AI Tools Like Attentional Factorization Machine

xDeepFM

AI GitHub Repos

xDeepFM is an open-source deep learning toolkit for factorization models, specifically releasing the source code for the eXtreme Deep Factorization Machine (xDeepFM) model. It…

AI Models & LLMs
View Tool

AI GitHub Repos

Open-source deep learning toolkit for factorization models, specifically releasing the source code for the eXtreme Deep Factorization Machine (xDeepFM) model. It…xDeepFM is an open-source deep learning toolkit for factorization models, specifically releasing the source code for the eXtreme Deep Factorization Machine (xDeepFM) model. It…

AI Models & LLMs
See the Top 250 AI GitHub Repos

DeepSeek-R1

AI GitHub Repos

DeepSeek-R1 is a GitHub project focused on AI-driven solutions. It offers a variety of repositories that enhance AI capabilities, including plugins, sparse attention kernels, and…

AI Models & LLMs
View Tool

AI GitHub Repos

GitHub project focused on AI-driven solutions. It offers a variety of repositories that enhance AI capabilities, including plugins, sparse attention kernels, and…DeepSeek-R1 is a GitHub project focused on AI-driven solutions. It offers a variety of repositories that enhance AI capabilities, including plugins, sparse attention kernels, and…

AI Models & LLMs
See the Top 250 AI GitHub Repos

FNet

AI GitHub Repos

FNet is an efficient Transformer-like encoder architecture that replaces self-attention with Fourier Transforms. Developed by Google Research, it offers a high-performance…

AI Models & LLMs
View Tool

AI GitHub Repos

Efficient Transformer-like encoder architecture that replaces self-attention with Fourier Transforms. Developed by Google Research, it offers a high-performance…FNet is an efficient Transformer-like encoder architecture that replaces self-attention with Fourier Transforms. Developed by Google Research, it offers a high-performance…

AI Models & LLMs
See the Top 250 AI GitHub Repos

TensorFlow

AI GitHub Repos

TensorFlow is an open-source machine learning framework designed for everyone. It provides a comprehensive ecosystem for building and deploying machine learning models, making it…

Machine Learning Platforms
View Tool

AI GitHub Repos

Open-source machine learning framework designed for everyone. It provides a comprehensive ecosystem for building and deploying machine learning models, making it…TensorFlow is an open-source machine learning framework designed for everyone. It provides a comprehensive ecosystem for building and deploying machine learning models, making it…

FeaturedMachine Learning Platforms
See the Top 250 AI GitHub Repos

Neural Graph Collaborative Filtering (NGCF) is a recommendation framework leveraging graph neural networks. It explicitly encodes collaborative signals through high-order…

AI Models & LLMs
View Tool

Recommendation framework leveraging graph neural networks. It explicitly encodes collaborative signals through high-order…Neural Graph Collaborative Filtering (NGCF) is a recommendation framework leveraging graph neural networks. It explicitly encodes collaborative signals through high-order…

AI Models & LLMs
See the Top 250 AI GitHub Repos

This repository provides the official code implementation for the research paper "How Attentive are Graph Attention Networks?" published at ICLR'2022. It offers reproducible…

Machine Learning Platforms
View Tool

LightGCN

AI GitHub Repos

LightGCN is a simplified Graph Convolutional Network designed for recommendation systems. It focuses on the essential neighborhood aggregation component for collaborative…

AI Models & LLMs
View Tool

AI GitHub Repos

Simplified Graph Convolutional Network designed for recommendation systems. It focuses on the essential neighborhood aggregation component for collaborative…LightGCN is a simplified Graph Convolutional Network designed for recommendation systems. It focuses on the essential neighborhood aggregation component for collaborative…

AI Models & LLMs
See the Top 250 AI GitHub Repos

Funnel-Transformer

AI GitHub Repos

Funnel-Transformer is an AI model that compresses hidden states to reduce computation cost. It allows for deeper or wider models with the same FLOPs and can recover token-level…

AI Models & LLMs
View Tool

AI GitHub Repos

AI model that compresses hidden states to reduce computation cost. It allows for deeper or wider models with the same FLOPs and can recover token-level…Funnel-Transformer is an AI model that compresses hidden states to reduce computation cost. It allows for deeper or wider models with the same FLOPs and can recover token-level…

AI Models & LLMs
See the Top 250 AI GitHub Repos
1 of 8