Releases: TimKoornstra/VGSLify
v0.13.3
VGSLify v0.13.3 Release Notes
Release Date: October 2024
Bug Fixes:
- Rc3 with variable sequence length
Variable size sequence length is now properly supported in Tensorflow.
Documentation
Documentation is available at: VGSLify Documentation.
v0.13.2
VGSLify v0.13.2 Release Notes
Release Date: October 2024
Bug Fixes:
- Rc3 with variable sequence length
Variable size sequence length is now properly supported in Tensorflow.
- Version-agnostic Tensorflow input layer
Model generator now uses tf.keras.backend.is_keras_tensor
to check input type.
Documentation
Documentation is available at: VGSLify Documentation.
v0.13.1
VGSLify v0.13.1 Release Notes
Release Date: October 2024
Bug Fixes:
-
RNN Layer Type Selection:
- Fixed an issue where the correct layer type was not always chosen during the creation of RNN layers. The update ensures that both LSTM and GRU layers are selected properly according to the configuration.
-
GRU Support for
summarize
Function:- Addressed a bug where the
summarize
function only worked for LSTM layers and not for GRU layers. Now, both LSTM and GRU models are properly summarized.
- Addressed a bug where the
Documentation
Documentation is available at: VGSLify Documentation.
v0.13.0
VGSLify v0.13.0 Release Notes
Release Date: October 2024
New Features and Improvements:
-
PyTorch Backend Support:
- VGSLify now supports the PyTorch backend, alongside TensorFlow. This required updates to the LayerFactory base class to handle parsing the VGSL specification and configuring layers for PyTorch.
- The
TensorFlowLayerFactory
andTorchLayerFactory
classes are now responsible for implementing their respective layer types.
-
Refactor of VGSL Parsing and Layer Handling:
- A base class has been introduced for parsing models back to the VGSL specification, with backend-specific subclasses handling the necessary package-specific logic.
- The overall codebase has been simplified by merging redundant functions. For example,
LSTM
,GRU
, and bidirectional RNNs now share more common code, as do pooling layers likeAvgPool
andMaxPool
.
-
New
model_name
Parameter:- The
VGSLModelGenerator.generate_model
function now accepts amodel_name
parameter, allowing users to specify a custom model name instead of the default"VGSL_Model"
.
- The
-
Reduced Code Duplication:
- Significant reduction of duplicate code, particularly in the handling of RNNs (LSTM, GRU, bidirectional RNNs) and pooling layers (AvgPool, MaxPool).
-
Updated Documentation:
- The documentation, README, and examples have been updated to reflect all changes, including PyTorch support, the
model_name
parameter, and refactoring of VGSL parsing and layer handling. - Tutorials and examples are available to guide users through the new features.
- The documentation, README, and examples have been updated to reflect all changes, including PyTorch support, the
Documentation is available at: VGSLify Documentation.
v0.12.0
VGSLify v0.12.0 Release Notes
Release Date: September 2024
New Features and Improvements:
-
Removal of Output Layer (
O
):- The
O
(output) layer has been removed from the VGSL spec. Users can now define the final layer of their model by specifying a fully connected (Fc
) layer, with the ability to useFlt
for linear activation or other activations as needed. - This change simplifies model definition by giving users more control over the architecture, especially for the output layer.
Example:
# Before: ... O1s10 # Now: ... Fs10 # Define output with fully connected layer and activation
- The
-
Rewritten Spatial Collapse (
Rc
):- The spatial collapse functionality has been revised to support two types of collapses:
Rc2
: Collapses spatial dimensions into a 2D tensor, suitable for transitioning into fully connected (dense) layers.Rc3
: Collapses spatial dimensions into a 3D tensor, making it compatible with sequential layers such as LSTMs or RNNs.
- Users should choose
Rc2
when transitioning to dense layers andRc3
when continuing with layers that process sequential information.
Example:
# For fully connected layers: ... Cr3,3,64 Mp2,2,2,2 Rc2 Fc128 # For sequential models: ... Cr3,3,64 Mp2,2,2,2 Rc3 Lfs50
- The spatial collapse functionality has been revised to support two types of collapses:
-
Updated Documentation:
- The official documentation has been updated to reflect the changes to the
Rc
layer and the removal of theO
layer. - New tutorials and examples have been added to guide users in updating their VGSL specs and taking advantage of the new features.
- Documentation is available at: VGSLify Documentation.
v0.11.0
VGSLify v0.11.0 Release Notes
Release Date: September 2024
New Features and Improvements:
-
Simplified Layer and Model Creation:
- Automatic Layer Generation: Users can now generate individual layers from a VGSL spec string with the
construct_layer()
method. The generator automatically determines the correct layer type, making it easier to integrate VGSL-defined layers into existing models. - Layer History Inspection: A new
generate_history()
method allows users to inspect the sequence of layers generated from a VGSL spec without building or chaining them. This is particularly useful for debugging and experimenting with layer compositions.
- Automatic Layer Generation: Users can now generate individual layers from a VGSL spec string with the
-
Improved Reshape Layer Handling:
- Spatial Collapse (
Rc
): The generator now correctly distinguishes between spatial collapse (Rc
) and general reshape operations (R{x,y,z}
) based on the previous layer’s shape.
- Spatial Collapse (
-
Refactored and Streamlined API:
- Single Class, Multiple Models: The
VGSLModelGenerator
now initializes without a model spec, allowing the same instance to be used for generating multiple models. You can pass different spec strings to methods likegenerate_model()
orgenerate_history()
, reducing the need to instantiate multiple generator objects.
- Single Class, Multiple Models: The
-
Enhanced Documentation and Usability:
- README Updates: The documentation has been updated to reflect the new, simplified API. Users can now quickly generate models, individual layers, or inspect layer history using the streamlined methods.
- Code Examples: The documentation now includes examples that demonstrate how to use the new features, including BYOB backend selection, individual layer generation, and history inspection.
Bug Fixes:
- None Dimensions: Fixed an issue where the
Reshape
layer's target shape containedNone
dimensions, ensuring that such cases are handled correctly by substitutingNone
with1
.
v0.10.1
VGSLify v0.10.1 Release Notes
Release Date: September 2024
This patch rewrites part of the main generator class, and readds the ability to use Rc
to collapse the model dimensions.
Upgrade Instructions:
To upgrade to the latest version of VGSLify, use the following command:
pip install --upgrade vgslify
v0.10.0
VGSLify v0.10.0 Release Notes
Release Date: September 2024
I'm excited to announce VGSLify v0.10.0, which introduces several major improvements, refactors, and additional features that enhance flexibility and ease of use for both TensorFlow and PyTorch deep learning models. Below are the key highlights of this release.
🚀 New Features
1. Backend Auto-Detection
- Automatic Backend Selection: The VGSLModelGenerator can now automatically detect the backend (TensorFlow or PyTorch) based on the environment. If both frameworks are available, TensorFlow will be selected by default.
- Usage: The default backend can be set to auto, allowing VGSLify to choose the most appropriate backend.
2. TensorFlow to VGSL Spec Conversion
- TensorFlow Model to VGSL Spec: Added functionality to convert TensorFlow models back into VGSL specification strings using the tf_to_spec function. This is useful for model interpretation, debugging, or saving model architecture in a compact format.
3. Refactored Layer Parsing
- Cleaner Parsing Functions: Refactored the parsing of various layer types (e.g., Conv2D, Pooling, Dense, RNN) for cleaner and more consistent code across different layer types.
- Expanded Layer Support: Added support for the Flatten, BatchNormalization, Reshape, Activation, and Dropout layers with more comprehensive parsing.
4. Improved Input Layer Parsing
- Input Shape Flexibility: Now supports 1D, 2D, and 3D input shapes in the VGSL specification. This opens up support for time-series models, 2D image models, and even future extensions like 3D convolutions.
🔧 Refactoring and Code Quality Improvements
1. Factory and Layer Construction Refactor
- Refactored the TensorFlowLayerFactory class for better modularity and flexibility. Each layer type is now handled by its own static method, making the layer construction process more readable and easier to maintain.
- The VGSLModelGenerator now uses a dictionary of constructors for each layer type, improving extensibility and maintainability when adding new layers.
2. Unified model_to_spec Function
- A new unified model_to_spec function can detect whether a model is a TensorFlow model or a PyTorch model. Currently, it supports TensorFlow models, with PyTorch model support planned for future releases.
3. More Robust Error Handling
- Improved error messages and validation when parsing VGSL specification strings. If an unsupported layer or incorrectly formatted specification is encountered, clear error messages are provided.
🛠️ Bug Fixes
1. Dense Layer Specification Parsing
- Fixed a bug in the parsing of dense layers where the activation function was incorrectly assumed to be part of the spec string when omitted.
2. TensorFlow Layers Activation
- Corrected issues related to activation handling in various layers, ensuring consistency across layer types.
3. Backend Detection
- Corrected an issue where the backend detection could fail in certain environments. This has been fixed to reliably detect and select the correct backend.
📚 Documentation and Examples
1. Updated Documentation
- The documentation has been updated to reflect all the new features, including examples of automatic backend selection, new layer types, and model-to-VGSL conversion.
2. Example Usage
- New examples and code snippets for creating models, converting models to VGSL specs, and generating individual layers.
⚙️ Testing Enhancements
1. Pytest Test Coverage
- Expanded unit test coverage across the package using pytest. This includes tests for core functionality such as:
- Layer factory methods
- Model generation and backend detection
- VGSL spec parsing
- TensorFlow to VGSL spec conversion
- Mocking support added for TensorFlow and PyTorch imports to improve test flexibility.
🛠️ Deprecations and Breaking Changes
1. Manual Backend Selection
- Although you can still manually select the backend (TensorFlow or PyTorch), the preferred method is to use the auto backend option for automatic detection.
🛠️ Planned Future Work
1. PyTorch Model Support
- Although not yet implemented, the groundwork has been laid for PyTorch model support. Future releases will include full conversion to VGSL spec from PyTorch models and VGSL spec-based model generation.
2. Custom Layers and Layer Extensions
- Work is ongoing to support custom layers and extensions to the VGSL specification for more specialized models.
Upgrade Instructions:
To upgrade to the latest version of VGSLify, use the following command:
pip install --upgrade vgslify
v0.9.2
This release adds
- Various minor bug fixes