Yes, you should be able to just call theano.function(...) before the loops.
On Wednesday, July 12, 2017 at 4:13:33 AM UTC-7, Kelvin Chiu wrote:
>
> for x in range(x_range):
> for y in range(y_range):
> t_test_set_x = theano_translation(test_set_x, x, y, borrow=True)
> predict_model = theano.function(inputs=[index],
> outputs=layer3.errors(y),
> givens={layer0.input:
> t_test_set_x[index * 500: (index + 1) * 500],
> y: test_set_y[index * 500:
> (index + 1) * 500]})
> for batch_value in range(0, 20, 1):
> temp_predicted_values = predict_model(batch_value)
> predicted_values = temp_predicted_values + predicted_values
>
>
> This is part of my source code. Now, the theano function is put inside 2 for
> loops. And my test set is updated in every loop. Is there anyway to put the
> theano function outside the for loop so that i can speed up the
> computational process ?
>
>
--
---
You received this message because you are subscribed to the Google Groups
"theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.