Code Monkey home page Code Monkey logo

crazydonkey200 / neural-symbolic-machines Goto Github PK

View Code? Open in Web Editor NEW
375.0 27.0 69.0 54.77 MB

Neural Symbolic Machines is a framework to integrate neural networks and symbolic representations using reinforcement learning, with applications in program synthesis and semantic parsing.

License: Apache License 2.0

Shell 4.05% Python 93.22% Jupyter Notebook 2.73%
deep-learning deep-reinforcement-learning tensorflow program-synthesis semantic-parsing rnn reinforcement-learning

neural-symbolic-machines's People

Contributors

agarwl avatar crazydonkey200 avatar martinomensio avatar thesparta 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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

neural-symbolic-machines's Issues

training stop

I have edit the whole code to python3.

And the program stop here:
image

ctrl + c shows

  File "experiment_mapo.py", line 1274, in <module>
    tf.app.run()
  File "/data4/tong.guo/Py36/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 125, in run
    _sys.exit(main(argv))
  File "experiment_mapo.py", line 1270, in main
    run_experiment()
  File "experiment_mapo.py", line 704, in run_experiment
    actor.join()
  File "/data4/tong.guo/Py36/lib/python3.6/multiprocessing/process.py", line 124, in join
    res = self._popen.wait(timeout)
  File "/data4/tong.guo/Py36/lib/python3.6/multiprocessing/popen_fork.py", line 50, in wait
    return self.poll(os.WNOHANG if timeout == 0.0 else 0)
  File "/data4/tong.guo/Py36/lib/python3.6/multiprocessing/popen_fork.py", line 28, in poll
    pid, sts = os.waitpid(self.pid, flag)

and

Process actor_15:
Process actor_3:
Process actor_14:
Traceback (most recent call last):
Process actor_6:
  File "/data4/tong.guo/Py36/lib/python3.6/multiprocessing/popen_fork.py", line 28, in poll
    pid, sts = os.waitpid(self.pid, flag)
KeyboardInterrupt
Traceback (most recent call last):
  File "/data4/tong.guo/Py36/lib/python3.6/multiprocessing/process.py", line 258, in _bootstrap
    self.run()
  File "experiment_mapo.py", line 962, in run
    new_ckpt = self.ckpt_queue.get()
  File "/data4/tong.guo/Py36/lib/python3.6/multiprocessing/queues.py", line 93, in get
    with self._rlock:
  File "/data4/tong.guo/Py36/lib/python3.6/multiprocessing/synchronize.py", line 96, in __enter__
    return self._semlock.__enter__()
KeyboardInterrupt

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
Traceback (most recent call last):
  File "/data4/tong.guo/Py36/lib/python3.6/multiprocessing/process.py", line 261, in _bootstrap
    util._exit_function()
  File "/data4/tong.guo/Py36/lib/python3.6/multiprocessing/util.py", line 322, in _exit_function
    _run_finalizers()
  File "/data4/tong.guo/Py36/lib/python3.6/multiprocessing/util.py", line 262, in _run_finalizers
    finalizer()
  File "/data4/tong.guo/Py36/lib/python3.6/multiprocessing/util.py", line 186, in __call__
    res = self._callback(*self._args, **self._kwargs)
  File "/data4/tong.guo/Py36/lib/python3.6/multiprocessing/queues.py", line 191, in _finalize_join
    thread.join()
  File "/data4/tong.guo/Py36/lib/python3.6/multiprocessing/process.py", line 258, in _bootstrap
    self.run()
  File "/data4/tong.guo/Py36/lib/python3.6/threading.py", line 1056, in join
    self._wait_for_tstate_lock()
  File "experiment_mapo.py", line 962, in run
    new_ckpt = self.ckpt_queue.get()
  File "/data4/tong.guo/Py36/lib/python3.6/threading.py", line 1072, in _wait_for_tstate_lock
    elif lock.acquire(block, timeout):
  File "/data4/tong.guo/Py36/lib/python3.6/multiprocessing/queues.py", line 93, in get
    with self._rlock:
  File "/data4/tong.guo/Py36/lib/python3.6/multiprocessing/synchronize.py", line 96, in __enter__
    return self._semlock.__enter__()
KeyboardInterrupt

Unable to install dependencies

Can you please specify the configuration of the emvironment? I am using Anaconda2(because python2 is required) package manager. All the libraries in requirements.txt have been successfully installed.

Specifically, I'm running into this error:

