Giter Club home page Giter Club logo

safety's Introduction

SAFETY

This is the official repository of the paper, "You're Not Alone in Battle: Combat Threat Analysis Using Attention Networks and a New Open Benchmark," published in CIKM 2023.

Dataset, benchmark, and training details are provided in the Appendix.pdf.

This repository contains the proposed (1) combat simulation dataset, (2) model SAFETY, and (3) online Appendix.

Note: In coming weeks, we will make more details about the dataset and codes available.


Basics

./train folder has codes to run all deep learning models.

./dataset folder has dataset zip files.

./run folder has codes to reproduce the experimental outcomes in the paper.

./best_hyperparam folder has txt files with best hyperparameters for each deep learning model.

statistics_eval.ipynb file has codes to check raw data statistics.


Dataset

The raw datasets are the 1.zip, 2.zip, 3.zip, 4.zip files in the dataset folder, where each number indicates the assigned tactic.

Preprocessed data for training and evaluation is data_dict file.

Step 1: Unzip the Raw Data

Code

cd ./SAFETY/
unzip ./dataset/1.zip ./dataset/2.zip ./dataset/3.zip ./dataset/4.zip

This will return four folders within ./dataset. Each folder has four csv files, each with features and labels.

Step 2: Preprocess

Run codes in table2dict.ipynb to generate data_dict.pkl. (Note that the zip file of data_dict is already provided in ./dataset.)

Step 3: Check Statistics (Optional)

Run codes in statistics_eval.ipynb to check unzipped raw data statistics.


Codes and Hyperparameters

To run the model code, refer to ./run/run.sh file.

Example: Train Model

python ./train/main.py --pred y_int --stress-type none --model SAFETY # train to predict y_int
python ./train/main.py --pred y_atk --stress-type none --model SAFETY # train to predict y_atk

Running the code will automatically load the tuned best hyperparameters from ./best_hyperparam. If the model does not have tuned hyperparameters in ./best_hyperparam, grid search the model's best hyperparameters

Example: Hyperparameter Search

python ./train/main.py --pred y_int --stress-type none --model SAFETY --optimize hyperparam # search best hyperparameters for y_int prediction
python ./train/main.py --pred y_atk --stress-type none --model SAFETY --optimize hyperparam # search best hyperparameters for y_atk prediction

As described in the Appendix.pdf, the maximum observed time (t_max) is 300. Only 20 randomly sampled timestamps (t_sample_size) serve as model input. To change the setting, modify --t-max and --t-sample-size in the command.

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.