**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:
bash
pip install --upgrade vgslify