ViennaRNA / ernwin

Sample and predict coarse grain 3D RNA structures
GNU Affero General Public License v3.0
8 stars 5 forks source link

The tracked energy and the energy used for samplin have different values after the first step. #1

Closed Bernhard10 closed 8 years ago

Bernhard10 commented 8 years ago

They accept the same measures and should - at least in the first 100 3 steps - read the background distribution from the same file. Thus they should be the same.

Bernhard10 commented 8 years ago

self.sampled_kdes.dataset changes from the first to the second iteration for the energy used for sampling, but not for the tracking energy.

This np.array is replaced by one with one additional element.

This does not happen in resample_background_kde

Bernhard10 commented 8 years ago

It seems to be the natural behaviour of scipy gaussian kdes to replace dataset[0] with an array of the same content (but differend address) during calls to k():

k=scipy.stats.gaussian_kde([1.,2,3,4,5.5,6.6,777,89,543,1,3,53,4,2,4,67,90])
hex(id(k.dataset[0])) #e.g.: '0x7f99bdd68e90
k(49)
hex(id(k.dataset[0])) # e.g. '0x7f99bdd833f0'; different adress, but same content.
Bernhard10 commented 8 years ago

calling resample_background_kde for the tracked energies helps. However, there is still a SMALL deviation.

Bernhard10 commented 8 years ago

Fixed in commit 35348b1