Aug 8, 2011 at 9:52 PM

Hi there, this library might be what I'm looking for... wondering if you can confirm. Let me describe my problem:

I've got a an audio processing app that takes an input audio file, processes it, and spits out a modified output audio file. This audio processing app has 10-15 parameters that affect how it processes the audio, and thus affects the content of the output audio file (it might have, say, a different frequency response, be louder, quieter, etc.). All these parameters have constrained ranges (x0 must be < 1 and > -1 for example). This app, for all intensive purposes, is a black box.

The output audio file is then evaluated by a tool (another black box) that gives it a score. This tool knows what the "ideal" output should sound like, and scores the output file accordingly. A score of 1.0 means the output is ideal, i.e. the input file was processed with the best possible parameter set. A score of 0 means the output is completely wrong.

I want to find the optimal parameter setting to get the best score on the audio files. So I'm trying to set this up with your FuncLib. I got most of it setup, with two Variables for now, a BfgsOptimizer (is this the one that I should use according to my problem?), and I've created a custom Function object. When I run the optimizer on my problem, my CustomFunction.ComputeValue() needs to take the variable "assignments" from the IEvaluation and pass them to my external audio processing app. But they are private and inaccessible so I think I'm not understanding how to use it correctly.

Any ideas? Is this possible with your library? Very easy lib to work with BTW! Very nice.


Sep 26, 2011 at 5:21 PM

Hi there

Firstly, sorry for the very late reply. I didn't see your post before now.

As for your question: Yes, you're almost right. If you build a custom function, then you have to override ComputeValue (as well as ComputeDerivative; in case of BFGS, you only need to provide first order partial derivatives). The "assignments" variables in just the inner representation of the actual point. You should use the "this" property the extract the value of a particular variable, e.g. if you have defined x as a Variable, then you may write evaluation[x] to extract the value. You can also call the ToDictionary method if you prefer to get a full copy of the internal representation. I've made many corrections since you posted your question, so you probably want to have a look at the latest version from "Source Code".

Hope you'll still consider using FuncLib, despite my very late answer... By the way, I think that Ipopt is far superior to BFGS, but of course requires slightly more work to get running. I'll consider adding the binaries to the next release.