[Insight-users] threading with an optimizer

Luis Ibanez luis.ibanez at kitware.com
Mon Dec 6 00:41:59 EST 2010


Hi Matt,

On Sat, Dec 4, 2010 at 9:05 PM, Matt McCormick <matt at mmmccormick.com> wrote:
> Luis Ibanez <luis.ibanez at ...> writes:
>
>>
>> Hi Matt,
>>
>
> Thanks for the reply, Luis.
>
>> Is there a reason why you can't instantiate a separate
>> AmoebaOptimizer on each one of those threads ?
>
> I can, but I have to copy the parameters of the original somehow.  The
> parameters
> are, e.g., InitialSimplexDelta, MaximumNumberOfIterations,
> ParametersConvergenceTolerance, FunctionConvergenceTolerance.  The question is
> what is the best way to do this?  Write a copy constructor for it (would that be
> accepted upstream?)?  Some kind of copy parameters method?  Something to do the
> with vnl_amoebaFit?
>

I would think on simply copying the optimizer parameters
in the code that prepares the threads.

Note that in a similar case, in the ImageToImageMetrics,
we have required the Transforms to provide a method
called "CreateAnother()" that clones the transform, so
we can get N identical copies.   It would seem that a
similar method will be needed here for the optimizers,
but you will have to make the case that this use of the
optimizers is common enough to justify the API being
in the optimizer classes themselves and not in the
code of your filter that uses the Amoeba optimizer.


>>
>> Or what you want to do is to introduce threads inside
>> the algorithm of the AmoebaOptimizer ? e.g. for
>> running multiple evaluations of the cost function
>> simultaneously, one per thread ?
>
> No, I will have multiple instances of my cost function, each working with a
> different dataset in each thread.
>

Ok, yeap, that sounds safe enough.


    Luis



> Thanks,
> Matt
>
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>


More information about the Insight-users mailing list