Giter Site home page Giter Site logo

nearai / program_synthesis Goto Github PK

View Code? Open in Web Editor NEW
142.0 10.0 26.0 858 KB

Program Synthesis

Home Page: http://near.ai

License: Apache License 2.0

Python 29.20% Jupyter Notebook 70.37% C++ 0.43%
deep-learning program-synthesis machine-learning research-project

program_synthesis's People

Contributors

ilblackdragon avatar itsnear avatar maksymzavershynskyi avatar rshin 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

program_synthesis's Issues

Fail to download Karel dataset

I tried to download the the preprocessed karel dataset using:

wget https://s3.us-east-2.amazonaws.com/karel-dataset/karel.tar.gz

Here's what I get:

--2023-03-31 01:42:06--  https://s3.us-east-2.amazonaws.com/karel-dataset/karel.tar.gz
Resolving s3.us-east-2.amazonaws.com (s3.us-east-2.amazonaws.com)... 52.219.109.185
Connecting to s3.us-east-2.amazonaws.com (s3.us-east-2.amazonaws.com)|52.219.109.185|:443... connected.
HTTP request sent, awaiting response... 403 Forbidden
2023-03-31 01:42:07 ERROR 403: Forbidden.

Additionally, I tried to access the link using my browser, and the page shows:

This XML file does not appear to have any style information associated with it. The document tree is shown below.
<Error>
<Code>AccessDenied</Code>
<Message>Access Denied</Message>
<RequestId>AV0BQYR71EWHN8RP</RequestId>
<HostId>3kpgQibwiHIDK4+t8R9uE+PNEgy+w+UFZbQDrhTnqE7qbJC4F0uzcXnRxdCe5AeEzPVcIYcRx4o=</HostId>
</Error>

It seems like it's outdated.
Maybe can you please reupload the dataset?

License

Can you please add a license to the repository? Ideally something permissive, like MIT.

Edit: missed it, there's Apache.

Is java to uast available?

Hello, thank you for a great code release,

I'm a phd student interested in using the uast representation of java in my research, is the code to convert java to uast is available? I'm able to run the uast -> java on the naps dataset, but I'm wondering if the other direction, java->uast is also available.

Thank you!

Is seq2tree open-sourced?

Just curious since I can't find it easily. If not, is there a plan to do so?

Thanks! Feel free to close this issue anytime.

Release AlgoLisp

  • Move AlgoLisp dataset tools
  • Move AlgoLisp models
  • Move Karel into it's own subfolder
  • Remove extra level of Karel folders in Karel subproject.
  • Separate tools and modules that are common into common / tools folder

Pickling error from multiprocessing when running eval.py in algolisp

After training the model with train.py, I'm getting the below pickling error when running eval.py. The error seems to be coming from the use of the multiprocessing package with the executor module. Please could you advise on this?

python program_synthesis/algolisp/eval.py --model_type=seq2seq --model_dir=models/seq2seq --no-cuda
Evaluation:
        Model type: seq2seq
        Model path: models/seq2seq
Loaded /data/generated/metaset3.dev.jsonl, total records: 10819
Loaded vocab /data/generated/word.vocab: 331
Loaded vocab /data/generated/word.vocab: 331
Spec2Seq(
  (input_embed): Embedding(351, 500)
  (output_embed): Embedding(351, 500)
  (encoder): SpecEncoder(
    (text_encoder): SequenceEncoder(
      (embed): Embedding(351, 500)
      (encoder): GRU(500, 500, batch_first=True)
    )
    (proj): Linear(in_features=500, out_features=500, bias=True)
  )
  (decoder): SeqDecoderAttn(
    (embed): Embedding(351, 500)
    (decoder): StackedGRU(
      (dropout): Dropout(p=0.2, inplace=False)
      (layers): ModuleList(
        (0): GRUCell(500, 500)
      )
    )
    (out): Linear(in_features=500, out_features=371, bias=False)
    (attention): DotProductAttention(
      (param_0): Linear(in_features=500, out_features=500, bias=False)
      (param_1): Linear(in_features=1500, out_features=500, bias=False)
    )
    (decoder_proj): Linear(in_features=1000, out_features=500, bias=True)
  )
)
Loading model from models/seq2seq/checkpoint
  0%|                                                                                                                                                                                                          | 0/10819 [00:00<?, ?it/s]/program_synthesis/algolisp/models/prepare_spec.py:30: UserWarning: volatile was removed and now has no effect. Use `with torch.no_grad():` instead.
  return Variable(t, volatile=volatile)
