Deeplay is a deep learning library in Python that extends PyTorch with additional functionalities focused on modularity and reusability. Deeplay seeks to address the common issue of rigid and non-reusable modules in PyTorch projects by offering a system that allows for easy customization and optimization of neural network components. Specifically, it facilitates the definition, training, and adjustment of neural networks by introducing dynamic modification capabilities for model components after their initial creation.
The core philosophy of Deeplay is to enhance flexibility in the construction and adaptation of neural networks. It is built on the observation that PyTorch modules often lack reusability across projects, leading to redundant implementations. Deeplay enables properties of neural network submodules to be changed post-creation, supporting seamless integration of these modifications. Its design is based on a hierarchy of abstractions from models down to layers, emphasizing compatibility and easy transformation of components. This can be summarized as follows:
Deeplay is designed as a superset of PyTorch, retaining compatibility with PyTorch code while introducing features aimed at improving modularity and customization. Unlike PyTorch's fixed module implementations, Deeplay provides a framework that supports dynamic adjustments to model architectures. This includes capabilities for on-the-fly property changes and a style registry for component customization. Users can easily transition between PyTorch and Deeplay, taking advantage of Deeplay's additional features without losing the familiarity and functionality of PyTorch.
While Deeplay utilizes PyTorch Lightning for simplifying the training loop process, it goes further by offering enhanced modularity for the architectural design of models. PyTorch Lightning focuses on streamlining and optimizing training operations, whereas Deeplay extends this convenience to the model construction phase. This integration offers users a comprehensive toolset for both designing flexible neural network architectures and efficiently managing their training, positioning Deeplay as a solution for more adaptive and intuitive neural network development.
The following quick start guide is intended for complete beginners to understand how to use Deeplay, from installation to training your first model. Let's get started!
You can install Deeplay using pip:
pip install deeplay
or
python -m pip install deeplay
This will automatically install the required dependencies, including PyTorch and PyTorch Lightning. If a specific version of PyTorch is desired, it can be installed separately.
Here you find a series of notebooks that give you an overview of the core features of Deeplay and how to use them:
GS101 Understanding the Core Objects in Deeplay
Layers, Blocks, Components, Models, Applications.
GS111 Training Your First Model
Creating, training, saving and using a deep learning model with Deeplay.
GS121 Working with Deeplay Modules
Differences between Deeplay and PyTorch modules. How to create, build, and configure Deeplay modules.
GS131 Using the Main Deeplay Methods
Application.fit()
, Application.test()
, DeeplayModule.predict()
, Trainer.fit()
.
GS141 Using Deeplay Applications
Main Deeplay applications. Controlling loss functions, optimizers, and metrics. Training history. Callback.
GS151 Using Deeplay Models
Main Deeplay models. Making a model. Weight initialization.
GS161 Using Deeplay Components
Main Deeplay components.
GS171 Using Deeplay Blocks
Main Deeplay blocks. Adding, ordering, and removing layers. Operations.
GC181 Configuring Deeplay Objects
DeeplayModule.configure()
and selectors.
GC191 Using Styles
Styles.
Here you find a series of notebooks tailored for Deeplay's developers:
DT101 Deeplay File Structure
DT111 Style Guide
DT131 Deeplay Applications
DT141 Deeplay Models
DT151 Deeplay Components
DT161 Deeplay Operations
DT171 Deeplay Blocks