All Projects → waleedka → Hiddenlayer

waleedka / Hiddenlayer

Licence: mit
Neural network graphs and training metrics for PyTorch, Tensorflow, and Keras.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Hiddenlayer

Onepanel
The open and extensible integrated development environment (IDE) for computer vision with built-in modules for model building, automated labeling, data processing, model training, hyperparameter tuning and workflow orchestration.
Stars: ✭ 428 (-72.58%)
Mutual labels:  deeplearning, tensorboard
Bmw Yolov4 Training Automation
This repository allows you to get started with training a state-of-the-art Deep Learning model with little to no configuration needed! You provide your labeled dataset or label your dataset using our BMW-LabelTool-Lite and you can start the training right away and monitor it in many different ways like TensorBoard or a custom REST API and GUI. NoCode training with YOLOv4 and YOLOV3 has never been so easy.
Stars: ✭ 533 (-65.86%)
Mutual labels:  deeplearning, tensorboard
Bmw Tensorflow Training Gui
This repository allows you to get started with a gui based training a State-of-the-art Deep Learning model with little to no configuration needed! NoCode training with TensorFlow has never been so easy.
Stars: ✭ 736 (-52.85%)
Mutual labels:  deeplearning, tensorboard
Lipreading Densenet3d
DenseNet3D Model In "LRW-1000: A Naturally-Distributed Large-Scale Benchmark for Lip Reading in the Wild", https://arxiv.org/abs/1810.06990
Stars: ✭ 91 (-94.17%)
Mutual labels:  deeplearning
Specgan
SpecGAN - generate audio with adversarial training
Stars: ✭ 92 (-94.11%)
Mutual labels:  deeplearning
Har Keras Cnn
Human Activity Recognition (HAR) with 1D Convolutional Neural Network in Python and Keras
Stars: ✭ 97 (-93.79%)
Mutual labels:  deeplearning
Dlflow
DLFlow is a deep learning framework.
Stars: ✭ 105 (-93.27%)
Mutual labels:  deeplearning
Wb color augmenter
WB color augmenter improves the accuracy of image classification and image semantic segmentation methods by emulating different WB effects (ICCV 2019) [Python & Matlab].
Stars: ✭ 89 (-94.3%)
Mutual labels:  deeplearning
Sert
Semantic Entity Retrieval Toolkit
Stars: ✭ 100 (-93.59%)
Mutual labels:  deeplearning
Exposure correction
Reference code for the paper "Learning Multi-Scale Photo Exposure Correction", CVPR 2021.
Stars: ✭ 98 (-93.72%)
Mutual labels:  deeplearning
The Nlp Pandect
A comprehensive reference for all topics related to Natural Language Processing
Stars: ✭ 1,349 (-13.58%)
Mutual labels:  deeplearning
Classification Of Hyperspectral Image
Classification of the Hyperspectral Image Indian Pines with Convolutional Neural Network
Stars: ✭ 93 (-94.04%)
Mutual labels:  deeplearning
Mad Twinnet
The code for the MaD TwinNet. Demo page:
Stars: ✭ 99 (-93.66%)
Mutual labels:  deeplearning
Micromlp
A micro neural network multilayer perceptron for MicroPython (used on ESP32 and Pycom modules)
Stars: ✭ 92 (-94.11%)
Mutual labels:  deeplearning
Spectralnormalizationkeras
Spectral Normalization for Keras Dense and Convolution Layers
Stars: ✭ 100 (-93.59%)
Mutual labels:  deeplearning
Pytorch Seq2seq
An open source framework for seq2seq models in PyTorch.
Stars: ✭ 1,297 (-16.91%)
Mutual labels:  deeplearning
Androidtensorflowmachinelearningexample
Android TensorFlow MachineLearning Example (Building TensorFlow for Android)
Stars: ✭ 1,369 (-12.3%)
Mutual labels:  deeplearning
Ngsim env
Learning human driver models from NGSIM data with imitation learning.
Stars: ✭ 96 (-93.85%)
Mutual labels:  deeplearning
Bdrar
Code for the ECCV 2018 paper "Bidirectional Feature Pyramid Network with Recurrent Attention Residual Modules for Shadow Detection"
Stars: ✭ 95 (-93.91%)
Mutual labels:  deeplearning
Intra Bag And Inter Bag Attentions
Code for NAACL 2019 paper: Distant Supervision Relation Extraction with Intra-Bag and Inter-Bag Attentions
Stars: ✭ 98 (-93.72%)
Mutual labels:  deeplearning

