Towards AI Can Help your Team Adopt AI: Corporate Training, Consulting, and Talent Solutions.

Publication

Sparsely Connected Custom model-The Simplest Way
Latest   Machine Learning

Sparsely Connected Custom model-The Simplest Way

Last Updated on July 20, 2023 by Editorial Team

Author(s): Akula Hemanth Kumar

Originally published on Towards AI.

Making computer vision easy with Monk, low code Deep Learning tool and a unified wrapper for Computer Vision.

GoogLeNet architecture has sparsely connected layers instead of densely connected layers.

Reference: TDS

Have you ever tried to build a Sparsely connected custom model? If yes, I will show you the simplest way to do it. If no, you are in the right place to get started.

Table of Contents

  1. Installation
  2. Load Data
  3. Create and debug network
  4. Train

Installation

Install Monk, a low code Deep Learning tool and a unified wrapper for Computer Vision.

git clone https://github.com/Tessellate-Imaging/monk_v1.git#Select the requirements file as per OS and CUDA versioncd monk_v1/installation/Linux && pip install -r requirements_cu9.txt

Load Data

Here we are using Stanford Dogs classification dataset.

! wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=1b4tC_Pl1O80of7U-PJ7VExmszzSX3ZEM' -O- U+007C sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=1b4tC_Pl1O80of7U-PJ7VExmszzSX3ZEM" -O dogs-species-dataset.zip && rm -rf /tmp/cookies.txt

Create and debug network

Debug Custom Model

gtf.debug_custom_model_design(network);
View From Bottom to Top

Here we will make a subnetwork with three branches and append it to the base network.

Debug Custom Model

gtf.debug_custom_model_design(network);
View From Bottom to Top

Debug

gtf.debug_custom_model_design(network);
View from bottom to top

We will add another subnetwork with three branches and append to base network.

Debug Custom Model

gtf.debug_custom_model_design(network);
View From Bottom to Top

Debug Custom Model

gtf.debug_custom_model_design(network);
View From Bottom to Top

Visualize with Netron

Let’s visualize the model with Netron.

Train

Set Epochs, Optimizer, losses and learning rate schedulers.

You can find the complete jupyter notebook on Github.

If you have any questions, you can reach Abhishek and Akash. Feel free to reach out to them.

I am extremely passionate about computer vision and deep learning in general. I am an open-source contributor to Monk Libraries.

You can also see my other writings at:

Akula Hemanth Kumar – Medium

Read writing from Akula Hemanth Kumar on Medium. Computer vision enthusiast. Every day, Akula Hemanth Kumar and…

medium.com

Photo by FOODISM360 on Unsplash

Join thousands of data leaders on the AI newsletter. Join over 80,000 subscribers and keep up to date with the latest developments in AI. From research to projects and ideas. If you are building an AI startup, an AI-related product, or a service, we invite you to consider becoming a sponsor.

Published via Towards AI

Feedback ↓