Skip to content

LiuBodan/ParaconsistentAbductiveLearning

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MNIST Addition Under Contradictory Information

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 rules of addition is given as well as artificial inconsistent information. The task is to recognize the digits of handwritten images and accurately determine their sum under the existence of inconsistency in the knowledge base.

About the Codes

  1. kb contains the knowledge base code for ABL as well as the logic programming code for addition rules (add.pl for classical logic based knowledge base, para_refine.pl for the paraconsistent logic QMPT0 based knowledge base).
  2. training_logs contrains training logs and the weights for both versions of ABL on the task.

Run

Install SWI-Prolog, please make sure the version of SWI-Prolog is below 9.2 as pyswip does not support version 9.2+, swipl should work in your command line shell.

pip install -r requirements.txt
python main.py

Environment

Details on the specifications are listed in the table below.

CPU OS
Intel i5-8400 CPU @ 2.80GHz and 16 GB memory Windows 11 Pro

References

For more information about ABL, please refer to: ABLKit, Zhou, 2019 and Zhou and Huang, 2022.

For more information about paraconsistent logic programming QMPT0, please refer to Goto, 2018 and Coniglio and Marcelo, 2016.

For the other compared methods, their codes can be found below:

DeepProlog, LTN, DeepStochLog, NeurASP.