HiddenLayer

A lightweight library for neural network graphs and training metrics for PyTorch, Tensorflow, and Keras.

HiddenLayer is simple, easy to extend, and works great with Jupyter Notebook. It's not intended to replace advanced tools, such as TensorBoard, but rather for cases where advanced tools are too big for the task. HiddenLayer was written by Waleed Abdulla and Phil Ferriere, and is licensed under the MIT License.

1. Readable Graphs

Use HiddenLayer to render a graph of your neural network in Jupyter Notebook, or to a pdf or png file. See Jupyter notebook examples for TensorFlow, PyTorch, and Keras.

The graphs are designed to communicate the high-level architecture. Therefore, low-level details are hidden by default (e.g. weight initialization ops, gradients, internal ops of common layer types, ...etc.). HiddenLayer also folds commonly used sequences of layers together. For example, the Convolution -> RELU -> MaxPool sequence is very common, so they get merged into one box for simplicity.

Customizing Graphs

The rules for hiding and folding nodes are fully customizable. You can use graph expressions and transforms to add your own rules. For example, this rule folds all the nodes of a bottleneck block of a ResNet101 into one node.

    # Fold bottleneck blocks
    ht.Fold("((ConvBnRelu > ConvBnRelu > ConvBn) | ConvBn) > Add > Relu", 
            "BottleneckBlock", "Bottleneck Block"),

2. Training Metrics in Jupyter Notebook

If you run training experiments in Jupyter Notebook then you might find this useful. You can use it to plot loss and accuracy, histograms of weights, or visualize activations of a few layers.

Outside Jupyter Notebook:

You can use HiddenLayer outside Jupyter Notebook as well. In a Python script running from command line, it'll open a separate window for the metrics. And if you're on a server without a GUI, you can save snapshots of the graphs to png files for later inspection. See history_canvas.py for an example of this use case.

3. Hackable

HiddenLayer is a small library. It covers the basics, but you'll likely need to extend it for your own use case. For example, say you want to represent the model accuracy as a pie chart rather than a plot. This can be done by extending the Canvas class and adding a new method as such:

class MyCanvas(hl.Canvas):
    """Extending Canvas to add a pie chart method."""
    def draw_pie(self, metric):
        # set square aspect ratio
        self.ax.axis('equal')
        # Get latest value of the metric
        value = np.clip(metric.data[-1], 0, 1)
        # Draw pie chart
        self.ax.pie([value, 1-value], labels=["Accuracy", ""])

See the pytorch_train.ipynb or tf_train.ipynb for an example.

The keras_train.ipynb notebook contains an actual training example that illustrates how to create a custom Canvas to plot a confusion matrix alongside validation metrics:

Demos

PyTorch:

TensorFlow:

  • tf_graph.ipynb: This notebook illustrates how to generate graphs for various TF SLIM models.
  • tf_train.ipynb: Demonstrates tracking and visualizing training metrics with TensorFlow.
  • history_canvas.py: An example of using HiddenLayer without a GUI.

Keras:

  • keras_graph.ipynb: This notebook illustrates how to generate graphs for various Keras models.
  • keras_train.ipynb: Demonstrates model graphing, visualization of training metrics, and how to create a custom Keras callback that uses a subclassed Canvas in order to plot a confusion matrix at the end of each training epoch.

Contributing

HiddenLayer is released under the MIT license. Feel free to extend it or customize it for your needs. If you discover bugs, which is likely since this is an early release, please do report them or submit a pull request.

If you like to contribute new features, here are a few things we wanted to add but never got around to it:

  • Support for older versions of Python. Currently, it's only tested on Python 3.6.
  • Optimization to support logging big experiments.

Installation

1. Prerequisites

  • a. Python3, Numpy, Matplotlib, and Jupyter Notebook.

  • b. Either TensorFlow or PyTorch

  • c. GraphViz and its Python wrapper to generate network graphs. The easiest way to install it is

    If you use Conda:

    conda install graphviz python-graphviz

    Otherwise:

2. Install HiddenLayer

a. Clone From GitHub (Developer Mode)

Use this if you want to edit or customize the library locally.

# Clone the repository
git clone [email protected]:waleedka/hiddenlayer.git
cd hiddenlayer

# Install in dev mode
pip install -e .

b. Using PIP ("stable" release)

pip install hiddenlayer

c. Install to your site-packages directly from GitHub

Use the following if you just want to install the latest version of the library:

pip install git+https://github.com/waleedka/hiddenlayer.git
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].