CodeSynthesisArchitecture<T>

Models & Types ยท AiDotNet.ProgramSynthesis.Models

Defines the architecture configuration for code synthesis and understanding models.

Inheritance: NeuralNetworkArchitecture<T> โ†’ CodeSynthesisArchitecture<T>

For Beginners

This is a blueprint for building AI models that understand code.

Just like TransformerArchitecture defines how to build a general transformer, CodeSynthesisArchitecture defines how to build models specifically for:

  • Understanding code
  • Generating code
  • Translating between programming languages
  • Finding bugs
  • Completing code

It includes all the settings needed to build these specialized code models, like which programming language to work with and how much code it can handle.

How It Works

CodeSynthesisArchitecture extends the neural network architecture with code-specific parameters such as programming language, maximum code length, vocabulary size, and synthesis strategy. It serves as a blueprint for building code models like CodeBERT, GraphCodeBERT, and CodeT5.

Constructors

Constructor Summary
CodeSynthesisArchitecture(SynthesisType synthesisType, ProgramLanguage targetLanguage, CodeTask codeTaskType, int numEncoderLayers, int numDecoderLayers, int numHeads, int modelDimension, int feedForwardDimension, int maxSequenceLength, int vocabularySize, int maxProgramLength, double dropoutRate, bool usePositionalEncoding, bool useDataFlow, NetworkComplexity complexity, int inputSize, int outputSize, List<ILayer<T>> layers) Initializes a new instance of the CodeSynthesisArchitecture class.

Properties

Property Summary
CodeTask CodeTaskType { get; } Gets the code task type this architecture is optimized for.
ProgramLanguage TargetLanguage { get; } Gets the target programming language.
SynthesisType SynthesisType { get; } Gets the type of synthesis approach to use.
bool UseDataFlow { get; } Gets whether to use data flow information (for GraphCodeBERT-style models).
bool UsePositionalEncoding { get; } Gets whether to use positional encoding.
double DropoutRate { get; } Gets the dropout rate for regularization.
int FeedForwardDimension { get; } Gets the feed-forward network dimension.
int MaxProgramLength { get; } Gets the maximum allowed program length for synthesis.
int MaxSequenceLength { get; } Gets the maximum sequence length (in tokens).
int ModelDimension { get; } Gets the model dimension (embedding size).
int NumDecoderLayers { get; } Gets the number of decoder layers (for generation tasks).
int NumEncoderLayers { get; } Gets the number of encoder layers.
int NumHeads { get; } Gets the number of attention heads.
int VocabularySize { get; } Gets the vocabulary size.