51alg / terpret Goto Github PK
View Code? Open in Web Editor NEWLicense: Other
License: Other
I've tried running the updated NFP examples with the current TerpreT version and ended up crashing bin/fp_train:
TerpreT$ bin/fp_train.py compiled/tensorflow_models/cmbtypimm__maxInt_10__inputNum_2__inputStackSize_5__prefixLength_0__lambdaLength_3__suffixLength_2.hypers_compiled.py data/nfp/mapAddK__cmbtypimm__maxInt_10__inputNum_2__inputStackSize_5__prefixLength_0__lambdaLength_3__suffixLength_2.data.json
Construct forward graph... done in 28.66s.
Construct gradient graph... done in 77.75s.
Construct apply gradient graph... done in 0.27s.
Construct check numerics graph... done in 46.82s.
Initializing variables... done in 19.83s.
{'dirichletInitScale': 2,
'fEntropyBonusDecayRate': 0.5,
'fGradientNoise': 0.01,
'fGradientNoiseGamma': 0.55,
'gradientClipC2': 1.0,
'learning_rate': 0.1,
'learning_rate_decay': 0.9,
'minibatch_size': -1,
'momentum': 0.0,
'num_epochs': 3000,
'optimizer': 'rmsprop',
'print_frequency': 100,
'stop_below_loss': 0.005}
Traceback (most recent call last):
File "bin/fp_train.py", line 62, in <module>
train.load_and_run(args, FPTrainer)
File "/mnt/nfs/users/mabrocks/Projects/TerpreT/bin/train.py", line 109, in load_and_run
print_final_loss_breakdown=print_loss_breakdown)
File "bin/../lib/trainer.py", line 452, in train
self.do_one_update(train_batch_name)
File "bin/../lib/trainer.py", line 279, in do_one_update
results = self.sess.run(ops_to_execute, observed_vals)
File "/mnt/nfs/users/mabrocks/venvs/fpsynth/local/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 766, in run
run_metadata_ptr)
File "/mnt/nfs/users/mabrocks/venvs/fpsynth/local/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 943, in _run
% (np_val.shape, subfeed_t.name, str(subfeed_t.get_shape())))
ValueError: Cannot feed value of shape (5,) for Tensor u'Tile_1:0', which has shape '(?, ?)'
I've attached a zip with the hypers + input examples causing this.
I am recently following the program synthesis method such as the TerpreT, proposed by Microsoft. Thank you for your excellent and encouraging work. Based on the readme file, everything works correctly in the demo case (test1.py, test1_data.json, and test1_hypers.json), except some necessary adaptations between tensorflow version 0.02 to tensorflow 1.14 and python2.7 to python3.7.
However, when I applied the project to solve the basic_block problem, errors were reported. I think my procedure is correct. First of all, generate the data and hyper parameters of the graph. Then use the compile_tensorflow.py to build a "basic_block.hypers_compiled.py" file. And call the train.py to run the graph. After that, the project runs well as the screenshot below,
but after a few moment, it reports that the input arguments of the "stack" method are not consistent. ("tf.pack" should be altered to "tf.stack")
I guess the bugs lie in basic_block.hypers_compiled.py since the instruction_0, thenBlock_0, and elseBlock_0 which are Tensor objects, have no attribute named .set_to_constant. Though I have made some adaptation such as tf.zeros_like and tf.constant, I cannot fix it out.
Does anyone have ideas on these problems?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.