Giter VIP home page Giter VIP logo

cakt's Introduction

Environment

This project is developed using python 3.7,Pytorch1.4.0, CUDA 10.2 on NVIDIA Titan RTX GPU. You'd better configure the environment as this.

Quick Start

1. Clone the repo:

git clone [email protected]:Badstu/CAKT.git
cd CAKT

2. Install dependencies:

Configure python, pytorch and CUDA enviroments, and then

pip install -r requirements.txt

3. Dataset

You can find dataset at dataset folder, there are five datasets used in this project.

4. Quick run

You can run our CAKT model with main.py.

python main.py

when you get this information, it means that you run it successfully.

img

  • if you want to run our main CAKT model, you can use run_CAKT() function, and you can easily modify some parameters, such as k_frames(k), H and batch_size(b) to do some experiments, for example,

    k_frames: [4, 8, 16, 32]
    H: [11, 13, 15, 17, 19]
    batch_size: [32, 48, 64, 80]
    
  • if you want to run our model on different datasets, you can use run_five_dataset() function, we provide five benchmark datasets as follows:

    dataset_name, knowledge_length
    "assist2009", 110,
    "assist2015", 100,
    "assist2017", 102,
    "statics", 1223,
    "synthetic", 50
    
  • if you want to run ablation model of CAKT, we provide run_ablation() function, you can set model_name="CAKT_ablation" and set ablation equal to ablation mode:

    ablation_mode: ["LSTM_RECENT", "FC_POOLING", "FC_REAR", "WEIGHT_SUM", "NO_EXP_DECAY"]
    

Please feel free to contact me by email to me or just leave a issue if you have any question.

cakt's People

Contributors

badstu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

3kyou1 prassr

cakt's Issues

Code running problems

Traceback (most recent call last):
File "main.py", line 99, in
run_CAKT()
File "main.py", line 27, in run_CAKT
issave=False)
File "/home/D1/kt/KT/experiment/CAKT_experiment.py", line 124, in CAKT_main
optimizer)
File "/home/D1/kt/KT/run/run_cakt.py", line 61, in train_cakt
output, hidden_state, _ = model(batch_seq, batch_past_counts, batch_repeat_gaps).to(opt.device)
File "/home/D1/miniconda3/envs/CAKT/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
return forward_call(*input, **kwargs)
File "/home/D1/kt/KT/model/CAKT.py", line 270, in forward
embed_output = self.embedding(x) # [batch_size, max_seq_len, 205] embed_dim=205
File "/home/D1/miniconda3/envs/CAKT/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
return forward_call(*input, **kwargs)
File "/home/D1/miniconda3/envs/CAKT/lib/python3.7/site-packages/torch/nn/modules/sparse.py", line 160, in forward
self.norm_type, self.scale_grad_by_freq, self.sparse)
File "/home/D1/miniconda3/envs/CAKT/lib/python3.7/site-packages/torch/nn/functional.py", line 2044, in embedding
return torch.embedding(weight, input, padding_idx, scale_grad_by_freq, sparse)
RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cpu and cuda:0! (when checking argument for argument index in method wrapper__index_select)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.