Lesson 8: Learning ShuffleNet v1 and ShuffleNet v2

foreword

With the continuous development of artificial intelligence, the technology of machine learning is becoming more and more important. Many people have started learning machine learning. This article introduces the basic content of machine learning. It comes from Bilibili blogger "Pili Barla Wz". The blogger's learning is used as a note record, and everyone is welcome to discuss and exchange.

1. Build the ShuffleNet network

Learning with ShuffleNet v1, rounds of training rounds (code), each epoch is about minutes.

Second, the code part

1.module.py----Define the network structure of ShuffleNet

The code is as follows (example):

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import warnings
warnings.filterwarnings('ignore')
import  ssl
ssl._create_default_https_context = ssl._create_unverified_context

2.train.py----Load the data set and train, calculate the loss in the training set, calculate the accuracy in the test set, and save the trained network parameters

The code is as follows (example):

data = pd.read_csv(
    'https://labfile.oss.aliyuncs.com/courses/1283/adult.data.csv')
print(data.head())

3.predict.py——After getting the trained network parameters, use the images you find for classification test

在这里插入代码片

3. ShuffleNet v1

insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here

insert image description here
insert image description here

4. ShuffleNet v2

insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here

insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here

Guess you like

Origin blog.csdn.net/qq_45825952/article/details/127074153