mail[task #7807] Speed-up of dispersion models for Clustered analysis


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by Troels E. Linnet on June 06, 2014 - 18:40:
URL:
  <http://gna.org/task/?7807>

                 Summary: Speed-up of dispersion models for Clustered analysis
                 Project: relax
            Submitted by: tlinnet
            Submitted on: Fri 06 Jun 2014 04:40:34 PM UTC
         Should Start On: Fri 06 Jun 2014 12:00:00 AM UTC
   Should be Finished on: Fri 06 Jun 2014 12:00:00 AM UTC
                Category: relax's source code
                Priority: 7 - High
                  Status: In Progress
        Percent Complete: 0%
             Assigned to: tlinnet
             Open/Closed: Open
         Discussion Lock: Any
                  Effort: 0.00

    _______________________________________________________

Details:

In the target function is looped over the number of spins.

This task is to implement the killing of this loop.

This has been discussed in:
http://thread.gmane.org/gmane.science.nmr.relax.devel/6022

Now when the inner loop has been killed, which gave a speed-up of 4x, the
outer spin loop should be killed.

This would be the most time-expensive loop, since for a clustering of
50-100 residues, this should speed it up in the same way.

The solution would be to reshape the numpy array, as close as possible to the
target function.

-------------
# Loop over the spins.
for si in range(self.num_spins):
    # Loop over the spectrometer frequencies.
    for mi in range(self.num_frq):
        # The R20 index.
        r20_index = mi + si*self.num_frq

        # Convert dw from ppm to rad/s.
        dw_frq = dw[si] * self.frqs[0][si][mi]

        # Back calculate the R2eff values.
        r2eff_CR72(r20a=R20A[r20_index], r20b=R20B[r20_index], pA=pA,
dw=dw_frq, kex=kex, cpmg_frqs=self.cpmg_frqs[0][mi][0], back_calc =
self.back_calc[0][si][mi][0], num_points=self.num_disp_points[0][si][mi][0])

        # For all missing data points, set the back-calculated value to the
measured values so that it has no effect on the chi-squared value.
        for di in range(self.num_disp_points[0][si][mi][0]):
            if self.missing[0][si][mi][0][di]:
                self.back_calc[0][si][mi][0][di] =
self.values[0][si][mi][0][di]

        # Calculate and return the chi-squared value.
        chi2_sum += chi2(self.values[0][si][mi][0],
self.back_calc[0][si][mi][0], self.errors[0][si][mi][0])

# Return the total chi-squared value.
return chi2_sum
-----------







    _______________________________________________________

Reply to this item at:

  <http://gna.org/task/?7807>

_______________________________________________
  Message sent via/by Gna!
  http://gna.org/




Related Messages


Powered by MHonArc, Updated Fri Jun 06 22:40:10 2014