All Projects → successar → Attentionexplanation

successar / Attentionexplanation

Licence: gpl-3.0

Projects that are alternatives of or similar to Attentionexplanation

Yolo Series
A series of notebooks describing how to use YOLO (darkflow) in python
Stars: ✭ 245 (-0.81%)
Mutual labels:  jupyter-notebook
Recsys core
[电影推荐系统] Based on the movie scoring data set, the movie recommendation system is built with FM and LR as the core(基于爬取的电影评分数据集,构建以FM和LR为核心的电影推荐系统).
Stars: ✭ 245 (-0.81%)
Mutual labels:  jupyter-notebook
Bayesian Optimization
Python code for bayesian optimization using Gaussian processes
Stars: ✭ 245 (-0.81%)
Mutual labels:  jupyter-notebook
Zhihu
知乎看山杯 第二名 解决方案
Stars: ✭ 245 (-0.81%)
Mutual labels:  jupyter-notebook
Exploratory computing with python
Stars: ✭ 245 (-0.81%)
Mutual labels:  jupyter-notebook
Audio Classification
Code for YouTube series: Deep Learning for Audio Classification
Stars: ✭ 245 (-0.81%)
Mutual labels:  jupyter-notebook
Recmetrics
A library of metrics for evaluating recommender systems
Stars: ✭ 244 (-1.21%)
Mutual labels:  jupyter-notebook
Ml finance codes
Machine Learning in Finance: From Theory to Practice Book
Stars: ✭ 245 (-0.81%)
Mutual labels:  jupyter-notebook
Pomegranate
Fast, flexible and easy to use probabilistic modelling in Python.
Stars: ✭ 2,789 (+1029.15%)
Mutual labels:  jupyter-notebook
Wav2mid
Automatic Music Transcription with Deep Neural Networks
Stars: ✭ 246 (-0.4%)
Mutual labels:  jupyter-notebook
Box Plots Sklearn
An implementation of some of the tools used by the winner of the box plots competition using scikit-learn.
Stars: ✭ 245 (-0.81%)
Mutual labels:  jupyter-notebook
Jupyter Tips And Tricks
Using Project Jupyter for data science.
Stars: ✭ 245 (-0.81%)
Mutual labels:  jupyter-notebook
Scipy 2018 Sklearn
Scipy 2018 scikit-learn tutorial by Guillaume Lemaitre and Andreas Mueller
Stars: ✭ 247 (+0%)
Mutual labels:  jupyter-notebook
Link Prediction
Representation learning for link prediction within social networks
Stars: ✭ 245 (-0.81%)
Mutual labels:  jupyter-notebook
Parametric T Sne
Running parametric t-SNE by Laurens Van Der Maaten with Octave and oct2py.
Stars: ✭ 246 (-0.4%)
Mutual labels:  jupyter-notebook
Guided Evolutionary Strategies
Guided Evolutionary Strategies
Stars: ✭ 245 (-0.81%)
Mutual labels:  jupyter-notebook
Bigquery Oreilly Book
Source code accompanying: BigQuery: The Definitive Guide by Lakshmanan & Tigani to be published by O'Reilly Media
Stars: ✭ 246 (-0.4%)
Mutual labels:  jupyter-notebook
Neural Painters
Stars: ✭ 247 (+0%)
Mutual labels:  jupyter-notebook
Spinzero Jupyter Theme
A minimal Jupyter Notebook theme
Stars: ✭ 246 (-0.4%)
Mutual labels:  jupyter-notebook
Mltrain Nips 2017
This repository contains all the material for the MLTrain NIPS workshop
Stars: ✭ 246 (-0.4%)
Mutual labels:  jupyter-notebook

AttentionExplanation

This is code for the project : https://arxiv.org/abs/1902.10186 . We will be updating it in coming weeks to include instructions on how to download and process the data and run the experiments.

Prerequisties

This project requires compiling pytorch from source master branch or use pytorch-nightly. We use features that are not in stable release. It also requires installation of torchtext version 0.4.0 from source.

After installation of above, please use pip install -r requirements.txt. Also, python -m spacy download en to include the english language pack for spacy if not already present.

Update

We are providing code to run experiments on all datasets . For obtaining ADR tweets data, please contact us directly (a large portion of tweets we have used in this experiments have been removed from twitter website).

  1. Clone the repository as git clone https://github.com/successar/AttentionExplanation.git Transparency (Note this is important.)

  2. Set your PYTHONPATH to include the directory path which contains this repository (All imports in the code are of form Transparency.* -- If you see error ModuleNotFoundError: No module named 'Transparency', most probably your PYTHONPATH is not set.).

For example if your cloned repository reside in /home/username/Transparency, then one way to do this is export PYTHONPATH="/home/username" from command line or add it to your ~/.bashrc .

  1. Go to the Transparency/preprocess folder and follow the instructions to process datasets.

To run Binary Classification Tasks,

  1. From the main folder, run python train_and_run_experiments_bc.py --dataset {dataset_name} --data_dir . --output_dir outputs/ --attention {attention_type} --encoder {encoder_type}

Valid values for dataset_name are [sst, imdb, 20News_sports, tweet, Anemia, Diabetes, AgNews].

Valid values for encoder_type is [cnn, lstm, average]. Valid values for attention_type is [tanh, dot].

For example, if you want to run experiments for IMDB dataset with CNN encoder and Tanh attention, please use python train_and_run_experiments_bc.py --dataset imdb --data_dir . --output_dir outputs/ --attention tanh --encoder cnn

To run QA or SNLI tasks,

  1. From the main folder, run python train_and_run_experiments_qa.py --dataset {dataset_name} --data_dir . --output_dir outputs/ --attention {attention_type} --encoder {encoder_type}

Valid values for dataset_name are [snli, cnn, babi_1, babi_2, babi_3].

Valid values for encoder_type is [cnn, lstm, average]. Valid values for attention_type is [tanh, dot].

For example, if you want to run experiments for snli dataset with LSTM encoder and Tanh attention, please use python train_and_run_experiments_bc.py --dataset snli --data_dir . --output_dir outputs/ --attention tanh --encoder lstm

Outputs

Both BC and QA tasks will generate the graphs used in paper in the folder Transparency/graph_outputs . You can also browse our graphs here -- https://successar.github.io/AttentionExplanation/docs/ .

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].