Add new deep learning functionality#78
Conversation
2df9d1a to
e9ad97a
Compare
d4c9318 to
5369308
Compare
5369308 to
a4400fc
Compare
…ing the training mode
…rrectly display element name and properties of module
…s not accepting input
… use pytorch naming conventions
…odule-specific parameters
a4400fc to
e9f4d09
Compare
…ss for feeding sequential container
glopesdev
left a comment
There was a problem hiding this comment.
Massive effort, thanks for putting this all together! Lots of comments below mainly on naming and organization for us to think about.
| /// See <see href="https://pytorch.org/docs/stable/generated/torch.nn.CELU.html"/> for more information. | ||
| /// </remarks> | ||
| [Description("Creates a continuously differentiable exponential linear unit (CELU) activation function.")] | ||
| [DisplayName("CELU")] |
There was a problem hiding this comment.
We have on occasion changed the display name for dynamic operators, but usually I try to avoid doing it for casing reasons, since on XML the actual class name will persist, and may create confusion between diffs and the visual editor.
I do agree this is a strange acronym, I looked elsewhere and couldn't find a better name, but would still keep the C# naming conventions.
| /// See <see href="https://pytorch.org/docs/stable/generated/torch.nn.ELU.html"/> for more information. | ||
| /// </remarks> | ||
| [Description("Creates an exponential linear unit (ELU) activation function.")] | ||
| [DisplayName("ELU")] |
| /// See <see href="https://pytorch.org/docs/stable/generated/torch.nn.GELU.html"/> for more information. | ||
| /// </remarks> | ||
| [Description("Creates a gaussian error linear unit (GELU) activation function.")] | ||
| [DisplayName("GELU")] |
| /// </remarks> | ||
| [Description("Creates a gated linear unit (GLU) module.")] | ||
| [DisplayName("GLU")] | ||
| public class Glu |
There was a problem hiding this comment.
Same as above. Alternatively, we could emulate our decision in the Torch package and simply expand all acronyms into their full long names to favor readability, as these acronyms are impenetrable to cursory reading, and easily confused with each other.
| /// See <see href="https://pytorch.org/docs/stable/generated/torch.nn.LeakyReLU.html"/> for more information. | ||
| /// </remarks> | ||
| [Description("Creates a leaky rectified linear unit (LeakyReLU) activation function.")] | ||
| [DisplayName("LeakyReLU")] |
There was a problem hiding this comment.
I can see that the casing in torch is all over the place, so maybe we just default to expanding long-names and make everything clearer?
| /// <summary> | ||
| /// Represents an operator that saves a module's state to a file. | ||
| /// </summary> | ||
| [Combinator] |
| /// </summary> | ||
| [XmlInclude(typeof(Shuffle.ChannelShuffle))] | ||
| [DefaultProperty(nameof(ShuffleModule))] | ||
| [Combinator] |
| [XmlInclude(typeof(Sparse.EmbeddingBagFromPretrained))] | ||
| [XmlInclude(typeof(Sparse.EmbeddingFromPretrained))] | ||
| [DefaultProperty(nameof(SparseModule))] | ||
| [Combinator] |
| [XmlInclude(typeof(Transformer.TransformerEncoder))] | ||
| [XmlInclude(typeof(Transformer.TransformerEncoderLayer))] | ||
| [DefaultProperty(nameof(TransformerModule))] | ||
| [Combinator] |
| [XmlInclude(typeof(Vision.PixelUnshuffle))] | ||
| [XmlInclude(typeof(Vision.Upsample))] | ||
| [DefaultProperty(nameof(VisionModule))] | ||
| [Combinator] |
This PR adds new functionality into the
Bonsai.ML.Torchpackage to allow creation of deep learning modules directly in Bonsai. Operators were added to theBonsai.ML.Torch.NeuralNetsnamespace to support a wide range of deep learning functionality, including allowing the direct creation of torch modules (convolutional layers, pooling layers, padding layers, recurrent neural networks, transformers, etc), and existing operators were refactored to support this new functionality in addition to previous functionality.The PR in #77 should be merged first before this one.