<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://spindynamics.org/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Worswick</id>
	<title>Spinach Documentation Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://spindynamics.org/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Worswick"/>
	<link rel="alternate" type="text/html" href="https://spindynamics.org/wiki/index.php?title=Special:Contributions/Worswick"/>
	<updated>2026-12-03T04:43:12Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.15</generator>
	<entry>
		<id>https://spindynamics.org/wiki/index.php?title=Neural_network_module&amp;diff=3015</id>
		<title>Neural network module</title>
		<link rel="alternate" type="text/html" href="https://spindynamics.org/wiki/index.php?title=Neural_network_module&amp;diff=3015"/>
		<updated>2018-07-20T15:11:55Z</updated>

		<summary type="html">&lt;p&gt;Worswick: added netset descriptions&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;New in the forthcoming version 2.2: docs being written...&lt;br /&gt;
&lt;br /&gt;
==Functions==&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;General&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
;[[deer_lib_gen.m]]&lt;br /&gt;
:Generates a library of simulated DEER data for use in neural network training and validation.&lt;br /&gt;
;[[deer_resample.m]]&lt;br /&gt;
:Resamples a suuplied DEER trace to fit the number of digitsation points expected by the neural network.&lt;br /&gt;
;[[deernet.m]]&lt;br /&gt;
:Uses a curated ensemble of neural networks to extract a distance distribution from primary DEER data.&lt;br /&gt;
;[[elexsys2deernet.m]]&lt;br /&gt;
:Prepares standard Bruker Elexsys datasets for input into the [[deernet.m]] function.&lt;br /&gt;
;[[netset_curate.m]]&lt;br /&gt;
:Evaluates an ensemble of neural networks and decides which ones are best.&lt;br /&gt;
;[[process_using.m]]&lt;br /&gt;
:Runs the DEER data processing using a specified neural network file.&lt;br /&gt;
;[[train_one_net.m]]&lt;br /&gt;
:Trains a single neural network using supplied parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Netset specific&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
;[[netset_params.m]]&lt;br /&gt;
:Adds the training set and network design parameters for a netset to the MATLAB workspace.&lt;br /&gt;
&lt;br /&gt;
==Netset folder structure==&lt;br /&gt;
All in-built functions assume a standardised directory structure for the ensemble. The trained neural networks must be saved as individual *.mat files, numbered 1 to &amp;#039;&amp;#039;n&amp;#039;&amp;#039;:&lt;br /&gt;
&lt;br /&gt;
 	1.mat&lt;br /&gt;
 	2.mat&lt;br /&gt;
 	  .&lt;br /&gt;
 	  . &lt;br /&gt;
 	n.mat&lt;br /&gt;
&lt;br /&gt;
The directory must also contain the two supporting files:&lt;br /&gt;
&lt;br /&gt;
 	good_nets.mat   - 1 x m cell array (where m &amp;lt; n). The cells &lt;br /&gt;
 			  contain character arrays holding the names&lt;br /&gt;
 			  of the networks selected by the curation&lt;br /&gt;
 			  process (See: [[netset_curate.m]]).&lt;br /&gt;
&lt;br /&gt;
 	netset_params.m - function containing the netset training&lt;br /&gt;
 			  parameters, described [[netset_params.m|here]].&lt;br /&gt;
&lt;br /&gt;
[[File:ann_diagram_deernet.PNG|750x97px|DEERNet neural network architecture]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Spinach&amp;#039;&amp;#039; includes four trained and curated ensembles of networks with the architecture shown above. For each ensemble, a set of 100 networks was trained and passed through the [[netset_curate.m|curation]] function to identify the networks with best performance.&lt;br /&gt;
*Purely dipolar systems:&lt;br /&gt;
**&amp;#039;&amp;#039;&amp;#039;net_set_any_peaks&amp;#039;&amp;#039;&amp;#039; (26 networks) - trained on the full range of peak widths.&lt;br /&gt;
**&amp;#039;&amp;#039;&amp;#039;net_set_broad_peaks&amp;#039;&amp;#039;&amp;#039; (28 networks) - optimised for broader distributions. &lt;br /&gt;
**&amp;#039;&amp;#039;&amp;#039;net_set_sharp_peaks&amp;#039;&amp;#039;&amp;#039; (21 networks) - optimised for sharper distributions.&lt;br /&gt;
&lt;br /&gt;
* Exchange coupled systems:&lt;br /&gt;
**&amp;#039;&amp;#039;&amp;#039;net_set_with_exch&amp;#039;&amp;#039;&amp;#039; (26 networks)   - trained to be resilient to an exchange interaction of ± 5 MHz.&lt;br /&gt;
&lt;br /&gt;
See the [[netset_params.m]] function within the relevant directories for detailed ensemble parameters.&lt;br /&gt;
&lt;br /&gt;
==Training parameters structure==&lt;br /&gt;
All fields required in the &amp;quot;parameters&amp;quot; structure used throughout the neural network module are listed below.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Training set parameters:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
   parameters.ntraces     - number of traces you wish to generate&lt;br /&gt;
&lt;br /&gt;
   parameters.min_dist    - lower limit of distance distributions, &lt;br /&gt;
                            Angstrom&lt;br /&gt;
 &lt;br /&gt;
   parameters.max_dist    - upper limit of distance distributions, &lt;br /&gt;
                            Angstrom&lt;br /&gt;
 &lt;br /&gt;
   parameters.max_time    - DEER trace duration, seconds&lt;br /&gt;
 &lt;br /&gt;
   parameters.max_exch    - maximum exchange coupling, MHz&lt;br /&gt;
                           (NMR convention)&lt;br /&gt;
 &lt;br /&gt;
   parameters.min_exch    - minimum exchange coupling, MHz&lt;br /&gt;
                           (NMR convention)&lt;br /&gt;
 &lt;br /&gt;
   parameters.ndistmax    - maximum number of skewed gaussians &lt;br /&gt;
                            in the distance distribution&lt;br /&gt;
 &lt;br /&gt;
   parameters.npoints     - number of digitisation points in the&lt;br /&gt;
                            DEER trace and the distance distribu-&lt;br /&gt;
                            tion&lt;br /&gt;
 &lt;br /&gt;
   parameters.noise_lvl   - RMS noise level as a fraction of the&lt;br /&gt;
                            modulation depth&lt;br /&gt;
 &lt;br /&gt;
   parameters.min_fwhm    - minimum FWHM for a skewed gaussian in&lt;br /&gt;
                            the distance distribution, fraction of&lt;br /&gt;
                            distance&lt;br /&gt;
  &lt;br /&gt;
   parameters.max_fwhm    - maximum FWHM for a skewed gaussian in&lt;br /&gt;
                            the distance distribution, fraction of&lt;br /&gt;
                            distance&lt;br /&gt;
  &lt;br /&gt;
   parameters.min_skew    - minimum shape parameter for a skewed &lt;br /&gt;
                            gaussian in the distance distribution&lt;br /&gt;
 &lt;br /&gt;
   parameters.max_skew    - maximum shape parameter for a skewed &lt;br /&gt;
                            gaussian in the distance distribution&lt;br /&gt;
   &lt;br /&gt;
   parameters.max_mdep    - minimum DEER modulation depth&lt;br /&gt;
 &lt;br /&gt;
   parameters.min_mdep    - maximum DEER modulation depth&lt;br /&gt;
 &lt;br /&gt;
   parameters.max_brate   - maximum background signal decay&lt;br /&gt;
                            rate, s^-1&lt;br /&gt;
  &lt;br /&gt;
   parameters.min_brate   - minimum background signal decay &lt;br /&gt;
                            rate, s^-1&lt;br /&gt;
  &lt;br /&gt;
   parameters.min_bdim    - minimum background dimensionality&lt;br /&gt;
  &lt;br /&gt;
   parameters.max_bdim    - maximum background dimensionality&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Network design parameters:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
   parameters.layer_sizes - number of neurons per layer, expected&lt;br /&gt;
 			   as a horizontal vector where the number&lt;br /&gt;
 			   of elements is the number of layers&lt;br /&gt;
 			   desired.&lt;br /&gt;
 &lt;br /&gt;
   parameters.lastlayer   - activation function to use in the &lt;br /&gt;
 			   neural network output layer. &lt;br /&gt;
 &lt;br /&gt;
   parameters.method      - neural network training algorithm &lt;br /&gt;
 			   selection.&lt;/div&gt;</summary>
		<author><name>Worswick</name></author>
		
	</entry>
	<entry>
		<id>https://spindynamics.org/wiki/index.php?title=Process_using.m&amp;diff=3014</id>
		<title>Process using.m</title>
		<link rel="alternate" type="text/html" href="https://spindynamics.org/wiki/index.php?title=Process_using.m&amp;diff=3014"/>
		<updated>2018-07-20T14:30:43Z</updated>

		<summary type="html">&lt;p&gt;Worswick: Created page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:process_using.m}}&lt;br /&gt;
Runs the processing on a supplied DEER trace using a specified network file.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&lt;br /&gt;
     answers=process_using(deer_traces,net_file_name)&lt;br /&gt;
&lt;br /&gt;
==Arguments==&lt;br /&gt;
&lt;br /&gt;
     deer_traces    - DEER trace(s) as a column vector or a &lt;br /&gt;
 		     matrix of multiple columns. The number &lt;br /&gt;
 		     of rows must be equal to the number of &lt;br /&gt;
 		     neurons in the network input layer.&lt;br /&gt;
