Skip to content

Data Structures

Hans-Christian Ruiz Euler edited this page Apr 8, 2019 · 1 revision

Intro

Before starting with your experiments, make sure you read this page and understand the different convention we use to structure the data in our group. We save the measurement data on npz-files, containing numpy arrays or dictionaries. By convention, there must be an array with the key 'outputs' containing the current measurements of the device in nA(!). Usually, there are also arrays with the corresponding inputs to the device giving the measured currents. These inputs are in Volts (usually between -1 and +1 V). You can add other variables as keys to the npz-file, but make sure to name them in a way that it is easy to understand what they represent. We have not mentioned the shape of the numpy arrays saved. The way you shape these, will depend if you are working on the "network" or the "experiment" side. We explain the details below.

Convention of numpy array shapes

Network side:

In a PyTorch model (a neural net) you can process N inputs at once by feeding to the model a 2D array (in fact a torch tensor) with shape NxD where N is the number of inputs samples--in our case voltage configurations--and D is the dimension of the input (here: the number of input electrodes). For this reason, we enforce the shape of our arrays to be NxD. Make sure you save your data with this shape if you are planning to work with the Nets module.

Experiment side:

Whenever you perform measurements for experiments, you will probably have to write your own code. For smoothing the data sharing and the work flow of the whole group, make sure you follow the convention here, with the exception of data gathered to train or validate neural networks and related experiments. The input to the measurements setups must be of the form DxN and the output of a measurement is also DxN (usually D=1 for output and D=#-of-input-electrodes for the input). Hence, the data obtained during a non-network related experiment must have this shape and also be saved in this way. Please make sure you follow this convention. Finally, it is up to the user to transpose or reshape the arrays if the data gathered with one purpose in mind is used for the alternative purpose.

Important:

  1. Make sure you follow the convention of the units (inputs: Volts; outputs: nA)
  2. We save the data as npz-files, which must have at least the key 'outputs'
  3. Make sure you follow the conventions on the shape of the arrays with data gathered with different purposes: network or experiments (see above).
Clone this wiki locally