Are you sure you want to delete this task? Once this task is deleted, it cannot be recovered.
|
1 year ago | |
---|---|---|
.. | ||
datasets | 1 year ago | |
models | 1 year ago | |
weights | 2 years ago | |
README.md | 1 year ago | |
add.pl | 1 year ago | |
main.py | 1 year ago | |
mnist_add.ipynb | 1 year ago | |
requirements.txt | 1 year ago |
This example shows a simple implementation of MNIST Addition task, where pairs of MNIST handwritten images and their sums are given, alongwith a domain knowledge base containing information on how to perform addition operations. The task is to recognize the digits of handwritten images and accurately determine their sum.
pip install -r requirements.txt
python main.py
usage: main.py [-h] [--no-cuda] [--epochs EPOCHS]
[--label_smoothing LABEL_SMOOTHING] [--lr LR]
[--alpha ALPHA] [--batch-size BATCH_SIZE]
[--loops LOOPS] [--segment_size SEGMENT_SIZE]
[--save_interval SAVE_INTERVAL] [--max-revision MAX_REVISION]
[--require-more-revision REQUIRE_MORE_REVISION]
[--prolog | --ground]
MNIST Addition example
optional arguments:
-h, --help show this help message and exit
--no-cuda disables CUDA training
--epochs EPOCHS number of epochs in each learning loop iteration
(default : 1)
--label_smoothing LABEL_SMOOTHING
label smoothing in cross entropy loss (default : 0.2)
--lr LR base model learning rate (default : 0.001)
--alpha ALPHA alpha in RMSprop (default : 0.9)
--batch-size BATCH_SIZE
base model batch size (default : 32)
--loops LOOPS number of loop iterations (default : 5)
--segment_size SEGMENT_SIZE
segment size (default : 1/3)
--save_interval SAVE_INTERVAL
save interval (default : 1)
--max-revision MAX_REVISION
maximum revision in reasoner (default : -1)
--require-more-revision REQUIRE_MORE_REVISION
require more revision in reasoner (default : 0)
--prolog use PrologKB (default: False)
--ground use GroundKB (default: False)
For all experiments, we used a single linux server. Details on the specifications are listed in the table below.
CPU | GPU | Memory | OS |
---|---|---|---|
2 * Xeon Platinum 8358, 32 Cores, 2.6 GHz Base Frequency | A100 80GB | 512GB | Ubuntu 20.04 |
We present the results of ABL as follows, which include the reasoning accuracy (the proportion of equations that are correctly summed), and the training time used to achieve this accuracy. These results are compared with the following methods:
Method | Accuracy | Time to achieve the Acc. (s) | Average Memory Usage (MB) |
---|---|---|---|
NeurASP | 96.2 | 966 | 3552 |
DeepProbLog | 97.1 | 2045 | 3521 |
LTN | 97.4 | 251 | 3860 |
DeepStochLog | 97.5 | 257 | 3545 |
ABL | 98.1 | 47 | 2482 |
An efficient Python toolkit for Abductive Learning (ABL), a novel paradigm that integrates machine learning and logical reasoning in a unified framework.
Python other