revalo / tree-diffusion

Diffusion on syntax trees for program synthesis
https://tree-diffusion.github.io
MIT License
385 stars 19 forks source link

Is there a predictor? #6

Open jloveric opened 1 month ago

jloveric commented 1 month ago

Do you have a simple predictor somewhere? Looking for something that takes in a simple image and then predicts the program using your model.

revalo commented 1 month ago

Not yet, I don't expect this codebase to be actually useful for turning images into programs because the DSLs are very small and narrow. If you still want to try it you can look at scripts/td_search_eval.py

The codebase is meant mostly for academic use on the technique and reproducibility + transparency of evaluation numbers in the paper.

I am working on making it easier to use it on a custom image! I just don't expect it to work on arbitrary images very well, because the DSLs just can't express them.

jloveric commented 1 month ago

Turns out we have a problem so "simple", what you have might be sufficient.

jloveric commented 1 month ago

Here is an example of an image I want to fit. Should it be able to fit this one? It seems to get sort of close, but doesn't seem to be able to solve it. It's hard to see here, but it's just a rectangle inside a 128x128 image. target_0

debuggity commented 4 weeks ago

Here is an example of an image I want to fit. Should it be able to fit this one? It seems to get sort of close, but doesn't seem to be able to solve it. It's hard to see here, but it's just a rectangle inside a 128x128 image. target_0

You might be able to solve a problem like that using a simple genetic algorithm to be honest.

jloveric commented 4 weeks ago

Yeah, we already solve it a different, very simple way, but the algorithm in this paper could lead to something better for more complicated situations.

revalo commented 4 weeks ago

I'm working on making this repository actually useful for new images! Stay tuned. I sadly fell sick right after release so it's been a bit slow.

Emasoft commented 3 weeks ago

@revalo Please get well. Your paper is very promising. Definitely a step in the right direction. Making the repo code to work well would be awesome to do research into code diffusion.