comparison doc/v2_planning/api_optimization.txt @ 1108:c5c7ba805a2f

api_optimization: Edited comment - Unpacking is actually needed on each call to f/df
author Olivier Delalleau <delallea@iro>
date Mon, 13 Sep 2010 23:55:04 -0400
parents e7c52923f122
children 7c5dc11c850a
comparison
equal deleted inserted replaced
1107:e5306f5626d4 1108:c5c7ba805a2f
118 they don't have to manually pack / unpack multiple arrrays of parameters. So I 118 they don't have to manually pack / unpack multiple arrrays of parameters. So I
119 would vote in favor or having both (where the main reason to also provide a 119 would vote in favor or having both (where the main reason to also provide a
120 non-list interface would be to allow one to easily switch e.g. to scipy's 120 non-list interface would be to allow one to easily switch e.g. to scipy's
121 minimize). 121 minimize).
122 I would guess the reason scipy's interface is like this is because it makes 122 I would guess the reason scipy's interface is like this is because it makes
123 it easier for the optimization algorithm, and the packing / unpacking is 123 it easier for the optimization algorithm. However, this does not really
124 typically done only once for non-iterative algorithms. However, the first 124 matter if we are just wrapping a theano-based algorithm (that already has
125 point does not matter if we are just wrapping a theano-based algorithm that 125 to handle multiple parameters), and avoiding useless data copies on each call
126 already has to handle multiple parameters (and the second may not hold if 126 to f / df can only help speed-wise.
127 we allow iterative algorithms).
128 127
129 OD asks: Why make a difference between iterative and one-shot versions? A one-shot 128 OD asks: Why make a difference between iterative and one-shot versions? A one-shot
130 algorithm can be seen as an iterative one that stops after its first 129 algorithm can be seen as an iterative one that stops after its first
131 iteration. The difference I see between the two interfaces proposed here 130 iteration. The difference I see between the two interfaces proposed here
132 is mostly that one relies on Theano while the other one does not, but 131 is mostly that one relies on Theano while the other one does not, but