vgslify package
Subpackages
- vgslify.core package
- Submodules
- vgslify.core.config module
- vgslify.core.factory module
LayerFactory
LayerFactory.activation()
LayerFactory.avgpool2d()
LayerFactory.batchnorm()
LayerFactory.bidirectional()
LayerFactory.build_final_model()
LayerFactory.conv2d()
LayerFactory.dense()
LayerFactory.dropout()
LayerFactory.flatten()
LayerFactory.gru()
LayerFactory.input()
LayerFactory.lstm()
LayerFactory.maxpooling2d()
LayerFactory.reshape()
- vgslify.core.parser module
- vgslify.core.utils module
- Module contents
- vgslify.tensorflow package
- Submodules
- vgslify.tensorflow.layers module
TensorFlowLayerFactory
TensorFlowLayerFactory.activation()
TensorFlowLayerFactory.avgpool2d()
TensorFlowLayerFactory.batchnorm()
TensorFlowLayerFactory.bidirectional()
TensorFlowLayerFactory.build_final_model()
TensorFlowLayerFactory.conv2d()
TensorFlowLayerFactory.dense()
TensorFlowLayerFactory.dropout()
TensorFlowLayerFactory.flatten()
TensorFlowLayerFactory.gru()
TensorFlowLayerFactory.input()
TensorFlowLayerFactory.lstm()
TensorFlowLayerFactory.maxpooling2d()
TensorFlowLayerFactory.reshape()
- Module contents
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.
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, prev_layer=None)[source]
Constructs a single layer using the layer factory based on the spec string.
- Parameters:
spec (str) – The VGSL specification string for a layer.
prev_layer (Any, optional) – The previous layer, required for spatial collapsing (‘Rc’).
- Returns:
The constructed layer.
- Return type:
Any
- Raises:
ValueError – If the layer specification is unknown or if ‘Rc’ requires the previous layer’s shape.
- 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)[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