mila-iqia / blocks

A Theano framework for building and training neural networks
Other
1.16k stars 351 forks source link

How to use the model? #1186

Open azureskyL opened 7 years ago

azureskyL commented 7 years ago

I follow the Introduction tutorial of Block(http://blocks.readthedocs.io/en/latest/tutorial.html) and train a model. But how to use it? I mean how to use the model finish the task describe in Introduction tutorial. ------------------------------------------------------------------------------- Training status: batch_interrupt_received: False epoch_interrupt_received: False epoch_started: False epochs_done: 1 iterations_done: 235 received_first_batch: True resumed_from: None training_started: True Log records from the iteration 235: test_cost_with_regularization: 0.657896590087 training_finish_requested: True training_finished: True

azureskyL commented 7 years ago

anyone can help me?

dmitriy-serdyuk commented 7 years ago

Sorry for a late response, everyone is busy nowadays.

Blocks just wraps Theano, so you can compile a function just like in Theano and run it for a single example. Take a look at the Model class, it is basically a computational graph. You can use its inputs and outputs to compile a function.

To apply your model to a test set, use the monitoring extension. You can run it after training (after_training=True flag for the constructor).