[cctbxbb] Experimental gradients

Dalton, Kevin kmdalton at g.harvard.edu
Fri Oct 6 06:12:28 PDT 2023


Hi Kristoffer,

If you are looking to integrate your modeling with deep-learning libraries
(torch, jax, tf), you might want to have a look at SFCalculator
<https://github.com/Hekstra-Lab/SFcalculator>. It's being developed by a
graduate student, Minhuan Li, in my advisor's group.  It would give you
access to automatic differentiation if you ever want to innovate on the
refinement target function. It also supports GPU acceleration. I would say
the major downside is that algorithms like solvent masking had to be made
differentiable, and it is a newer project which is not as mature as CCTBX.



Cheers,
Kevin

On Thu, Oct 5, 2023 at 8:26 PM Pavel Afonine <pafonine at lbl.gov> wrote:

> Hi Kristoffer,
>
> CCTBX is a source of building blocks for Phenix, and Phenix has real- and
> reciprocal-space refinement programs, phenix.real_space_refine and
> phenix.refine, so the answer to your question is yes.
>
> You have not specified, but I'm assuming you are looking for gradients of
> reciprocal space refinement target (LS, ML, MLHL, etc) and real-space
> target (we have only one described here:
> https://pubmed.ncbi.nlm.nih.gov/29872004/
> <https://urldefense.proofpoint.com/v2/url?u=https-3A__pubmed.ncbi.nlm.nih.gov_29872004_&d=DwMDaQ&c=WO-RGvefibhHBZq3fL85hQ&r=30D8FbpCRRhFIowTlh1rEFMmkV5i20_4fL5nmehOS68&m=Kr-Fzcpb9IFO8sPYrtkzzeMXXL9A0uaYDFlX07gIddQf-BCoe3Qe1EZPtJPOoqaP&s=YmCd41ZAFbFw7lMImQPLoEhq49GXKHWv0RoJ_-iX53o&e=>)
> with respect to model parameters such as coordinates, ADPs (isotropic,
> anisotropic), occupancies, f' and f'', etc.
>
> Here are a few places:
>
> - reciprocal space:
>
> cctbx_project/mmtbx/refinement
>
> files:
>
> minimization.py
> occupancies.py
> rigid_body.py
> group.py
>
> regression/tst_xray_fast_gradients.py
> xray/boost_python/tst_xray.py
> regression/tst_xray_derivatives.py
>
> - real space:
>
> cctbx_project/mmtbx/refinement/real_space/individual_sites.py
> cctbx_project/cctbx/maptbx/tst_real_space_refinement_simple.py
> cctbx_project/cctbx/maptbx/target_and_gradients.h
> cctbx_project/cctbx/maptbx/real_space_refinement_simple.py
>
> Note, these are examples of high-level code that uses target function and
> its gradients to perform various kind of refinement. You'll need to do some
> detective work to trace to the low-level code that actually calculates
> gradients. Hope that's good enough starting point for you.
>
> Also, try grep for "gradient" and "target"! Usually tests (files tst*.py
> serve as good examples).
>
> Good luck!
> Pavel
>
>
> On 10/3/23 08:13, Kristoffer Lundgren wrote:
>
> Hello all,
>
>
>
> I am wondering if it is possible to use cctbx to calculate gradients from
> experimental data? Both in reciprocal and real space is of interest.
>
>
>
> Are there any code examples available somewhere showcasing how this can be
> achieved?
>
>
>
> Best regards
>
> Kristoffer Lundgren
>
> _______________________________________________
> cctbxbb mailing listcctbxbb at phenix-online.orghttp://phenix-online.org/mailman/listinfo/cctbxbb <https://urldefense.proofpoint.com/v2/url?u=http-3A__phenix-2Donline.org_mailman_listinfo_cctbxbb&d=DwMDaQ&c=WO-RGvefibhHBZq3fL85hQ&r=30D8FbpCRRhFIowTlh1rEFMmkV5i20_4fL5nmehOS68&m=Kr-Fzcpb9IFO8sPYrtkzzeMXXL9A0uaYDFlX07gIddQf-BCoe3Qe1EZPtJPOoqaP&s=xJfn2wSoFtMiJLtJXzxFvvDrAWlujEZExgjTJihJFJ0&e=>
>
> _______________________________________________
> cctbxbb mailing list
> cctbxbb at phenix-online.org
> http://phenix-online.org/mailman/listinfo/cctbxbb
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://phenix-online.org/pipermail/cctbxbb/attachments/20231006/f0894d76/attachment.htm>


More information about the cctbxbb mailing list