Traceback (most recent call last):
  File "../experiment.py", line 29, in <module>
    from nsm import word_embeddings
  File "/home/16co108/mapo/projects/neural-symbolic-machines/table/wikisql/nsm/word_embeddings.py", line 3, in <module>
    import gensim
  File "/home/16co108/.local/lib/python2.7/site-packages/gensim/__init__.py", line 6, in <module>
    from gensim import parsing, matutils, interfaces, corpora, models, similarities, summarization, utils  # noqa:F401
  File "/home/16co108/.local/lib/python2.7/site-packages/gensim/parsing/__init__.py", line 4, in <module>
    from .preprocessing import (remove_stopwords, strip_punctuation, strip_punctuation2,  # noqa:F401
  File "/home/16co108/.local/lib/python2.7/site-packages/gensim/parsing/preprocessing.py", line 40, in <module>
    from gensim import utils
  File "/home/16co108/.local/lib/python2.7/site-packages/gensim/utils.py", line 41, in <module>
    import scipy.sparse
  File "/opt/ohpc/pub/anaconda2/5.0.1/lib/python2.7/site-packages/scipy/sparse/__init__.py", line 229, in <module>
    from .csr import *
  File "/opt/ohpc/pub/anaconda2/5.0.1/lib/python2.7/site-packages/scipy/sparse/csr.py", line 15, in <module>
    from ._sparsetools import csr_tocsc, csr_tobsr, csr_count_blocks, \
ImportError: /usr/lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /opt/ohpc/pub/anaconda2/5.0.1/lib/python2.7/site-packages/scipy/sparse/_sparsetools.so)
Traceback (most recent call last):
  File "../experiment.py", line 29, in <module>
    from nsm import word_embeddings
  File "/home/16co108/mapo/projects/neural-symbolic-machines/table/wikisql/nsm/word_embeddings.py", line 3, in <module>
    import gensim
  File "/home/16co108/.local/lib/python2.7/site-packages/gensim/__init__.py", line 6, in <module>
    from gensim import parsing, matutils, interfaces, corpora, models, similarities, summarization, utils  # noqa:F401
  File "/home/16co108/.local/lib/python2.7/site-packages/gensim/parsing/__init__.py", line 4, in <module>
    from .preprocessing import (remove_stopwords, strip_punctuation, strip_punctuation2,  # noqa:F401
  File "/home/16co108/.local/lib/python2.7/site-packages/gensim/parsing/preprocessing.py", line 40, in <module>
    from gensim import utils
  File "/home/16co108/.local/lib/python2.7/site-packages/gensim/utils.py", line 41, in <module>
    import scipy.sparse
  File "/opt/ohpc/pub/anaconda2/5.0.1/lib/python2.7/site-packages/scipy/sparse/__init__.py", line 229, in <module>
    from .csr import *
  File "/opt/ohpc/pub/anaconda2/5.0.1/lib/python2.7/site-packages/scipy/sparse/csr.py", line 15, in <module>
    from ._sparsetools import csr_tocsc, csr_tobsr, csr_count_blocks, \
ImportError: /usr/lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /opt/ohpc/pub/anaconda2/5.0.1/lib/python2.7/site-packages/scipy/sparse/_sparsetools.so)

Coverage of the domain specific language

Hi, Chen:

Can you give the coverage of your domain specific language for wikitable and wikisql? I am trying to reproduce this language and my system can cover around 74% questions in training set for wikitable. I want to make sure if it matches your number.

Thanks!

What happens in test time?

NSM only use question-answer pair to train.
And in test time, NSM generate the SQL logic form.
Am I right?

Different vocab for different en_vocab files.

with open(vocab_file, 'r') as f:
tks = json.load(f)
self.vocab = dict(zip(tks, range(len(tks))))

Due to the above line, the vocab in embedding model i.e. embedding_model.vocab is different (i.e mapping from token to index would be different) depending on the en_vocab_count_i.json file you use (I tried it for i = 1, 5).

This doesn't seem right because the embeddings loaded for a given token would be dependent on the vocabulary you used.

def __getitem__(self, word):
if word in self.vocab:
index = self.vocab[word]
return self.embedding_mat[index]

Imported modules not defined

import wtq_evaluator
import wtq_utils

In the file preprocess.py, the above modules are imported but not defined. I guess the correct imports should be:

import evaluator as wtq_evaluator
import ..utils as wtq_utils

`scale_rewards` function uses undefined variables

def scale_rewards(samples, scale):
  """Weight each samples with the weight. Reflected on rewards."""
  scaled_rewards = [list(scale * np.array(s.rewards)) for s in samples]
  new_samples = []
  for s, p in zip(samples, scaled_probs):
    new_samples.append(
        sample._replace(traj=traj._replace(rewards=scaled_rewards)))
  return new_samples

In the function in agent_factory.py, the variables sample and scaled_probs are undefined.

reproducing results paper

Hi!,
I was playing with your code, great work! I am trying to reproduce the results from your paper on WikiSQL. However, when using run.sh I get results in the 70.3 ballpark (on dev set) instead of the reported 72.2%. Are there any parameters I need to change to get the reported results?

Thanks in advance!

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.