
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
vgslify
Advanced tools
VGSLify is a Python toolkit for rapid prototyping and seamless conversion between TensorFlow and PyTorch models and VGSL.
VGSLify simplifies defining, training, and interpreting deep learning models using the Variable-size Graph Specification Language (VGSL). Inspired by Tesseract's VGSL specs, VGSLify enhances and streamlines the process for both TensorFlow and PyTorch.
To install VGSLify without any deep learning backend, run:
pip install vgslify
This installs only the core functionalities of VGSLify without torch or tensorflow.
VGSLify supports both TensorFlow and PyTorch. You can install it with the required backend:
# For TensorFlow (latest compatible version)
pip install vgslify[tensorflow]
# For PyTorch (latest compatible version)
pip install vgslify[torch]
By default, this will install:
tensorflow (latest stable version)torch (latest stable version)If you need a specific version of torch or tensorflow, install VGSLify first and then manually install the backend:
pip install vgslify
pip install torch==2.1.0 # Example for PyTorch
pip install tensorflow==2.14 # Example for TensorFlow
Alternatively, you can specify the version during installation:
pip install vgslify[torch] torch==2.1.0
pip install vgslify[tensorflow] tensorflow==2.14
⚠ Note: If a different version of torch or tensorflow is already installed, pip may not downgrade it automatically. Use --force-reinstall or --upgrade if necessary:
pip install --upgrade --force-reinstall torch==2.1.0
To check that VGSLify is installed correctly, run:
python -c "import vgslify; print(vgslify.__version__)"
VGSL uses concise strings to define model architectures. For example:
None,None,64,1 Cr3,3,32 Mp2,2 Cr3,3,64 Mp2,2 Rc3 Fr64 D20 Lrs128 D20 Lrs64 D20 Fs92
Each part represents a layer: input, convolution, pooling, reshaping, fully connected, LSTM, and output. VGSL allows specifying activation functions for customization.
from vgslify import VGSLModelGenerator
# Define the VGSL specification
vgsl_spec = "None,None,64,1 Cr3,3,32 Mp2,2 Fs92"
# Choose backend: "tensorflow", "torch", or "auto" (defaults to whichever is available)
vgsl_gn = VGSLModelGenerator(backend="tensorflow")
model = vgsl_gn.generate_model(vgsl_spec, model_name="MyModel")
model.summary()
vgsl_gn = VGSLModelGenerator(backend="torch") # Switch to PyTorch
model = vgsl_gn.generate_model(vgsl_spec, model_name="MyTorchModel")
print(model)
from vgslify import VGSLModelGenerator
vgsl_gn = VGSLModelGenerator(backend="tensorflow")
conv2d_layer = vgsl_gn.construct_layer("Cr3,3,64")
# Integrate into an existing model:
# model = tf.keras.Sequential()
# model.add(conv2d_layer) # ...
# Example with generate_history:
history = vgsl_gn.generate_history("None,None,64,1 Cr3,3,32 Mp2,2 Fs92")
for layer in history:
print(layer)
from vgslify import model_to_spec
import tensorflow as tf
# Or import torch.nn as nn
# TensorFlow example:
model = tf.keras.models.load_model("path_to_your_model.keras") # If loading from file
# PyTorch example:
# model = MyPyTorchModel() # Assuming MyPyTorchModel is defined elsewhere
vgsl_spec_string = model_to_spec(model)
print(vgsl_spec_string)
Note: Flatten/Reshape layers might require manual input shape adjustment in the generated VGSL.
See the VGSL Documentation for more details on supported layers and their specifications.
Contributions are welcome! Fork the repository, set up your environment, make changes, and submit a pull request. Create issues for bugs or suggestions.
MIT License. See LICENSE file.
Thanks to the creators and contributors of the original VGSL specification.
FAQs
VGSLify is a Python toolkit for rapid prototyping and seamless conversion between TensorFlow and PyTorch models and VGSL.
We found that vgslify demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.