Adds a depthcharge.components.transformers.PeptideEncoder class.
Changes how the precursor mass and charge state are encoded. Previously, they were just used a floating point inputs to a linear layer. Now the precursor mass undergoes the same sinusoidal encoding as the m/z values of peaks in a spectrum and charge states are essentially one-hot encoded using a torch.nn.Embedding layer. The output features are the sum of the mass encoding and the charge embedding.
Intensity can now optionally be represented as a sinusoidal encoding as well. The dim_intensity arguments reserve the specified number of features for the intensity encodings, whereas the rest are used for m/z.
This PR makes a few changes:
depthcharge.components.transformers.PeptideEncoder
class.torch.nn.Embedding
layer. The output features are the sum of the mass encoding and the charge embedding.dim_intensity
arguments reserve the specified number of features for the intensity encodings, whereas the rest are used for m/z.