Difference between revisions of "Neural network module"

From Spinach Documentation Wiki
Jump to: navigation, search
(→‎Training your own networks)
 
(38 intermediate revisions by the same user not shown)
Line 1: Line 1:
−
''DEERNet'' is a collection of functions that make and use deep neural networks for processing DEER data. The approach is described in detail in https://dx.doi.org/10.1126/sciadv.aat5218
+
__NOTOC__
 +
''DEERNet'' (a separate GitHub repository from Spinach) is a collection of functions that make and use deep neural networks for processing DEER data. The approach is described in detail in (https://dx.doi.org/10.1126/sciadv.aat5218). The reasons why it works so well are analysed in (https://www.pnas.org/content/118/5/e2016917118). Practical guidance is given in (https://doi.org/10.1016/j.jmr.2022.107186).
  
 
==Using DEERNet==
 
==Using DEERNet==
−
Simply feed your DEER data to [[deernet.m]] or download ''[http://www.epr.ethz.ch/software.html DeerAnalysis2018]'', which is easy to use and has ''DEERNet'' integrated.
+
Import your data with [[elexsys2deernet.m]] and feed it into [[deernet.m]] - examples are provided in examples/deernet directory. You will get outputs that look like the following:
  
−
==Training your own networks==
+
[[File:deernet2_example.png]]
−
Training your own DEERNets will require uncommonly powerful hardware - IK's workstation has 32 Xeon cores, 1 TB of RAM, and three NVidia Titan V cards.
 
  
−
# Go into experiments/deernet and edit library_params.m file.
+
==Functions - DEERNet==
−
# Delete all networks from ./background and ./distances directories
 
−
# Edit training_script.m file to match your hardware configuration.
 
−
# Launch training_script.m file and hope that your computer holds up.
 
−
 
 
−
==Functions==
 
 
;[[deer_lib_gen.m]]
 
;[[deer_lib_gen.m]]
 
:Generates a library of simulated DEER data for use in neural network training and validation.
 
:Generates a library of simulated DEER data for use in neural network training and validation.
−
;[[deer_resample.m]]
 
−
:Resamples a DEER trace to fit the number of digitsation points expected by the neural network.
 
 
;[[deernet.m]]
 
;[[deernet.m]]
−
:Uses a curated ensemble of neural networks to extract the distance distribution from DEER data.
+
:Uses an ensemble of neural networks to extract distance distributions from DEER data.
−
;[[deernet_wrapper.m]]
 
−
:Compilable DEERNet wrapper for use outside Matlab and Spinach.
 
−
;[[descramble.m]]
 
−
:Weight matrix descrambling using Tikhonov smoothness criterion.
 
 
;[[dist_range.m]]
 
;[[dist_range.m]]
 
:Distance range estimation for a given time grid.
 
:Distance range estimation for a given time grid.
 
;[[elexsys2deernet.m]]
 
;[[elexsys2deernet.m]]
 
:Prepares standard Bruker Elexsys datasets for input into the [[deernet.m]] function.
 
:Prepares standard Bruker Elexsys datasets for input into the [[deernet.m]] function.
−
;[[left_diag.m]]
 
−
:Weight matrix descrambling using maximum diagonality criterion.
 
 
;[[process_using.m]]
 
;[[process_using.m]]
 
:Runs DEER data processing using a specified neural network file.
 
:Runs DEER data processing using a specified neural network file.
Line 34: Line 21:
 
:Trains a single neural network using supplied parameters.
 
:Trains a single neural network using supplied parameters.
  
 +
==Functions - descrambling==
 +
;[[descramble.m]]
 +
:Weight matrix descrambling using Tikhonov smoothness criterion.
 +
;[[left_diag.m]]
 +
:Weight matrix descrambling using maximum diagonality criterion.
 +
 +
==Custom layers and networks==
 +
;[[dist_net.m]]
 +
:Returns an untrained distance distribution DEERNet for processing fully sampled data.
 +
;[[dist_vet.m]]
 +
:Returns an untrained distance distribution DEERNet for processing sparsely sampled data.
 +
;[[logsLayer.m]]
 +
:Logsigmoidal activation function layer.
 +
;[[renormLayer.m]]
 +
:Renormalisation layer for probability distributions.
 +
 +
==Service functions==
 +
;[[DEERDatastore.m]]
 +
:Infinite datastore of DEER data for spin-1/2 electrons.
 +
;[[deerplot.m]]
 +
:Plotting subsystem of DEERNet.
 +
;[[library_dd.m]]
 +
:Training database parameters for the purely dipolar DEERNet.
 +
 +
;[[nonnans.m]]
 +
:Returns the non-NaN elements of a numerical array.
 +
;[[signal_model.m]]
 +
:DEER signal model used for DEERNet and DEERVet back-calculations.
  
−
''Version 2.5, authors: [[Ilya Kuprov]], [[Steve Worswick]], [[Jake Amey]], [[Jake Keeley]], [[Tajwar Choudhury]]''
+
''Version 2.6, authors: [[Ilya Kuprov]], [[Steve Worswick]], [[Jake Amey]], [[Jake Keeley]], [[Tajwar Choudhury]]''

Latest revision as of 13:16, 25 April 2026

DEERNet (a separate GitHub repository from Spinach) is a collection of functions that make and use deep neural networks for processing DEER data. The approach is described in detail in (https://dx.doi.org/10.1126/sciadv.aat5218). The reasons why it works so well are analysed in (https://www.pnas.org/content/118/5/e2016917118). Practical guidance is given in (https://doi.org/10.1016/j.jmr.2022.107186).

Using DEERNet

Import your data with elexsys2deernet.m and feed it into deernet.m - examples are provided in examples/deernet directory. You will get outputs that look like the following:

Deernet2 example.png

Functions - DEERNet

deer_lib_gen.m
Generates a library of simulated DEER data for use in neural network training and validation.
deernet.m
Uses an ensemble of neural networks to extract distance distributions from DEER data.
dist_range.m
Distance range estimation for a given time grid.
elexsys2deernet.m
Prepares standard Bruker Elexsys datasets for input into the deernet.m function.
process_using.m
Runs DEER data processing using a specified neural network file.
train_one_net.m
Trains a single neural network using supplied parameters.

Functions - descrambling

descramble.m
Weight matrix descrambling using Tikhonov smoothness criterion.
left_diag.m
Weight matrix descrambling using maximum diagonality criterion.

Custom layers and networks

dist_net.m
Returns an untrained distance distribution DEERNet for processing fully sampled data.
dist_vet.m
Returns an untrained distance distribution DEERNet for processing sparsely sampled data.
logsLayer.m
Logsigmoidal activation function layer.
renormLayer.m
Renormalisation layer for probability distributions.

Service functions

DEERDatastore.m
Infinite datastore of DEER data for spin-1/2 electrons.
deerplot.m
Plotting subsystem of DEERNet.
library_dd.m
Training database parameters for the purely dipolar DEERNet.
nonnans.m
Returns the non-NaN elements of a numerical array.
signal_model.m
DEER signal model used for DEERNet and DEERVet back-calculations.

Version 2.6, authors: Ilya Kuprov, Steve Worswick, Jake Amey, Jake Keeley, Tajwar Choudhury