[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [IMP-dev] score function weights



Daniel Russel wrote:
And I'm not sure where you'd store the weight, if not in the restraint. Why not just in the Restraint base class?
The Restraint never actually uses its weight. It is a property of how the thing calling the restraint combines the weights, not of the restraint itself. And so should go with the thing calling the restraint.

But "the thing calling the restraint" is the model, which doesn't know what the weights are. So here's an example: Frido's system contains 1000 restraints, 999 of which are MM forcefield terms (bonds, angles, exclusion volumes, etc.) and the last one of which is an EM restraint. He wants to scale down just the EM restraint to 0.1, so he does (Python syntax):

myemrestraint.set_scale(0.1)
model.evaluate()

Are you suggesting that instead he should do:
model.evaluate(scale_factors=[1.0] * 999 + [0.1])
? Or am I misunderstanding what you're saying?

Another analogy: suppose instead he wanted to tweak the standard deviation of the restraint. Surely he would say:
myemrestraint.set_standard_deviation(0.1)
model.evaluate()

rather than passing the stdevs to the model. Of course, I am arguing that a scale factor and a stdev should be treated similarly here.

Plus, this way we can reuse a restraint with different weights in different places if we should so desire.

Surely the easiest way to do that is the put the restraint into two different restraint sets, each with its own weight.

	Ben
--
                      http://salilab.org/~ben/
"It is a capital mistake to theorize before one has data."
	- Sir Arthur Conan Doyle