GithubHelp home page GithubHelp logo

neurasp's People

Contributors

azreasoners avatar zhunyoung avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

neurasp's Issues

Labels probability distribution using NeurASP and YOLO

By using YOLOv5 with NeurASP, following your toy-car example, I noticed that, perhaps, due to the execution of the non_max_suppression() method, only one class/label has a positive probability (selects the maximum) and the rest are equal to 0. Τhis affects the stable models that are generated through NeurASP, and their ranking. Specifically, I would expect a behavior similar to the one shown in Section 3.2 of your IJCAI’20 paper, where, by applying state constraints, we get the most probable predictions that satisfy them, even though these predictions are not necessarily the ones with the maximum probability returned by the neural network. How can I get the stable models respecting the probability distribution returned by the Neural Network?

`obsList` in `solvingSudoku_70k` experiment

Hi,

In the experiment of solvingSudoku_70k, each sudoku config in dataList is associated with a obsList in the form of
obs += ':- not sol({}, config, {}).\n'.format(pos, int(value)) during training, as sudoku configsXs are given in textual representations, could you please explain a bit what are these observation lists for?

Cheers.

Sudoku error

Hi,

I'm trying to run the Sudoku example in examples/sudoku, but I ran into this error when running python train.py:

Error: none considered case for output with shape torch.Size([1, 81, 10]) v.s. label with shape torch.Size([1, 9, 9])

The same error comes up when running python train.py in examples/solvingSudoku_70k.

Error: none considered case for output with shape torch.Size([230, 81, 9]) v.s. label with shape torch.Size([230, 9, 9])

What am I missing?

Thanks

TypeError in the Sudoku example

Hi @zhunyoung @azreasoners ,

I tried to run the sudoku example as the instruction told, both test.py and infer.py reported TypeError, error stack shown as follow:

python test.py

Load the model trained with 15 data
/home/ubuntu/miniconda3/lib/python3.9/site-packages/torch/nn/functional.py:718: UserWarning: Named tensors and all their associated APIs are an experimental feature and subject to change. Please do not use them for anything important until they are released as stable. (Triggered internally at  /opt/conda/conda-bld/pytorch_1623448222085/work/c10/core/TensorImpl.h:1156.)
  return torch.max_pool2d(input, kernel_size, stride, padding, dilation, ceil_mode)
Test Acc Using Pure NN (whole board): 17.33%
Test Acc Using Pure NN (single cell): 98.02%
Oversubscription: #Threads=8 exceeds logical CPUs=4.
Traceback (most recent call last):
  File "/home/ubuntu/files/projects/disseration/NeurASP/examples/sudoku/test.py", line 54, in <module>
    acc = NeurASPobj.testInferenceResults(dataListTest, obsListTest)
  File "../../neurasp.py", line 439, in testInferenceResults
    models = self.infer(data, obs=':- mistake.', mvpp=self.mvpp['program_asp'])
  File "../../neurasp.py", line 224, in infer
    return dmvpp.find_one_most_probable_SM_under_obs_noWC(obs=obs)
  File "../../mvpp.py", line 204, in find_one_most_probable_SM_under_obs_noWC
    clingo_control.solve(None, lambda model: models.append(model.symbols(atoms=True)))
  File "/home/ubuntu/miniconda3/lib/python3.9/site-packages/clingo/control.py", line 574, in solve
    p_ass, len(assumptions),
TypeError: object of type 'NoneType' has no len()
python infer.py normal ./data/sudoku.png

Load the model trained with 25 instances of normal Sudoku puzzles
/home/ubuntu/miniconda3/lib/python3.9/site-packages/torch/nn/functional.py:718: UserWarning: Named tensors and all their associated APIs are an experimental feature and subject to change. Please do not use them for anything important until they are released as stable. (Triggered internally at  /opt/conda/conda-bld/pytorch_1623448222085/work/c10/core/TensorImpl.h:1156.)
  return torch.max_pool2d(input, kernel_size, stride, padding, dilation, ceil_mode)
Oversubscription: #Threads=8 exceeds logical CPUs=4.
Traceback (most recent call last):
  File "/home/ubuntu/files/projects/disseration/NeurASP/examples/sudoku/infer.py", line 91, in <module>
    models = NeurASPobj.infer(dataDic=dataDic, mvpp=rules[sudokuType])
  File "../../neurasp.py", line 224, in infer
    return dmvpp.find_one_most_probable_SM_under_obs_noWC(obs=obs)
  File "../../mvpp.py", line 204, in find_one_most_probable_SM_under_obs_noWC
    clingo_control.solve(None, lambda model: models.append(model.symbols(atoms=True)))
  File "/home/ubuntu/miniconda3/lib/python3.9/site-packages/clingo/control.py", line 574, in solve
    p_ass, len(assumptions),
TypeError: object of type 'NoneType' has no len()

Tried on both ubuntu and macos with python 3.9, same errors occured.
Please help, thank you !

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.