vgslify package
Subpackages
- vgslify.core package
- Submodules
- vgslify.core.config module
- vgslify.core.factory module
LayerFactory
LayerFactory.layers
LayerFactory.data_format
LayerFactory.shape
LayerFactory._input_shape
LayerFactory.activation()
LayerFactory.batchnorm()
LayerFactory.build()
LayerFactory.conv2d()
LayerFactory.dense()
LayerFactory.dropout()
LayerFactory.flatten()
LayerFactory.input()
LayerFactory.pooling2d()
LayerFactory.reshape()
LayerFactory.rnn()
- vgslify.core.parser module
- vgslify.core.utils module
- Module contents
- vgslify.parsers package
- Submodules
- vgslify.parsers.base_parser module
BaseModelParser
BaseModelParser.generate_vgsl()
BaseModelParser.parse_activation()
BaseModelParser.parse_batchnorm()
BaseModelParser.parse_conv2d()
BaseModelParser.parse_dense()
BaseModelParser.parse_dropout()
BaseModelParser.parse_flatten()
BaseModelParser.parse_input()
BaseModelParser.parse_model()
BaseModelParser.parse_pooling()
BaseModelParser.parse_reshape()
BaseModelParser.parse_rnn()
- vgslify.parsers.tf_parser module
TensorFlowModelParser
TensorFlowModelParser.layer_parsers
TensorFlowModelParser.parse_activation()
TensorFlowModelParser.parse_batchnorm()
TensorFlowModelParser.parse_conv2d()
TensorFlowModelParser.parse_dense()
TensorFlowModelParser.parse_dropout()
TensorFlowModelParser.parse_flatten()
TensorFlowModelParser.parse_input()
TensorFlowModelParser.parse_model()
TensorFlowModelParser.parse_pooling()
TensorFlowModelParser.parse_reshape()
TensorFlowModelParser.parse_rnn()
- vgslify.parsers.torch_parser module
TorchModelParser
TorchModelParser.layer_parsers
TorchModelParser.parse_activation()
TorchModelParser.parse_batchnorm()
TorchModelParser.parse_conv2d()
TorchModelParser.parse_dense()
TorchModelParser.parse_dropout()
TorchModelParser.parse_flatten()
TorchModelParser.parse_input()
TorchModelParser.parse_model()
TorchModelParser.parse_pooling()
TorchModelParser.parse_reshape()
TorchModelParser.parse_rnn()
- Module contents
- vgslify.tensorflow package
- vgslify.torch package
Submodules
vgslify.generator module
- class vgslify.generator.VGSLModelGenerator(backend='auto')[source]
Bases:
object
VGSLModelGenerator constructs a neural network model based on a VGSL (Variable-size Graph Specification Language) specification string. This class supports dynamic model generation for different backends, with current support for TensorFlow and PyTorch.
The generator takes a VGSL specification string that defines the architecture of the neural network, including the input layer, convolutional layers, pooling layers, RNN layers, dense layers, and more. The class parses this string, constructs the layers in sequence, and builds the final model.
- construct_layer(spec)[source]
Constructs a single layer using the layer factory based on the spec string.
- Parameters:
spec (str) – The VGSL specification string for a layer.
- Returns:
The constructed layer.
- Return type:
Any
- Raises:
ValueError – If the layer specification is unknown.
- generate_history(model_spec)[source]
Generate the history of layer specifications without building the full model.
This method parses the VGSL specification string, constructs each layer using the layer factory, and stores them in a list, but does not chain them or connect input/output layers.
- Parameters:
model_spec (str) – The VGSL specification string defining the model architecture.
- Returns:
A list of layers constructed from the specification string.
- Return type:
list
- generate_model(model_spec, model_name='VGSL_Model')[source]
Build the model based on the VGSL spec string.
This method parses the VGSL specification string, creates each layer using the layer factory, and constructs the model sequentially.
- Parameters:
model_spec (str) – The VGSL specification string defining the model architecture.
- Returns:
The built model using the specified backend.
- Return type:
Any