Giter VIP home page Giter VIP logo

deepcoder's People

Contributors

dkamm 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

deepcoder's Issues

Improve performance

Current implementation is too slow beyond just python.

T=3, 100 programs

their implementation:
dfs - 500us
sort-and-add - 1ms

mine:
dfs - 38s
sort-and-add - 2640s

dfs slowdown: 76000x
sort-and-add slowdown: 2640000x

Want to get the slowdown to ~100x range (just python)

possible reasons:

  1. not caching partial results
  2. unnecessary object creations

Generate baseline results

  • refactor dfs to take in multiple input/output examples
  • consider # nodes explored instead of wall time

Not able to run

Hi,

You have changed options in gen_program.py but your readme is not updated. Can you please update it.

I am getting following errro-
gen-programs.py: error: unrecognized arguments: --max_nb_prog 100000 --out deepcoder/dataset/programs_small.txt

License ?

Hello, under what license is this project released under ? I would like to study it to learn from it. Thank you.

_pickle.PicklingError: Can't pickle <function <lambda> at 0x7fb178651c10>: attribute lookup <lambda> on deepcoder.dsl.impl failed

I got this error running: ./deepcoder/scripts/gen-datasets.sh

 File "/Users/davidlaxer/anaconda3/lib/python3.8/multiprocessing/reduction.py", line 60, in dump
    ForkingPickler(file, protocol).dump(obj)
_pickle.PicklingError: Can't pickle <function <lambda> at 0x7fb178651c10>: attribute lookup <lambda> on deepcoder.dsl.impl failed

I am on OS X Monterey 12.1 Beta, in a tensorflow-metal virtual environment.

% python --version
Python 3.8.5

% ./deepcoder/scripts/gen-datasets.sh
+ set -e
+ PROG_LENS=(1 2 3 4 5)
+ NB_TRAINS=(1000000 1000000 5000000 5000000 0)
+ NB_TESTS=(100 100 500 100 100)
+ NB_INPUTS=3
+ for idx in '${!PROG_LENS[*]}'
+ PROG_LEN=1
+ NB_TRAIN=1000000
+ NB_TEST=100
+ echo 'Generating programs T=1 #train=1000000 #test=100'
Generating programs T=1 #train=1000000 #test=100
+ OUT_PREFIX=T=1
+ TRAIN_PROG=T=1_train_programs.txt
+ TEST_PROG=T=1_test_programs.txt
+ TRAIN_OUT=T=1_train.json
+ TEST_OUT=T=1_test.json
+ python -m deepcoder.scripts.gen-programs --nb_inputs 3 --nb_train 1000000 --nb_test 100 --prog_len 1 --train_out T=1_train_programs.txt --test_out T=1_test_programs.txt --enforce_disjoint
Traceback (most recent call last):
  File "/Users/davidlaxer/anaconda3/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/Users/davidlaxer/anaconda3/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/Users/davidlaxer/deepcoder/deepcoder/scripts/gen-programs.py", line 97, in <module>
    main()
  File "/Users/davidlaxer/deepcoder/deepcoder/scripts/gen-programs.py", line 48, in main
    programs = enumerate_programs(input_type_combinations, args.prog_len,
  File "/Users/davidlaxer/deepcoder/deepcoder/search.py", line 195, in enumerate_programs
    worker.start()
  File "/Users/davidlaxer/anaconda3/lib/python3.8/multiprocessing/process.py", line 121, in start
    self._popen = self._Popen(self)
  File "/Users/davidlaxer/anaconda3/lib/python3.8/multiprocessing/context.py", line 224, in _Popen
    return _default_context.get_context().Process._Popen(process_obj)
  File "/Users/davidlaxer/anaconda3/lib/python3.8/multiprocessing/context.py", line 284, in _Popen
    return Popen(process_obj)
  File "/Users/davidlaxer/anaconda3/lib/python3.8/multiprocessing/popen_spawn_posix.py", line 32, in __init__
    super().__init__(process_obj)
  File "/Users/davidlaxer/anaconda3/lib/python3.8/multiprocessing/popen_fork.py", line 19, in __init__
    self._launch(process_obj)
  File "/Users/davidlaxer/anaconda3/lib/python3.8/multiprocessing/popen_spawn_posix.py", line 47, in _launch
    reduction.dump(process_obj, fp)
  File "/Users/davidlaxer/anaconda3/lib/python3.8/multiprocessing/reduction.py", line 60, in dump
    ForkingPickler(file, protocol).dump(obj)
_pickle.PicklingError: Can't pickle <function <lambda> at 0x7fb178651c10>: attribute lookup <lambda> on deepcoder.dsl.impl failed

Extending DSL

Any thoughts on extending the DSL to incorporate:
i. user defined function(s) from the existing DSL functions and lambdas?
ii. recursion?

Thanks in advance!

Jupyter notebook of experiments

  • 2d embedding visualization
  • neural network prediction of example program
  • training summary (not provided in paper)
  • search speedups (dfs + sort-and-add):
    • train on T = 3, test on T = 3, P = 500
    • train on T = 4, test on T = 5, P = 100
  • generalization: T_train = [1...4], T_test = [1,...,5]

Test programs are semantically disjoint from train programs where T_train <= T_test.

Each training set is composed of programs of length T (not <= T).

Code cleanup

  • Fix semantics of Variable
    • iterate_inputs typemap is called with both a dict of type -> Variable list and a dict of type -> int index list.
  • Google style guide conformance
    • Fix uses of _ (typemap vs type_map)
    • Fix uses of abbreviations (p vs program)
    • Audit direct from module imports

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.