&lt;br /&gt;
     net_file_name  - the name of the checkpoint file prod-&lt;br /&gt;
 		     uced during network training. &lt;br /&gt;
                      &lt;br /&gt;
&lt;br /&gt;
==Outputs==&lt;br /&gt;
&lt;br /&gt;
     answers        - distance distribution(s) as a column&lt;br /&gt;
 		     vector or a matrix of multiple colum-&lt;br /&gt;
 		     ns.The number of rows is defined by &lt;br /&gt;
 		     the number of neurons in the output &lt;br /&gt;
 		     layer of the network.&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
In the example below, a batch of 100 distribution and DEER trace pairs are generated and then&lt;br /&gt;
&lt;br /&gt;
        % Load the parameters&lt;br /&gt;
        run(&amp;#039;net_set_any_peaks/netset_params.m&amp;#039;); &lt;br /&gt;
 &lt;br /&gt;
        % Specify number of traces to produce&lt;br /&gt;
        parameters.ntraces=100;&lt;br /&gt;
  &lt;br /&gt;
        % Generate test batch&lt;br /&gt;
        [time_grid,dist_grid,dist_distr_lib,~,~,deer_trace_lib,~,~,parameters]=deer_lib_gen([],parameters);&lt;br /&gt;
 &lt;br /&gt;
        % Run the analysis on the example set&lt;br /&gt;
        answers=process_using(deer_trace_lib,&amp;#039;net_set_any_peaks/1.mat&amp;#039;);&lt;br /&gt;
&lt;br /&gt;
The network answers can be plotted against the correct answer:&lt;br /&gt;
&lt;br /&gt;
        % Plot an example&lt;br /&gt;
        example=randi(100); figure; &lt;br /&gt;
        subplot(1,2,1); plot(time_grid,deer_trace_lib(:,example)); &lt;br /&gt;
        title(&amp;#039;Input DEER trace&amp;#039;);&lt;br /&gt;
        xlabel(&amp;#039;time, $\mu$s&amp;#039;,&amp;#039;interpreter&amp;#039;,&amp;#039;LaTex&amp;#039;);&lt;br /&gt;
        subplot(1,2,2); plot(dist_grid,[answers(:,example) dist_distr_lib(:,example)]); &lt;br /&gt;
        title(&amp;#039;Output distribution&amp;#039;);&lt;br /&gt;
        xlabel(&amp;#039;distance, $\rm{\AA}$&amp;#039;,&amp;#039;interpreter&amp;#039;,&amp;#039;LaTex&amp;#039;);&lt;br /&gt;
        legend(&amp;#039;Network answer&amp;#039;,&amp;#039;True answer&amp;#039;);&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
*Input and intermediate layers must have the [[train_one_net.m#tansig_func|&amp;#039;tansig&amp;#039;]] activation function.&lt;br /&gt;
*The function supports [[train_one_net.m#logsig_func|&amp;#039;logsig&amp;#039;]] or [[train_one_net.m#tansig_func|&amp;#039;tansig&amp;#039;]] activation functions in the output layer, if a different function is detected then an error will be returned.&lt;br /&gt;
*The function assumes a simple feed-forward network topology. &lt;br /&gt;
*The number of points in the input signal must equal the input layer dimensions. &lt;br /&gt;
*The output signal length will be defined by the network output layer dimensions.&lt;br /&gt;
*Network layers are &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; required to be uniform.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
[[deernet.m]], [[netset_curate.m]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Version 2.2, authors: [[Ilya Kuprov]], [[Steve Worswick]]&amp;#039;&amp;#039;&lt;/div&gt;</summary>
		<author><name>Worswick</name></author>
		
	</entry>
	<entry>
		<id>https://spindynamics.org/wiki/index.php?title=Train_one_net.m&amp;diff=3013</id>
		<title>Train one net.m</title>
		<link rel="alternate" type="text/html" href="https://spindynamics.org/wiki/index.php?title=Train_one_net.m&amp;diff=3013"/>
		<updated>2018-07-20T13:58:49Z</updated>

		<summary type="html">&lt;p&gt;Worswick: Created page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:train_one_net.m}}&lt;br /&gt;
Constructs a MATLAB neural network object and runs the training for a single neural network. The function first generates a unique training library using supplied parameters (see [[deer_lib_gen.m]]), a neural netwok object is then constructed and the training carried out as specified in the input. &lt;br /&gt;
&lt;br /&gt;
If there is already a network with the specified name present in the directory, the function will attempt to load that network file and continue training from the checkpoint with a previously unseen training dataset. The function will sequentially train a network against multiple training sets if specified in the input.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&lt;br /&gt;
     train_one_net(parameters,trsets,file_number)&lt;br /&gt;
&lt;br /&gt;
==Arguments==&lt;br /&gt;
&lt;br /&gt;
     parameters   - structure containing training library &lt;br /&gt;
 	           and network design specifications.&lt;br /&gt;
 &lt;br /&gt;
     trsets       - size of training database to use in &lt;br /&gt;
 		   training. May be supplied as a horizontal&lt;br /&gt;
 	    	   vector to allow sequential training with&lt;br /&gt;
 		   multiple databases.&lt;br /&gt;
                     &lt;br /&gt;
     file_number  - number used as an identifier for &lt;br /&gt;
                    saving the network object.&lt;br /&gt;
&lt;br /&gt;
Three further fields are required in the parameters structure, in order to specify the neural network design:&lt;br /&gt;
&lt;br /&gt;
     parameters.layer_sizes - number of neurons per layer, expected&lt;br /&gt;
 			     as a horizontal vector where the number&lt;br /&gt;
 			     of elements is the number of hidden &lt;br /&gt;
 			     layers desired.&lt;br /&gt;
 &lt;br /&gt;
     parameters.lastlayer   - activation function to use in the &lt;br /&gt;
 			     neural network output layer. &lt;br /&gt;
 &lt;br /&gt;
     parameters.method 	   - neural network training algorithm &lt;br /&gt;
 			     selection.&lt;br /&gt;
&lt;br /&gt;
==Outputs==&lt;br /&gt;
The only output produced by this function is the network, saved as &amp;#039;&amp;#039;&amp;#039;&amp;quot;file_number&amp;quot;.mat&amp;#039;&amp;#039;&amp;#039; in the working directory.&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
The example below will train a single network using the parameters described in the [[netset_params.m]] file for the network ensemble optimized for any peak width.&lt;br /&gt;
&lt;br /&gt;
This example can be run from within &amp;#039;&amp;#039;&amp;#039;examples/deernet/&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
&lt;br /&gt;
 	% Load training set parameters&lt;br /&gt;
 	run(&amp;#039;net_set_any_peaks/netset_params.m&amp;#039;);&lt;br /&gt;
 &lt;br /&gt;
 	% Specify the sizes of training databases to train against&lt;br /&gt;
 	trsets=[160e4 160e4 160e4 160e4];&lt;br /&gt;
 &lt;br /&gt;
 	% Run the network training for a a single network&lt;br /&gt;
 	train_one_net(parameters,trsets,111);&lt;br /&gt;
&lt;br /&gt;
The function will save the output file &amp;quot;111.mat&amp;quot; to the working directory.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;NOTE:&amp;#039;&amp;#039;&amp;#039; For the network and training set dimensions used here, a high performance Nvidia GPU is required (e.g. Nvidia Tesla K40). Training set sizes may be decreased to fit on available hardware but this will sacrifice performance of the trained model.&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Computing resources&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The function requires at least one Nvidia GPU, multiple GPUs will be used where available.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Selected network design parameters&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;parameters.layer_sizes&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
This parameter is used to specify the number of hidden layers and the number of neurons per layer: &lt;br /&gt;
*the number of neurons in the first layer must be equal to the point count used in the training set ([[Neural network module#Training parameters structure|parameters.npoints]]),&lt;br /&gt;
*when the network is constructed, a final &amp;quot;output&amp;quot; layer is automatically added to the network. The number of neurons in this layer is set to be equal to the length of the output vector during training,&lt;br /&gt;
*any number and any size of intermediate layers may be specified in the parameters, we have found that networks with uniform intermediate layer achieve the best practical performance,&lt;br /&gt;
**the training process may be slightly sped up by using intermediate layers with fewer neurons, but any reduction in the dimensions comes with some degredation of network performance.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;parameters.lastlayer&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;[[File:logsig.png|thumb|200x150px|logsig activation function]]&lt;br /&gt;
&lt;br /&gt;
This parameter is used to select the activation function for the neurons in the final layer, we suggest the Logistic Sigmoid (&amp;lt;span id=&amp;quot;logsig_func&amp;quot;&amp;gt;&amp;#039;logsig&amp;#039;&amp;lt;/span&amp;gt;) activation function is used.&lt;br /&gt;
&lt;br /&gt;
*The distance distribution is a non-negative function, we have found that including this knowledge at the network level by using the non-negative Logistic Sigmoid activation function results in better performance and faster training (see supplementary  Table S1 of our [https://dx.doi.org/10.1126/sciadv.aat5218 paper]).&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;parameters.method&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
This parameter is used to select the training algorithm to employ in training. We suggest using either RPROP or SCG-BP:&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;RPROP&amp;#039;&amp;#039;&amp;#039; (MATLAB [https://uk.mathworks.com/help/nnet/ref/trainrp.html &amp;#039;trainrp&amp;#039;])- resilient backpropagation algorithm of Riedmiller and Braun.[https://dx.doi.org/10.1109/ICNN.1993.298623] &lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;SCG-BP&amp;#039;&amp;#039;&amp;#039;(MATLAB [https://uk.mathworks.com/help/nnet/ref/trainscg.html &amp;#039;trainscg&amp;#039;])- scaled conjugate gradient backpropagation algorithm of Martin Møller.[https://doi.org/10.7146/dpb.v19i339.6570]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Default network design parameters&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The parameters below are set to default values:&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Hidden layer activation function&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;[[File:tansig.png|thumb|200x150px|tansig activation function]]&lt;br /&gt;
&lt;br /&gt;
The hyperbolic tangent sigmoid (&amp;lt;span id=&amp;quot;tansig_func&amp;quot;&amp;gt;&amp;#039;tansig&amp;#039;&amp;lt;/span&amp;gt;) activation function is used in the intermediate layers.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Performance function and weight regularization&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The sum of squared errors (SSE) performance function is used, modified to penalise large learned network parameters by adding a sum of the squared weights term.&lt;br /&gt;
&lt;br /&gt;
This method is called &amp;#039;&amp;#039;weight regularization&amp;#039;&amp;#039; (or shrinkage) and is used to avoid overfitting to the training data.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Stopping criteria and data division&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;early stopping&amp;#039;&amp;#039; technique is used. The training database is divided into two subsets: &lt;br /&gt;
*Training set (70%) - used for training the network.&lt;br /&gt;
*Validation set(30%) - monitored during training in order to avoid overfitting of the network to the training set.&lt;br /&gt;
Training is stopped when the error on the validation set increases for 100 iterations while the error on the training set continues to decrease.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;Data pre- and post-processing&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
&lt;br /&gt;
Training data is generated ready for use (see [[deer_lib_gen.m]]). No pre- or post-processing of the training data is included at the the neural network level.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Functions used&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
[[deer_lib_gen.m]], [[netset_params.m]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Other related functions&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
[[deernet.m]], [[netset_curate.m]], [[process_using.m]]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
[1] M. Riedmiller, H. Braun, A Direct Adaptive Method for Faster Backpropagation&lt;br /&gt;
Learning: The RPROP Algorithm, in &amp;#039;&amp;#039;IEEE International Conference on Neural Networks&amp;#039;&amp;#039;,&lt;br /&gt;
IEEE, San Francisco, &amp;#039;&amp;#039;&amp;#039;1993&amp;#039;&amp;#039;&amp;#039;, vol. 1,pp. 586-591.&lt;br /&gt;
&lt;br /&gt;
[2] Moller, A Scaled Conjugate Gradient Algorithm for Fast Supervised Learning, &amp;#039;&amp;#039;Neural Networks&amp;#039;&amp;#039;, Vol. 6, &amp;#039;&amp;#039;&amp;#039;1993&amp;#039;&amp;#039;&amp;#039;, pp. 525–533&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Version 2.2, authors: [[Ilya Kuprov]], [[Steve Worswick]]&amp;#039;&amp;#039;&lt;/div&gt;</summary>
		<author><name>Worswick</name></author>
		
	</entry>
	<entry>
		<id>https://spindynamics.org/wiki/index.php?title=File:Ann_diagram_deernet.PNG&amp;diff=3012</id>
		<title>File:Ann diagram deernet.PNG</title>
		<link rel="alternate" type="text/html" href="https://spindynamics.org/wiki/index.php?title=File:Ann_diagram_deernet.PNG&amp;diff=3012"/>
		<updated>2018-07-20T13:41:04Z</updated>

		<summary type="html">&lt;p&gt;Worswick: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Worswick</name></author>
		
	</entry>
	<entry>
		<id>https://spindynamics.org/wiki/index.php?title=File:Tansig.png&amp;diff=3011</id>
		<title>File:Tansig.png</title>
		<link rel="alternate" type="text/html" href="https://spindynamics.org/wiki/index.php?title=File:Tansig.png&amp;diff=3011"/>
		<updated>2018-07-20T13:07:06Z</updated>

		<summary type="html">&lt;p&gt;Worswick: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Worswick</name></author>
		
	</entry>
	<entry>
		<id>https://spindynamics.org/wiki/index.php?title=File:Logsig.png&amp;diff=3010</id>
		<title>File:Logsig.png</title>
		<link rel="alternate" type="text/html" href="https://spindynamics.org/wiki/index.php?title=File:Logsig.png&amp;diff=3010"/>
		<updated>2018-07-20T13:03:39Z</updated>

		<summary type="html">&lt;p&gt;Worswick: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Worswick</name></author>
		
	</entry>
	<entry>
		<id>https://spindynamics.org/wiki/index.php?title=Deer_lib_gen.m&amp;diff=3009</id>
		<title>Deer lib gen.m</title>
		<link rel="alternate" type="text/html" href="https://spindynamics.org/wiki/index.php?title=Deer_lib_gen.m&amp;diff=3009"/>
		<updated>2018-07-20T12:43:50Z</updated>

		<summary type="html">&lt;p&gt;Worswick: Created page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:deer_lib_gen.m}}&lt;br /&gt;
Generates a library of distance distributions and corresponding simulated primary DEER traces using the parameters supplied, in a 4 step process:&lt;br /&gt;
&lt;br /&gt;
#The batch of simulated spin label distributions are generated as a randomly selected number of skew normal distributions. &lt;br /&gt;
#:&amp;lt;math&amp;gt;p(r)=\frac{2}{\sigma \sqrt{2 \pi}}e^{- \frac{(r-r_0)^2}{2 \sigma ^2}} \int_{- \infty}^{ \alpha \left (\frac{(r-r_0)}{\sigma} \right )} e^{- \frac{t^2}{2}}dt  &amp;lt;/math&amp;gt;&lt;br /&gt;
#The DEER form factor &amp;#039;&amp;#039;d&amp;#039;&amp;#039;(&amp;#039;&amp;#039;t&amp;#039;&amp;#039;) is computed from the distributions using the kernel for DEER in the presence of exchange coupling (Equation 2 in our [https://dx.doi.org/10.1126/sciadv.aat5218 paper]).&lt;br /&gt;
#:&amp;lt;math&amp;gt;\gamma(r,t)=\sqrt{\frac{\pi}{6Dt}} \left [ cos [(D+J)t]FrC \left [ \sqrt{\frac{6Dt}{\pi}} \right ] + sin [(D+J)t]FrS \left [ \sqrt{\frac{6Dt}{\pi}} \right ] \right ] &amp;lt;/math&amp;gt;&lt;br /&gt;
#Simulated background, &amp;#039;&amp;#039;b&amp;#039;&amp;#039;(&amp;#039;&amp;#039;t&amp;#039;&amp;#039;) and additive noise tracks &amp;#039;&amp;#039;n&amp;#039;&amp;#039;(&amp;#039;&amp;#039;t&amp;#039;&amp;#039;) are mixed with the DEER form factor;&lt;br /&gt;
#:&amp;lt;math&amp;gt;s(t)=[1-\lambda+\lambda d (t)]b(t)+n(t) &amp;lt;/math&amp;gt;&lt;br /&gt;
#*the background signal is generated as a stretched exponential function,&lt;br /&gt;
#:&amp;lt;math&amp;gt;b(t)=exp \left [ -(kt)^{n/3} \right ]  &amp;lt;/math&amp;gt;&lt;br /&gt;
#*the noise track is uncorrelated, representing the instrumental noise expected during the indirect acquisition in the DEER method.&lt;br /&gt;
#The distance distributions and DEER traces are then scaled to the neural network activation range:&lt;br /&gt;
#*distributions are uniformly scaled to 0.75,&lt;br /&gt;
#*DEER trace are scaled and shifted to make the first and last points equal to 1 and 0 respectively.&lt;br /&gt;
&lt;br /&gt;
For each pair in the training set the variables controlling the shape of the distance distribution; the amount of exchange coupling to include; the form of the background contribution to the signal; and the level of noise are randomly selected from the ranges provided in the [[Neural network module#Training parameters structure|parameters]] structure.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&lt;br /&gt;
     deer_lib_gen(file_name,parameters)&lt;br /&gt;
&lt;br /&gt;
     [output arguments]=deer_lib_gen(file_name,parameters)&lt;br /&gt;
&lt;br /&gt;
==Arguments==&lt;br /&gt;
&lt;br /&gt;
     file_name      - name of output *.mat file, include&lt;br /&gt;
 		     a full path to specify the output&lt;br /&gt;
 	   	     location. 		      &lt;br /&gt;
&lt;br /&gt;
     parameters     - training set parameters, with fields &lt;br /&gt;
 		     described [[Neural network module#Training parameters structure|here]].&lt;br /&gt;
&lt;br /&gt;
==Outputs==&lt;br /&gt;
The function output arguments are listed below, in the order expected:&lt;br /&gt;
&lt;br /&gt;
     time_grid      - the time axis for the DEER traces, in&lt;br /&gt;
 		     seconds. A row vector.&lt;br /&gt;
 &lt;br /&gt;
     dist_grid      - distance grid for the distributions,&lt;br /&gt;
 		     in Angstroms. A row vetor.&lt;br /&gt;
 &lt;br /&gt;
     dist_distr_lib - all distance distributions, a horizontal&lt;br /&gt;
 		     array of column vectors.&lt;br /&gt;
 &lt;br /&gt;
     deer_ffact_lib - all DEER form factors, a horizontal&lt;br /&gt;
 		     array of column vectors.&lt;br /&gt;
 &lt;br /&gt;
     background_lib - all background signals, a horizontal&lt;br /&gt;
 		     array of column vectors.&lt;br /&gt;
 &lt;br /&gt;
     deer_trace_lib - all primary DEER traces, a horizontal&lt;br /&gt;
 		     array of column vectors.&lt;br /&gt;
          &lt;br /&gt;
     noise_line_lib - all noise tracks, a horizontal array&lt;br /&gt;
                      of column vectors.&lt;br /&gt;
 &lt;br /&gt;
     exchange_lib   - exchange coupling scalar used to in&lt;br /&gt;
 		     generating each trace, a row vector.&lt;br /&gt;
 &lt;br /&gt;
     parameters     - the parameters structure, unchanged.&lt;br /&gt;
&lt;br /&gt;
The function may be called with a specified file name (including a full path), in which case the output arguments are also saved in a .mat file at that location. If the file name input is left empty then the database is not saved.             &lt;br /&gt;
&lt;br /&gt;
         file_name=[];&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
The example below first loads the netset parameters from the ensemble optimised for all peak widths, and then generates a library of 1000 trace/distribution pairs. The example may be run from the &amp;#039;&amp;#039;&amp;#039;examples/deernet/&amp;#039;&amp;#039;&amp;#039; directory.&lt;br /&gt;
&lt;br /&gt;
 	% Load the training set parameters&lt;br /&gt;
 	run(&amp;#039;net_set_any_peaks/netset_params.m&amp;#039;); &lt;br /&gt;
 &lt;br /&gt;
 	% Specify number of traces to produce&lt;br /&gt;
 	parameters.ntraces=1000;&lt;br /&gt;
 &lt;br /&gt;
 	% Set the training database name&lt;br /&gt;
 	file_name=&amp;#039;dlg_example_set.mat&amp;#039;;&lt;br /&gt;
 &lt;br /&gt;
 	% Generate the training library&lt;br /&gt;
 	[time_grid,dist_grid,dist_distr_lib,...&lt;br /&gt;
  	deer_ffact_lib,background_lib,deer_trace_lib,...&lt;br /&gt;
  	noise_line_lib,exchange_lib,parameters]=deer_lib_gen(file_name,parameters);&lt;br /&gt;
&lt;br /&gt;
This example will add the output libraries to the MATLAB workspace, as well as saving them in the working directory as &amp;#039;&amp;#039;&amp;#039;&amp;quot;dlg_example_set.mat&amp;quot;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=400 heights=300&amp;gt;&lt;br /&gt;
File:dlg_distr_example.png|frame|Example distance distribution.&lt;br /&gt;
File:dlg_trace_example.png|frame|DEER trace and components for example distribution.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
*As the dipolar modulation frequency is a cubic function of the inter-spin distance, a scaling relationship exists betweent the distance range and the duration of the DEER signal.&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\frac{t_A}{r_A^3}=\frac{t_B}{r_B^3} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*An important factor when generating data for training is the dynamic range - the ratio between the longest and shortest distances represented in the training set.&lt;br /&gt;
&lt;br /&gt;
*The training set DEER traces should be sufficiently discretised ([[Neural network module#Training parameters structure|parameters.npoints]]) to reproduce all frequencies present. &lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
[[netset_curate.m]], [[train_one_net.m]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Version 2.2, authors: [[Ilya Kuprov]], [[Steve Worswick]], [[Gunnar Jeschke]]&amp;#039;&amp;#039;&lt;/div&gt;</summary>
		<author><name>Worswick</name></author>
		
	</entry>
	<entry>
		<id>https://spindynamics.org/wiki/index.php?title=File:Dlg_trace_example.png&amp;diff=3008</id>
		<title>File:Dlg trace example.png</title>
		<link rel="alternate" type="text/html" href="https://spindynamics.org/wiki/index.php?title=File:Dlg_trace_example.png&amp;diff=3008"/>
		<updated>2018-07-20T12:06:42Z</updated>

		<summary type="html">&lt;p&gt;Worswick: Worswick uploaded a new version of File:Dlg trace example.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Worswick</name></author>
		
	</entry>
	<entry>
		<id>https://spindynamics.org/wiki/index.php?title=File:Dlg_trace_example.png&amp;diff=3007</id>
		<title>File:Dlg trace example.png</title>
		<link rel="alternate" type="text/html" href="https://spindynamics.org/wiki/index.php?title=File:Dlg_trace_example.png&amp;diff=3007"/>
		<updated>2018-07-20T11:34:21Z</updated>

		<summary type="html">&lt;p&gt;Worswick: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Worswick</name></author>
		
	</entry>
	<entry>
		<id>https://spindynamics.org/wiki/index.php?title=File:Dlg_distr_example.png&amp;diff=3006</id>
		<title>File:Dlg distr example.png</title>
		<link rel="alternate" type="text/html" href="https://spindynamics.org/wiki/index.php?title=File:Dlg_distr_example.png&amp;diff=3006"/>
		<updated>2018-07-20T11:34:05Z</updated>

		<summary type="html">&lt;p&gt;Worswick: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Worswick</name></author>
		
	</entry>
	<entry>
		<id>https://spindynamics.org/wiki/index.php?title=Neural_network_module&amp;diff=3005</id>
		<title>Neural network module</title>
		<link rel="alternate" type="text/html" href="https://spindynamics.org/wiki/index.php?title=Neural_network_module&amp;diff=3005"/>
		<updated>2018-07-19T16:06:10Z</updated>

		<summary type="html">&lt;p&gt;Worswick: formatting&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;New in the forthcoming version 2.2: docs being written...&lt;br /&gt;
&lt;br /&gt;
==Functions==&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;General&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
;[[deer_lib_gen.m]]&lt;br /&gt;
:Generates a library of simulated DEER data for use in neural network training and validation.&lt;br /&gt;
;[[deer_resample.m]]&lt;br /&gt;
:Resamples a suuplied DEER trace to fit the number of digitsation points expected by the neural network.&lt;br /&gt;
;[[deernet.m]]&lt;br /&gt;
:Uses a curated ensemble of neural networks to extract a distance distribution from primary DEER data.&lt;br /&gt;
;[[elexsys2deernet.m]]&lt;br /&gt;
:Prepares standard Bruker Elexsys datasets for input into the [[deernet.m]] function.&lt;br /&gt;
;[[netset_curate.m]]&lt;br /&gt;
:Evaluates an ensemble of neural networks and decides which ones are best.&lt;br /&gt;
;[[process_using.m]]&lt;br /&gt;
:Runs the DEER data processing using a specified neural network file.&lt;br /&gt;
;[[train_one_net.m]]&lt;br /&gt;
:Trains a single neural network using supplied parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Netset specific&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
;[[netset_params.m]]&lt;br /&gt;
:Adds the training set and network design parameters for a netset to the MATLAB workspace.&lt;br /&gt;
&lt;br /&gt;
==Netset folder structure==&lt;br /&gt;
All in-built functions assume a standardised directory structure for the ensemble. The trained neural networks must be saved as individual *.mat files, numbered 1 to &amp;#039;&amp;#039;n&amp;#039;&amp;#039;:&lt;br /&gt;
&lt;br /&gt;
 	1.mat&lt;br /&gt;
 	2.mat&lt;br /&gt;
 	  .&lt;br /&gt;
 	  . &lt;br /&gt;
 	n.mat&lt;br /&gt;
&lt;br /&gt;
The directory must also contain the two supporting files:&lt;br /&gt;
&lt;br /&gt;
 	good_nets.mat   - 1 x m cell array (where m &amp;lt; n). The cells &lt;br /&gt;
 			  contain character arrays holding the names&lt;br /&gt;
 			  of the networks selected by the curation&lt;br /&gt;
 			  process (See: [[netset_curate.m]]).&lt;br /&gt;
&lt;br /&gt;
 	netset_params.m - function containing the netset training&lt;br /&gt;
 			  parameters, described [[netset_params.m|here]].&lt;br /&gt;
&lt;br /&gt;
==Training parameters structure==&lt;br /&gt;
All fields required in the &amp;quot;parameters&amp;quot; structure used throughout the neural network module are listed below.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Training set parameters:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
   parameters.ntraces     - number of traces you wish to generate&lt;br /&gt;
&lt;br /&gt;
   parameters.min_dist    - lower limit of distance distributions, &lt;br /&gt;
                            Angstrom&lt;br /&gt;
 &lt;br /&gt;
   parameters.max_dist    - upper limit of distance distributions, &lt;br /&gt;
                            Angstrom&lt;br /&gt;
 &lt;br /&gt;
   parameters.max_time    - DEER trace duration, seconds&lt;br /&gt;
 &lt;br /&gt;
   parameters.max_exch    - maximum exchange coupling, MHz&lt;br /&gt;
                           (NMR convention)&lt;br /&gt;
 &lt;br /&gt;
   parameters.min_exch    - minimum exchange coupling, MHz&lt;br /&gt;
                           (NMR convention)&lt;br /&gt;
 &lt;br /&gt;
   parameters.ndistmax    - maximum number of skewed gaussians &lt;br /&gt;
                            in the distance distribution&lt;br /&gt;
 &lt;br /&gt;
   parameters.npoints     - number of digitisation points in the&lt;br /&gt;
                            DEER trace and the distance distribu-&lt;br /&gt;
                            tion&lt;br /&gt;
 &lt;br /&gt;
   parameters.noise_lvl   - RMS noise level as a fraction of the&lt;br /&gt;
                            modulation depth&lt;br /&gt;
 &lt;br /&gt;
   parameters.min_fwhm    - minimum FWHM for a skewed gaussian in&lt;br /&gt;
                            the distance distribution, fraction of&lt;br /&gt;
                            distance&lt;br /&gt;
  &lt;br /&gt;
   parameters.max_fwhm    - maximum FWHM for a skewed gaussian in&lt;br /&gt;
                            the distance distribution, fraction of&lt;br /&gt;
                            distance&lt;br /&gt;
  &lt;br /&gt;
   parameters.min_skew    - minimum shape parameter for a skewed &lt;br /&gt;
                            gaussian in the distance distribution&lt;br /&gt;
 &lt;br /&gt;
   parameters.max_skew    - maximum shape parameter for a skewed &lt;br /&gt;
                            gaussian in the distance distribution&lt;br /&gt;
   &lt;br /&gt;
   parameters.max_mdep    - minimum DEER modulation depth&lt;br /&gt;
 &lt;br /&gt;
   parameters.min_mdep    - maximum DEER modulation depth&lt;br /&gt;
 &lt;br /&gt;
   parameters.max_brate   - maximum background signal decay&lt;br /&gt;
                            rate, s^-1&lt;br /&gt;
  &lt;br /&gt;
   parameters.min_brate   - minimum background signal decay &lt;br /&gt;
                            rate, s^-1&lt;br /&gt;
  &lt;br /&gt;
   parameters.min_bdim    - minimum background dimensionality&lt;br /&gt;
  &lt;br /&gt;
   parameters.max_bdim    - maximum background dimensionality&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Network design parameters:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
   parameters.layer_sizes - number of neurons per layer, expected&lt;br /&gt;
 			   as a horizontal vector where the number&lt;br /&gt;
 			   of elements is the number of layers&lt;br /&gt;
 			   desired.&lt;br /&gt;
 &lt;br /&gt;
   parameters.lastlayer   - activation function to use in the &lt;br /&gt;
 			   neural network output layer. &lt;br /&gt;
 &lt;br /&gt;
   parameters.method      - neural network training algorithm &lt;br /&gt;
 			   selection.&lt;/div&gt;</summary>
		<author><name>Worswick</name></author>
		
	</entry>
	<entry>
		<id>https://spindynamics.org/wiki/index.php?title=Neural_network_module&amp;diff=3003</id>
		<title>Neural network module</title>
		<link rel="alternate" type="text/html" href="https://spindynamics.org/wiki/index.php?title=Neural_network_module&amp;diff=3003"/>
		<updated>2018-07-19T15:33:21Z</updated>

		<summary type="html">&lt;p&gt;Worswick: formatting&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;New in the forthcoming version 2.2: docs being written...&lt;br /&gt;
&lt;br /&gt;
==Functions==&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;General&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
;[[deer_lib_gen.m]]&lt;br /&gt;
:Generates a library of simulated DEER data for use in neural network training and validation.&lt;br /&gt;
;[[deer_resample.m]]&lt;br /&gt;
:Resamples a suuplied DEER trace to fit the number of digitsation points expected by the neural network.&lt;br /&gt;
;[[deernet.m]]&lt;br /&gt;
:Uses a curated ensemble of neural networks to extract a distance distribution from primary DEER data.&lt;br /&gt;
;[[elexsys2deernet.m]]&lt;br /&gt;
:Prepares standard Bruker Elexsys datasets for input into the [[deernet.m]] function.&lt;br /&gt;
;[[netset_curate.m]]&lt;br /&gt;
:Evaluates an ensemble of neural networks and decides which ones are best.&lt;br /&gt;
;[[process_using.m]]&lt;br /&gt;
:Runs the DEER data processing using a specified neural network file.&lt;br /&gt;
;[[train_one_net.m]]&lt;br /&gt;
:Trains a single neural network using supplied parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Netset specific&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
;[[netset_params.m]]&lt;br /&gt;
:Adds the training set and network design parameters for a netset to the MATLAB workspace.&lt;br /&gt;
&lt;br /&gt;
==Netset folder structure==&lt;br /&gt;
All in-built functions assume a standardised directory structure for the ensemble. The trained neural networks must be saved as individual *.mat files, numbered 1 to &amp;#039;&amp;#039;n&amp;#039;&amp;#039;:&lt;br /&gt;
&lt;br /&gt;
 	1.mat&lt;br /&gt;
 	2.mat&lt;br /&gt;
 	  .&lt;br /&gt;
 	  . &lt;br /&gt;
 	n.mat&lt;br /&gt;
&lt;br /&gt;
The directory must also contain the two supporting files:&lt;br /&gt;
&lt;br /&gt;
 	good_nets.mat   - 1 x m cell array (where m &amp;lt; n). The cells &lt;br /&gt;
 			  contain character arrays holding the names&lt;br /&gt;
 			  of the networks selected by the curation&lt;br /&gt;
 			  process (See: [[netset_curate.m]]).&lt;br /&gt;
&lt;br /&gt;
 	netset_params.m - function containing the netset training&lt;br /&gt;
 			  parameters, described [[netset_params.m|here]].&lt;br /&gt;
&lt;br /&gt;
==Training parameters structure==&lt;br /&gt;
All fields required in the &amp;quot;parameters&amp;quot; structure used throughout the neural network module are listed below.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Training set parameters:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
   parameters.min_dist    - lower limit of distance distributions, &lt;br /&gt;
                            Angstrom&lt;br /&gt;
 &lt;br /&gt;
   parameters.max_dist    - upper limit of distance distributions, &lt;br /&gt;
                            Angstrom&lt;br /&gt;
 &lt;br /&gt;
   parameters.max_time    - DEER trace duration, seconds&lt;br /&gt;
 &lt;br /&gt;
   parameters.max_exch    - maximum exchange coupling, MHz&lt;br /&gt;
                           (NMR convention)&lt;br /&gt;
 &lt;br /&gt;
   parameters.min_exch    - minimum exchange coupling, MHz&lt;br /&gt;
                           (NMR convention)&lt;br /&gt;
 &lt;br /&gt;
   parameters.ntraces     - number of traces you wish to generate&lt;br /&gt;
 &lt;br /&gt;
   parameters.ndistmax    - maximum number of skewed gaussians &lt;br /&gt;
                            in the distance distribution&lt;br /&gt;
 &lt;br /&gt;
   parameters.npoints     - number of digitisation points in the&lt;br /&gt;
                            DEER trace and the distance distribu-&lt;br /&gt;
                            tion&lt;br /&gt;
 &lt;br /&gt;
   parameters.noise_lvl   - RMS noise level as a fraction of the&lt;br /&gt;
                            modulation depth&lt;br /&gt;
 &lt;br /&gt;
   parameters.min_fwhm    - minimum FWHM for a skewed gaussian in&lt;br /&gt;
                            the distance distribution, fraction of&lt;br /&gt;
                            distance&lt;br /&gt;
  &lt;br /&gt;
   parameters.max_fwhm    - maximum FWHM for a skewed gaussian in&lt;br /&gt;
                            the distance distribution, fraction of&lt;br /&gt;
                            distance&lt;br /&gt;
  &lt;br /&gt;
   parameters.min_skew    - minimum shape parameter for a skewed &lt;br /&gt;
                            gaussian in the distance distribution&lt;br /&gt;
 &lt;br /&gt;
   parameters.max_skew    - maximum shape parameter for a skewed &lt;br /&gt;
                            gaussian in the distance distribution&lt;br /&gt;
   &lt;br /&gt;
   parameters.max_mdep    - minimum DEER modulation depth&lt;br /&gt;
 &lt;br /&gt;
   parameters.min_mdep    - maximum DEER modulation depth&lt;br /&gt;
 &lt;br /&gt;
   parameters.max_brate   - maximum background signal decay&lt;br /&gt;
                            rate, s^-1&lt;br /&gt;
  &lt;br /&gt;
   parameters.min_brate   - minimum background signal decay &lt;br /&gt;
                            rate, s^-1&lt;br /&gt;
  &lt;br /&gt;
   parameters.min_bdim    - minimum background dimensionality&lt;br /&gt;
  &lt;br /&gt;
   parameters.max_bdim    - maximum background dimensionality&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Network design parameters:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
   parameters.layer_sizes - number of neurons per layer, expected&lt;br /&gt;
 			   as a horizontal vector where the number&lt;br /&gt;
 			   of elements is the number of layers&lt;br /&gt;
 			   desired.&lt;br /&gt;
 &lt;br /&gt;
   parameters.lastlayer   - activation function to use in the &lt;br /&gt;
 			   neural network output layer. &lt;br /&gt;
 &lt;br /&gt;
   parameters.method      - neural network training algorithm &lt;br /&gt;
 			   selection.&lt;/div&gt;</summary>
		<author><name>Worswick</name></author>
		
	</entry>
	<entry>
		<id>https://spindynamics.org/wiki/index.php?title=Deernet.m&amp;diff=3002</id>
		<title>Deernet.m</title>
		<link rel="alternate" type="text/html" href="https://spindynamics.org/wiki/index.php?title=Deernet.m&amp;diff=3002"/>
		<updated>2018-07-19T15:24:52Z</updated>

		<summary type="html">&lt;p&gt;Worswick: Created page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:deernet.m}}&lt;br /&gt;
Extracts a distance distribution from primary DEER data using a supplied ensemble of trained neural networks. The experimental DEER trace is first reshaped to match the data expected by the neural networks. This involves normalising the trace to decay from a maximum of 1 to 0, between t=0 and t=t&amp;lt;sub&amp;gt;max&amp;lt;/sub&amp;gt;; and then resampling so that the DEER trace is discretised to a grid matching the dimensions defined by the network input layer (see: [[deer_resample.m]]).&lt;br /&gt;
&lt;br /&gt;
The DEER trace is then presented to each network in the supplied ensemble to obtain the individual responses. The ensemble output is found as the mean response for each point in the distribution; and 95% confidence bounds are computed using the standard deviation of the individual responses. A detailed description of the use of the ensemble responses as an uncertainty estimate is provided in Section 2.6 of our paper (https://dx.doi.org/10.1126/sciadv.aat5218).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&lt;br /&gt;
     deernet(deer_trace,time_axis,net_dir)&lt;br /&gt;
&lt;br /&gt;
     [dist_axis,outcomes]=deernet(deer_trace,time_axis,net_dir)&lt;br /&gt;
&lt;br /&gt;
==Arguments==&lt;br /&gt;
&lt;br /&gt;
     deer_trace    - the real experimental DEER trace, as a column &lt;br /&gt;
 		    vector.&lt;br /&gt;
 &lt;br /&gt;
     time_axis     - experimental time axis, a column vector in &lt;br /&gt;
 		    microseconds, must start at zero and have&lt;br /&gt;
 		    a uniform time step.&lt;br /&gt;
 &lt;br /&gt;
     net_dir       - directory containing a curated network ensemble,&lt;br /&gt;
 		    as multiple *.mat files and the supporting files.&lt;br /&gt;
 		    (see: [[Neural network module#Netset folder structure|Netset folder structure]])&lt;br /&gt;
&lt;br /&gt;
==Outputs==&lt;br /&gt;
If no output is requested then the function produces a plot as in the example below. The function may also be called with the following output arguments specified:&lt;br /&gt;
&lt;br /&gt;
     dist_axis     - the distance axis, as a column vector in &lt;br /&gt;
 		    Angstroms.&lt;br /&gt;
 &lt;br /&gt;
     outcomes      - output distance distributions, a horizontal&lt;br /&gt;
 		    array of column vectors. Where each column is the&lt;br /&gt;
 		    response of a single network from the ensemble.&lt;br /&gt;
&lt;br /&gt;
If the outputs are requested then in-built plotting is suppressed.&lt;br /&gt;
 		    &lt;br /&gt;
==Examples==&lt;br /&gt;
The example below shows the use of DEERNet to extract a distance distribution for Sample V (as described in our [https://dx.doi.org/10.1126/sciadv.aat5218 paper] on the subject). This example may be run from within &amp;#039;&amp;#039;&amp;#039;examples/deernet/&amp;#039;&amp;#039;&amp;#039;. First the network ensemble optimized for processing any width of distribution is selected:&lt;br /&gt;
&lt;br /&gt;
     % Select the network ensemble to use in analysis&lt;br /&gt;
     netset_location=&amp;#039;net_set_any_peaks&amp;#039;;&lt;br /&gt;
&lt;br /&gt;
The experimental data is loaded, and the time axis is converted to microseconds:&lt;br /&gt;
&lt;br /&gt;
     % Load experimental data&lt;br /&gt;
     expt_data=load(&amp;#039;sample_set_paper/sample_V_DEERNet_input.dat&amp;#039;,&amp;#039;-ASCII&amp;#039;);&lt;br /&gt;
     deer_trace=expt_data(:,2);&lt;br /&gt;
     time_axis=expt_data(:,1)*1e-6;&lt;br /&gt;
&lt;br /&gt;
The data is then presented to the selected network ensemble:&lt;br /&gt;
&lt;br /&gt;
     % Run deernet analysis&lt;br /&gt;
     deernet(deer_trace,time_axis,netset_location);&lt;br /&gt;
&lt;br /&gt;
With no output arguments requested in the call to DEERNet, the following plot is produced.&lt;br /&gt;
&lt;br /&gt;
[[file:deernet_sampleV.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Further examples are available under &amp;#039;&amp;#039;&amp;#039;examples/deernet/&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;example_set_paper.m&amp;#039;&amp;#039;&amp;#039; - The six examples used in the [https://dx.doi.org/10.1126/sciadv.aat5218 paper] on DEERNet.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;example_set_deeran.m&amp;#039;&amp;#039;&amp;#039; - Selection of the examples included with the [https://doi.org/10.1007/BF03166213 DeerAnalysis] package. &lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;example_set_exchange.m&amp;#039;&amp;#039;&amp;#039; - Examples of DEER traces in the presence of significant exchange interaction. Data provided by Sabine Richert &amp;#039;&amp;#039;et al&amp;#039;&amp;#039;., from the supplementary information of their paper available [http://dx.doi.org/10.1038/ncomms14842 here].&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Data pre-processing&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
[[file:deernet_preprocess.png]]&lt;br /&gt;
&lt;br /&gt;
The provided neural networks are trained using libraries of simulated DEER traces uniformly scaled to decay from the maximum at time zero. This means that experimental data may need to be shifted accordingly before presenting to the network, demonstrated in the figure above.&lt;br /&gt;
&lt;br /&gt;
This is the only pre-processing required by DEERNet; scaling and resampling of the data are performed internally and the networks have been trained to compensate for background contributions and instrumental noise.&lt;br /&gt;
&lt;br /&gt;
(This processing is performed within the [[elexsys2deernet.m]] function for standard Bruker datasets)&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Functions used&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
[[deer_resample.m]], [[netset_params.m]], [[process_using.m]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Other related functions&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
[[deer_lib_gen.m]], [[netset_curate.m]], [[train_one_net.m]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Version 2.2, authors: [[Ilya Kuprov]], [[Steve Worswick]], [[Gunnar Jeschke]]&amp;#039;&amp;#039;&lt;/div&gt;</summary>
		<author><name>Worswick</name></author>
		
	</entry>
	<entry>
		<id>https://spindynamics.org/wiki/index.php?title=Neural_network_module&amp;diff=3001</id>
		<title>Neural network module</title>
		<link rel="alternate" type="text/html" href="https://spindynamics.org/wiki/index.php?title=Neural_network_module&amp;diff=3001"/>
		<updated>2018-07-19T15:05:12Z</updated>

		<summary type="html">&lt;p&gt;Worswick: updated function list&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;New in the forthcoming version 2.2: docs being written...&lt;br /&gt;
&lt;br /&gt;
==Functions==&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;General&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
;[[deer_lib_gen.m]]&lt;br /&gt;
:Generates a library of simulated DEER data for use in neural network training and validation.&lt;br /&gt;
;[[deer_resample.m]]&lt;br /&gt;
:Resamples a suuplied DEER trace to fit the number of digitsation points expected by the neural network.&lt;br /&gt;
;[[deernet.m]]&lt;br /&gt;
:Uses a curated ensemble of neural networks to extract a distance distribution from primary DEER data.&lt;br /&gt;
;[[elexsys2deernet.m]]&lt;br /&gt;
:Prepares standard Bruker Elexsys datasets for input into the [[deernet.m]] function.&lt;br /&gt;
;[[netset_curate.m]]&lt;br /&gt;
:Evaluates an ensemble of neural networks and decides which ones are best.&lt;br /&gt;
;[[process_using.m]]&lt;br /&gt;
:Runs the DEER data processing using a specified neural network file.&lt;br /&gt;
;[[train_one_net.m]]&lt;br /&gt;
:Trains a single neural network using supplied parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Netset specific&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
;[[netset_params.m]]&lt;br /&gt;
:Adds the training set and network design parameters for a netset to the MATLAB workspace.&lt;br /&gt;
&lt;br /&gt;
==Netset folder structure==&lt;br /&gt;
All in-built functions assume a standardised directory structure for the ensemble. The trained neural networks must be saved as individual *.mat files, numbered 1 to &amp;#039;&amp;#039;n&amp;#039;&amp;#039;:&lt;br /&gt;
&lt;br /&gt;
 	1.mat&lt;br /&gt;
 	2.mat&lt;br /&gt;
 	  .&lt;br /&gt;
 	  . &lt;br /&gt;
 	n.mat&lt;br /&gt;
&lt;br /&gt;
The directory must also contain the two supporting files:&lt;br /&gt;
&lt;br /&gt;
 	good_nets.mat   - 1 x m cell array (where m &amp;lt; n). The cells &lt;br /&gt;
 			  contain character arrays holding the names&lt;br /&gt;
 			  of the networks selected by the curation&lt;br /&gt;
 			  process (See: [[netset_curate.m]]).&lt;br /&gt;
&lt;br /&gt;
 	netset_params.m - function containing the netset training&lt;br /&gt;
 			  parameters, described [[netset_params.m|here]].&lt;br /&gt;
&lt;br /&gt;
==Training parameters structure==&lt;br /&gt;
All fields required in the &amp;quot;parameters&amp;quot; structure used throughout the neural network module are listed below.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Training set parameters:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
   parameters.min_dist    - lower limit of distance distributions, &lt;br /&gt;
                            Angstrom&lt;br /&gt;
 &lt;br /&gt;
   parameters.max_dist    - upper limit of distance distributions, &lt;br /&gt;
                            Angstrom&lt;br /&gt;
 &lt;br /&gt;
   parameters.max_time    - DEER trace duration, seconds&lt;br /&gt;
 &lt;br /&gt;
   parameters.max_exch    - maximum exchange coupling, MHz&lt;br /&gt;
                           (NMR convention)&lt;br /&gt;
 &lt;br /&gt;
   parameters.min_exch    - minimum exchange coupling, MHz&lt;br /&gt;
                           (NMR convention)&lt;br /&gt;
 &lt;br /&gt;
   parameters.ntraces     - number of traces you wish to generate&lt;br /&gt;
 &lt;br /&gt;
   parameters.ndistmax    - maximum number of skewed gaussians &lt;br /&gt;
                            in the distance distribution&lt;br /&gt;
 &lt;br /&gt;
   parameters.npoints     - number of digitisation points in the&lt;br /&gt;
                            DEER trace and the distance distribu-&lt;br /&gt;
                            tion&lt;br /&gt;
 &lt;br /&gt;
   parameters.noise_lvl   - RMS noise level as a fraction of the&lt;br /&gt;
                            modulation depth&lt;br /&gt;
 &lt;br /&gt;
   parameters.min_fwhm    - minimum FWHM for a skewed gaussian in&lt;br /&gt;
                            the distance distribution, fraction of&lt;br /&gt;
                            distance&lt;br /&gt;
  &lt;br /&gt;
   parameters.max_fwhm    - maximum FWHM for a skewed gaussian in&lt;br /&gt;
                            the distance distribution, fraction of&lt;br /&gt;
                            distance&lt;br /&gt;
  &lt;br /&gt;
   parameters.min_skew    - minimum shape parameter for a skewed &lt;br /&gt;
                            gaussian in the distance distribution&lt;br /&gt;
 &lt;br /&gt;
   parameters.max_skew    - maximum shape parameter for a skewed &lt;br /&gt;
                            gaussian in the distance distribution&lt;br /&gt;
   &lt;br /&gt;
   parameters.max_mdep    - minimum DEER modulation depth&lt;br /&gt;
 &lt;br /&gt;
   parameters.min_mdep    - maximum DEER modulation depth&lt;br /&gt;
 &lt;br /&gt;
   parameters.max_brate   - maximum background signal decay&lt;br /&gt;
                            rate, s^-1&lt;br /&gt;
  &lt;br /&gt;
   parameters.min_brate   - minimum background signal decay &lt;br /&gt;
                            rate, s^-1&lt;br /&gt;
  &lt;br /&gt;
   parameters.min_bdim    - minimum background dimensionality&lt;br /&gt;
  &lt;br /&gt;
   parameters.max_bdim    - maximum background dimensionality&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Network design parameters:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
   parameters.layer_sizes - number of neurons per layer, expected&lt;br /&gt;
 			    as a horizontal vector where the number&lt;br /&gt;
 			    of elements is the number of layers&lt;br /&gt;
 			    desired.&lt;br /&gt;
 &lt;br /&gt;
   parameters.lastlayer   - activation function to use in the &lt;br /&gt;
 			    neural network output layer. &lt;br /&gt;
 &lt;br /&gt;
   parameters.method      - neural network training algorithm &lt;br /&gt;
 			    selection.&lt;/div&gt;</summary>
		<author><name>Worswick</name></author>
		
	</entry>
	<entry>
		<id>https://spindynamics.org/wiki/index.php?title=Neural_network_module&amp;diff=3000</id>
		<title>Neural network module</title>
		<link rel="alternate" type="text/html" href="https://spindynamics.org/wiki/index.php?title=Neural_network_module&amp;diff=3000"/>
		<updated>2018-07-19T15:01:05Z</updated>

		<summary type="html">&lt;p&gt;Worswick: created section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;New in the forthcoming version 2.2: docs being written...&lt;br /&gt;
&lt;br /&gt;
==Functions==&lt;br /&gt;
;[[deer_lib_gen.m]]&lt;br /&gt;
:Generates a library of distance distributions and corresponding simulated DEER traces for use in neural network training and validation.&lt;br /&gt;
;[[deer_resample.m]]&lt;br /&gt;
:Resample DEER trace to fit the number of digitsation points expected by the neural network.&lt;br /&gt;
;[[deernet.m]]&lt;br /&gt;
:Uses a curated ensemble of neural networks to extract a distance distribution from primary DEER data.&lt;br /&gt;
;[[elexsys2deernet.m]]&lt;br /&gt;
:Prepares experimental data - saved in the Bruker Elexsys format - for input into the [[deernet.m]] function.&lt;br /&gt;
;[[netset_curate.m]]&lt;br /&gt;
:Evaluates an ensemble of neural networks and decides which ones are best.&lt;br /&gt;
;[[process_using.m]]&lt;br /&gt;
:Runs the DEER data processing using a specified neural network file.&lt;br /&gt;
;[[train_one_net.m]]&lt;br /&gt;
:Constructs a network object, generates a training library (see [[deer_lib_gen.m]]), and runs the network training - following supplied parameters.&lt;br /&gt;
&lt;br /&gt;
==Netset folder structure==&lt;br /&gt;
All in-built functions assume a standardised directory structure for the ensemble. The trained neural networks must be saved as individual *.mat files, numbered 1 to &amp;#039;&amp;#039;n&amp;#039;&amp;#039;:&lt;br /&gt;
&lt;br /&gt;
 	1.mat&lt;br /&gt;
 	2.mat&lt;br /&gt;
 	  .&lt;br /&gt;
 	  . &lt;br /&gt;
 	n.mat&lt;br /&gt;
&lt;br /&gt;
The directory must also contain the two supporting files:&lt;br /&gt;
&lt;br /&gt;
 	good_nets.mat   - 1 x m cell array (where m &amp;lt; n). The cells &lt;br /&gt;
 			  contain character arrays holding the names&lt;br /&gt;
 			  of the networks selected by the curation&lt;br /&gt;
 			  process (See: [[netset_curate.m]]).&lt;br /&gt;
&lt;br /&gt;
 	netset_params.m - function containing the netset training&lt;br /&gt;
 			  parameters, described [[netset_params.m|here]].&lt;br /&gt;
&lt;br /&gt;
==Training parameters structure==&lt;br /&gt;
All fields required in the &amp;quot;parameters&amp;quot; structure used throughout the neural network module are listed below.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Training set parameters:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
   parameters.min_dist    - lower limit of distance distributions, &lt;br /&gt;
                            Angstrom&lt;br /&gt;
 &lt;br /&gt;
   parameters.max_dist    - upper limit of distance distributions, &lt;br /&gt;
                            Angstrom&lt;br /&gt;
 &lt;br /&gt;
   parameters.max_time    - DEER trace duration, seconds&lt;br /&gt;
 &lt;br /&gt;
   parameters.max_exch    - maximum exchange coupling, MHz&lt;br /&gt;
                           (NMR convention)&lt;br /&gt;
 &lt;br /&gt;
   parameters.min_exch    - minimum exchange coupling, MHz&lt;br /&gt;
                           (NMR convention)&lt;br /&gt;
 &lt;br /&gt;
   parameters.ntraces     - number of traces you wish to generate&lt;br /&gt;
 &lt;br /&gt;
   parameters.ndistmax    - maximum number of skewed gaussians &lt;br /&gt;
                            in the distance distribution&lt;br /&gt;
 &lt;br /&gt;
   parameters.npoints     - number of digitisation points in the&lt;br /&gt;
                            DEER trace and the distance distribu-&lt;br /&gt;
                            tion&lt;br /&gt;
 &lt;br /&gt;
   parameters.noise_lvl   - RMS noise level as a fraction of the&lt;br /&gt;
                            modulation depth&lt;br /&gt;
 &lt;br /&gt;
   parameters.min_fwhm    - minimum FWHM for a skewed gaussian in&lt;br /&gt;
                            the distance distribution, fraction of&lt;br /&gt;
                            distance&lt;br /&gt;
  &lt;br /&gt;
   parameters.max_fwhm    - maximum FWHM for a skewed gaussian in&lt;br /&gt;
                            the distance distribution, fraction of&lt;br /&gt;
                            distance&lt;br /&gt;
  &lt;br /&gt;
   parameters.min_skew    - minimum shape parameter for a skewed &lt;br /&gt;
                            gaussian in the distance distribution&lt;br /&gt;
 &lt;br /&gt;
   parameters.max_skew    - maximum shape parameter for a skewed &lt;br /&gt;
                            gaussian in the distance distribution&lt;br /&gt;
   &lt;br /&gt;
   parameters.max_mdep    - minimum DEER modulation depth&lt;br /&gt;
 &lt;br /&gt;
   parameters.min_mdep    - maximum DEER modulation depth&lt;br /&gt;
 &lt;br /&gt;
   parameters.max_brate   - maximum background signal decay&lt;br /&gt;
                            rate, s^-1&lt;br /&gt;
  &lt;br /&gt;
   parameters.min_brate   - minimum background signal decay &lt;br /&gt;
                            rate, s^-1&lt;br /&gt;
  &lt;br /&gt;
   parameters.min_bdim    - minimum background dimensionality&lt;br /&gt;
  &lt;br /&gt;
   parameters.max_bdim    - maximum background dimensionality&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Network design parameters:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
   parameters.layer_sizes - number of neurons per layer, expected&lt;br /&gt;
 			    as a horizontal vector where the number&lt;br /&gt;
 			    of elements is the number of layers&lt;br /&gt;
 			    desired.&lt;br /&gt;
 &lt;br /&gt;
   parameters.lastlayer   - activation function to use in the &lt;br /&gt;
 			    neural network output layer. &lt;br /&gt;
 &lt;br /&gt;
   parameters.method      - neural network training algorithm &lt;br /&gt;
 			    selection.&lt;/div&gt;</summary>
		<author><name>Worswick</name></author>
		
	</entry>
	<entry>
		<id>https://spindynamics.org/wiki/index.php?title=Neural_network_module&amp;diff=2999</id>
		<title>Neural network module</title>
		<link rel="alternate" type="text/html" href="https://spindynamics.org/wiki/index.php?title=Neural_network_module&amp;diff=2999"/>
		<updated>2018-07-19T14:57:41Z</updated>

		<summary type="html">&lt;p&gt;Worswick: created section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;New in the forthcoming version 2.2: docs being written...&lt;br /&gt;
&lt;br /&gt;
==Functions==&lt;br /&gt;
;[[deer_lib_gen.m]]&lt;br /&gt;
:Generates a library of distance distributions and corresponding simulated DEER traces for use in neural network training and validation.&lt;br /&gt;
;[[deer_resample.m]]&lt;br /&gt;
:Resample DEER trace to fit the number of digitsation points expected by the neural network.&lt;br /&gt;
;[[deernet.m]]&lt;br /&gt;
:Uses a curated ensemble of neural networks to extract a distance distribution from primary DEER data.&lt;br /&gt;
;[[elexsys2deernet.m]]&lt;br /&gt;
:Prepares experimental data - saved in the Bruker Elexsys format - for input into the [[deernet.m]] function.&lt;br /&gt;
;[[netset_curate.m]]&lt;br /&gt;
:Evaluates an ensemble of neural networks and decides which ones are best.&lt;br /&gt;
;[[process_using.m]]&lt;br /&gt;
:Runs the DEER data processing using a specified neural network file.&lt;br /&gt;
;[[train_one_net.m]]&lt;br /&gt;
:Constructs a network object, generates a training library (see [[deer_lib_gen.m]]), and runs the network training - following supplied parameters.&lt;br /&gt;
&lt;br /&gt;
==Netset folder structure==&lt;br /&gt;
All in-built functions assume a standardised directory structure for the ensemble. The trained neural networks must be saved as individual *.mat files, numbered 1 to &amp;#039;&amp;#039;n&amp;#039;&amp;#039;:&lt;br /&gt;
&lt;br /&gt;
 	1.mat&lt;br /&gt;
 	2.mat&lt;br /&gt;
 	  .&lt;br /&gt;
 	  . &lt;br /&gt;
 	n.mat&lt;br /&gt;
&lt;br /&gt;
The directory must also contain the two supporting files:&lt;br /&gt;
&lt;br /&gt;
 	good_nets.mat   - 1 x m cell array (where m &amp;lt; n). The cells &lt;br /&gt;
 			  contain character arrays holding the names&lt;br /&gt;
 			  of the networks selected by the curation&lt;br /&gt;
 			  process (See: [[netset_curate.m]]).&lt;br /&gt;
&lt;br /&gt;
 	netset_params.m - function containing the netset training&lt;br /&gt;
 			  parameters, described [[netset_params.m|here]].&lt;br /&gt;
&lt;br /&gt;
==Training set parameters structure==&lt;/div&gt;</summary>
		<author><name>Worswick</name></author>
		
	</entry>
	<entry>
		<id>https://spindynamics.org/wiki/index.php?title=File:Deernet_sampleV.png&amp;diff=2998</id>
		<title>File:Deernet sampleV.png</title>
		<link rel="alternate" type="text/html" href="https://spindynamics.org/wiki/index.php?title=File:Deernet_sampleV.png&amp;diff=2998"/>
		<updated>2018-07-18T13:46:40Z</updated>

		<summary type="html">&lt;p&gt;Worswick: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Worswick</name></author>
		
	</entry>
	<entry>
		<id>https://spindynamics.org/wiki/index.php?title=File:Deernet_preprocess.png&amp;diff=2997</id>
		<title>File:Deernet preprocess.png</title>
		<link rel="alternate" type="text/html" href="https://spindynamics.org/wiki/index.php?title=File:Deernet_preprocess.png&amp;diff=2997"/>
		<updated>2018-07-18T13:45:28Z</updated>

		<summary type="html">&lt;p&gt;Worswick: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Worswick</name></author>
		
	</entry>
	<entry>
		<id>https://spindynamics.org/wiki/index.php?title=Elexsys2deernet.m&amp;diff=2986</id>
		<title>Elexsys2deernet.m</title>
		<link rel="alternate" type="text/html" href="https://spindynamics.org/wiki/index.php?title=Elexsys2deernet.m&amp;diff=2986"/>
		<updated>2018-07-17T13:41:10Z</updated>

		<summary type="html">&lt;p&gt;Worswick: Created page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:elexsys2deernet.m}}&lt;br /&gt;
Prepares experimental data saved in the Bruker Elexsys format for input into the [[deernet.m]] function. The DEER trace is read from the .DTA file and the time axis is reconstructed using parameters read from the accompanying .DSC file. The DEER trace is internally trimmed and shifted to ensure that the maximum occurs at t=0.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&lt;br /&gt;
     [deer_trace,time_axis]=elexsys2deernet(file)&lt;br /&gt;
&lt;br /&gt;
==Arguments==&lt;br /&gt;
     &lt;br /&gt;
     file        - file name of the Bruker dataset, both the *.DSC &lt;br /&gt;
 	          and *.DTA files are required. Extension names are&lt;br /&gt;
 		  assumed.&lt;br /&gt;
&lt;br /&gt;
==Outputs==&lt;br /&gt;
&lt;br /&gt;
     deer_trace  - the real experimental DEER trace, as a column &lt;br /&gt;
 		  vector.&lt;br /&gt;
 &lt;br /&gt;
     time_axis   - experimental time axis, as a column vector&lt;br /&gt;
 		  in microseconds.&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
The *.DSC and *.DTA files must both be available in the MATLAB path. &lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
[[deer_resample.m]], [[deernet.m]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Version 2.2, authors: [[Ilya Kuprov]], [[Steve Worswick]], [[Gunnar Jeschke]]&amp;#039;&amp;#039;&lt;/div&gt;</summary>
		<author><name>Worswick</name></author>
		
	</entry>
	<entry>
		<id>https://spindynamics.org/wiki/index.php?title=File:Deer_resample_example.png&amp;diff=2983</id>
		<title>File:Deer resample example.png</title>
		<link rel="alternate" type="text/html" href="https://spindynamics.org/wiki/index.php?title=File:Deer_resample_example.png&amp;diff=2983"/>
		<updated>2018-07-13T13:22:07Z</updated>

		<summary type="html">&lt;p&gt;Worswick: Worswick uploaded a new version of File:Deer resample example.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Worswick</name></author>
		
	</entry>
	<entry>
		<id>https://spindynamics.org/wiki/index.php?title=File:Deer_resample_example.png&amp;diff=2982</id>
		<title>File:Deer resample example.png</title>
		<link rel="alternate" type="text/html" href="https://spindynamics.org/wiki/index.php?title=File:Deer_resample_example.png&amp;diff=2982"/>
		<updated>2018-07-13T13:12:10Z</updated>

		<summary type="html">&lt;p&gt;Worswick: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Worswick</name></author>
		
	</entry>
	<entry>
		<id>https://spindynamics.org/wiki/index.php?title=Neural_network_module&amp;diff=2980</id>
		<title>Neural network module</title>
		<link rel="alternate" type="text/html" href="https://spindynamics.org/wiki/index.php?title=Neural_network_module&amp;diff=2980"/>
		<updated>2018-07-12T15:14:50Z</updated>

		<summary type="html">&lt;p&gt;Worswick: /* Functions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;New in the forthcoming version 2.2: docs being written...&lt;br /&gt;
&lt;br /&gt;
==Functions==&lt;br /&gt;
;[[deer_lib_gen.m]]&lt;br /&gt;
:Generates a library of distance distributions and corresponding simulated DEER traces for use in neural network training and validation.&lt;br /&gt;
;[[deer_resample.m]]&lt;br /&gt;
:Resample DEER trace to fit the number of digitsation points expected by the neural network.&lt;br /&gt;
;[[deernet.m]]&lt;br /&gt;
:Uses a curated ensemble of neural networks to extract a distance distribution from primary DEER data.&lt;br /&gt;
;[[elexsys2deernet.m]]&lt;br /&gt;
:Prepares experimental data - saved in the Bruker Elexsys format - for input into the [[deernet.m]] function.&lt;br /&gt;
;[[netset_curate.m]]&lt;br /&gt;
:Evaluates an ensemble of neural networks and decides which ones are best.&lt;br /&gt;
;[[process_using.m]]&lt;br /&gt;
:Runs the DEER data processing using a specified neural network file.&lt;br /&gt;
;[[train_one_net.m]]&lt;br /&gt;
:Constructs a network object, generates a training library (see [[deer_lib_gen.m]]), and runs the network training - following supplied parameters.&lt;br /&gt;
&lt;br /&gt;
==Netset folder structure==&lt;/div&gt;</summary>
		<author><name>Worswick</name></author>
		
	</entry>
</feed>