What is the borrower option in Theano

I see the following line of code:

n_train_batches = train_set_x.get_value(borrow=True).shape[0] / batch_size

In the line above, what exactly is the borrowing parameter? What is the advantage of adding this? FYI, train_set_x is basically a matrix that was generated using the anano.shared method.

+4
source share
1 answer

This part of the documentation seems relevant:

By default ( s_default) and when explicitly configured, the borrow=Falsecommon constructed variable gets a deep copy of np_array. Therefore, the changes we subsequently make to np_arraydo not affect our shared variable.

True, , "" .

+6

Source: https://habr.com/ru/post/1583780/


All Articles