/program_synthesis/common/modules/decoders.py:183: UserWarning: volatile was removed and now has no effect. Use `with torch.no_grad():` instead.
  [0 for _ in range(batch_size)]), volatile=True)
/program_synthesis/common/modules/decoders.py:191: UserWarning: volatile was removed and now has no effect. Use `with torch.no_grad():` instead.
  last_input = Variable(ids, volatile=True)
  0%|                                                                                                                                                                                                          | 0/10819 [00:00<?, ?it/s]
Traceback (most recent call last):
  File "program_synthesis/algolisp/eval.py", line 98, in <module>
    evaluate(args)
  File "program_synthesis/algolisp/eval.py", line 80, in evaluate
    for stats in evaluation.run_inference(eval_dataset, m, current_executor):
  File "/program_synthesis/algolisp/dataset/evaluation.py", line 61, in run_inference
    for stats in model.worker_pool.imap(get_stats_from_code, zip(results, batch, [executor_]*len(batch))):
  File "/usr/src/Python-3.5.9/Lib/multiprocessing/pool.py", line 731, in next
    raise value
  File "/usr/src/Python-3.5.9/Lib/multiprocessing/pool.py", line 424, in _handle_tasks
    put(task)
  File "/usr/src/Python-3.5.9/Lib/multiprocessing/connection.py", line 206, in send
    self._send_bytes(ForkingPickler.dumps(obj))
  File "/usr/src/Python-3.5.9/Lib/multiprocessing/reduction.py", line 50, in dumps
    cls(buf, protocol).dump(obj)
AttributeError: Can't pickle local object 'load_default_lisp_units.<locals>.<lambda>'

NAPS dataset: distinguishing 'search' from 'test' IO examples

Hello,
The NAPS paper says, "Each full solution is accompanied with 2-10 inputs/outputs each split into two groups. The first group can be used in search or can be included into the problem specification
as part of the model input. The second group can be used for the evaluation at the test time."
However in the NAPS dataset, it seems that there is a single list of IO examples with the key 'tests'. How may I distinguish 'search' examples from 'test' examples?

Thanks.

Error while trying to train on AlgoLisp

Hi all, thanks for making this open-source! I was tinkering with this and wanted to train the model as per README on AlgoLisp but was running into this:

$ python train.py --model_type=seq2seq --model_dir=models/seq2seq
Traceback (most recent call last):
  File "train.py", line 12, in <module>
    from program_synthesis.algolisp import models
  File "/home/sumith/software/anaconda3/lib/python3.6/site-packages/program_synthesis/algolisp/models/__init__.py", line 2, in <module>
    from program_synthesis.algolisp.models import seq2seq_model
  File "/home/sumith/software/anaconda3/lib/python3.6/site-packages/program_synthesis/algolisp/models/seq2seq_model.py", line 24, in <module>
    from program_synthesis.algolisp.models.base import InferenceResult, MaskedMemory, get_attn_mask
  File "/home/sumith/software/anaconda3/lib/python3.6/site-packages/program_synthesis/algolisp/models/base.py", line 19, in <module>
    from program_synthesis.algolisp.tools import bleu
  File "/home/sumith/software/anaconda3/lib/python3.6/site-packages/program_synthesis/algolisp/tools/__init__.py", line 1, in <module>
    from program_synthesis.algolisp.tools.reporter import Reporter
ModuleNotFoundError: No module named 'program_synthesis.algolisp.tools.reporter'

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.