Skip to content

GreenieQwQ/TTNN

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Enhancing Neural Temporal Reasoning with Proofs

Requirements

Usage

Prepare datasets

To begin, you will need to prepare datasets with data in data/{dataset name}-{range} directory as follows:

$ python processRaw.py --dn={dataset name} --rn={range}
$ python prepare_datasets.py --dn={dataset name} --rn={range}

The data directory consists of json files end with "train.json", "val.json" and "test.json". An example element is as follows:

{
    "src": "X0,{;c;c},0",
    "tgt": "0,{c;c;},0#@,@,@"
}

Train

To train the model with the specified dataset and range with args in cofig/config.json:

$  python train --dn={dataset name} --rn={range}

for more notification about the arguments, simply consult

$  python train -h

Translate

To predict a satisfying trace from the ltl formulas in test.json using the best model in bestModel/ (which is retrieved by copying the best model specified in training log and renamed as {dataset name}-{range}.pth):

$ python translate.py --dn={dataset name} --rn={range} --tdn={target dataset name}

It will give you the prediction of all range in target dataset and output the prediction at data/preiction-{dataset name}-{range}.

Evaluate

To evaluate the prediction produced by the model mentioned above:

$ python evaluate.py --dn={dataset name} --rn={range} --tdn={target dataset name}

It will output the syntactic accuracy and semantic accuracy of prediction at all range of target dataset.

References

Parts of code/scripts are borrowed/inspired from:

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages