libtorch study notes - MNIST combat

MNIST libtorch practical exercise Ready to work First download the MNIST database, http://yann.lecun.com/exdb/mnist/ After downloading, do not decompress it with software such as winrar. For example, t10k-images-idx3-ubyte is decompressed into t10k-images.idx3-ubyte. It is best to decompress it with tar in Linux environment. Suppose you unzip t ...

Posted by chrys on Wed, 25 May 2022 15:51:55 +0300

C++ copy constructor

copy constructor We often use a variable to initialize a variable of the same type, so there should be similar operations for custom types, so how to use an existing object to create another same object when creating an object? Constructor: There is only a single parameter, which is a reference to an object of this class type (usually cons ...

Posted by mad81 on Wed, 25 May 2022 10:40:27 +0300

C + + learning | implementation principle of polymorphism virtual destructor, pure virtual function and abstract class

1. Introduction The basic concept of polymorphism and two simple examples based on polymorphism are introduced above. This paper will introduce the specific implementation principle of polymorphism and the use of constructor and destructor in polymorphism. 2. Implementation principle of polymorphism The key to polymorphism is that when a vi ...

Posted by Bullit on Wed, 25 May 2022 10:28:08 +0300

Operating system experiment 11: read / write the specified location information of the disk (just complete the reading)

Experiment 11: read / write the specified location information of the disk (just complete the reading) 1, Experimental purpose (1) Knowledge of Disk Physics. (2) Master the API for disk operation provided by Windows system. (3) Read / write the specified sector according to the entered sector number. 2, Experimental preparation knowledge: intro ...

Posted by floR on Wed, 25 May 2022 06:36:39 +0300

Data structure -- complete version of binary search tree (C + +)

When we search for an integer among n dynamic integers, there are several methods ① Using dynamic arrays, the average time complexity is O(n) ② Using an ordered dynamic array and binary search method, although its worst time complexity is only O(logn), its average time complexity of addition and depth is too high, which is O(n). ③ Using a link ...

Posted by nonexist on Wed, 25 May 2022 04:01:05 +0300

Opencv c + + (image processing)

catalogue 1, Image reading and display 2, Image preprocessing Principle and algorithm of Gaussian blur Canny edge detection 3, Image clipping 4, Draw shapes and add text 5, Perspective transformation 6, Color detection 7, Shape detection and contour detection 8, Face recognition 1, Image reading and display #include<opencv2/imgc ...

Posted by iloveyou on Wed, 25 May 2022 00:49:28 +0300

P1023 (tax and subsidy issues)

Topic background The lower the price of each commodity, the higher the sales volume. Now we know the cost of a commodity and its sales volume at several prices (the product will not be lower than the sales cost), and assume that the change of sales volume between adjacent prices is linear, and after the price is higher than the given maximum ...

Posted by modcar on Tue, 24 May 2022 15:53:06 +0300

Basic notes of C + + operator

Introduction notes to C + + Basics (III) operator Basics Whether you learn or not, C + + is there, seducing you all the time The content is based on the dark horse programmer c + + course handout. I added a small part and put it here as a reference for my review in the future. (this introductory course is highly recommended. It's available on ...

Posted by andy75180 on Tue, 24 May 2022 03:17:52 +0300

[beginners climb Leetcode79] Word Search

Leetcode79 medium\color{#FF4500}{medium}medium Click to enter the original question link: Word Search Related topics: word search II word search II [tag] backtracking search, C++ ASCII subject Discription Given a 2D board and a word, find if the word exists in the grid. The word can be constructed from letters of sequentially adjacent cell ...

Posted by snaack on Tue, 24 May 2022 01:57:25 +0300

Summary of C++ const usage

Time: 202205232202 constexpr usage summary Constants and their definitions Constants are fixed values ​​that do not change during program execution. These fixed values ​​are also called literals. Constants can be of any basic data type, including integer numbers, floating-point numbers, characters, strings, and booleans. Constants are li ...

Posted by CGRRay on Tue, 24 May 2022 00:45:05 +0300