[pytorch] freeze part of the network
Preface
The best, most efficient and most concise is Plan One.
Scheme One
Step 1: Fixed basic network
Code template:
# Get the state_dict for the fixed part:
pre_state_dict = torch.load(model_path, map_location=torch.device('cpu')
# Imported (remember strict=False):
model.load_state_dict(pre_state_dict, strict=False)
print('Load mode ...
Posted by tauchai83 on Tue, 14 Sep 2021 09:46:30 -0700
Chapter 5 Qt 5 main window
1, Qt 5 main window composition
QMainWindow is a class that provides users with main window programs, including a menu bar, multiple tool bars, multiple dock widgets, a status bar and a central widget. It is the basis of many applications (such as text editor, picture editor, etc.). This is described in detail in this chapter. The interface la ...
Posted by Arkane on Mon, 13 Sep 2021 17:56:58 -0700
Summary of multithreaded JUC
Processes, Threads, Programs
A process is the smallest unit of the system for resource allocation and scheduling. It is an instance of program execution. A running program is also a container for threads.
Threads are the smallest units that the operating system can schedule operations. They are the actual units of operation in a process, and ...
Posted by Roxie on Mon, 13 Sep 2021 14:12:11 -0700
Troubleshooting Part2 System Administration Troubleshooting
System Administration Troubleshooting
Running out of Memory
Ram: the data being used, such as 2 + 2 = 4, the 2 + 2 process is stored in RAM SWAP: a 100g hard disk, express 4G, is sent out to SWAP. It can be used when there is not enough Memory. Its function is the same as that of stand by Cache: the cache is used in conjunction with the CPU. ...
Posted by sazzie on Mon, 13 Sep 2021 13:41:08 -0700
Singleton mode of Python
Singleton Pattern is a common software design pattern. The main purpose of this pattern is to ensure that only one instance of a class exists. Singleton objects come in handy when you want only one instance of a class in the whole system.
For example, the configuration information of a server program is stored in a file, and the ...
Posted by jamal dakak on Mon, 13 Sep 2021 12:47:47 -0700
[source code co reading] detailed explanation of bisect module of built-in bisection algorithm (half algorithm) in Python
1. Introduction
Bisection algorithm is a very common and commonly used algorithm in programming. Even so, I didn't expect that Python official has a special module to realize most operations of the algorithm. The module is bisect.
In fact, the functions provided by this module are mainly used in such a scenario, that is, after each us ...
Posted by s0me0ne on Sun, 12 Sep 2021 13:30:13 -0700
Beauty of Programming - Memory Functions
Memory function
memcpy memory copy
The function memcpy copies num bytes of data backwards from the source location to the destination's memory location.This function does not stop when it encounters'\0'.If there is any overlap between source and destination, the results of the replication are undefined.
Original Format
Analysis
** Li ...
Posted by bo0 on Sun, 12 Sep 2021 10:54:52 -0700
Using Python to solve hybrid flow shop scheduling problem (HFSP) based on genetic algorithm (GA)
Flexible job shop scheduling has been studied before. The research is summarized as follows: Code implementation of solving flexible job shop scheduling problem based on Genetic Algorithm in python (including detailed description of standard example quasi transformation, coding, decoding, crossover and mutation) Using python to solve the dual r ...
Posted by xray_griff on Sun, 12 Sep 2021 01:13:50 -0700
Pytoch learning notes -- transforms
Why transforms?
Generally, the collected image samples are different in size and brightness. In deep learning, we want the sample distribution to be independent and identically distributed, so we need to normalize the samples.Sometimes only a small amount of sample data can be obtained, and it is not easy to obtain a large number of samples. H ...
Posted by The Chancer on Sun, 12 Sep 2021 00:49:40 -0700
CTFshow question brushing diary MISC pictures (Part 2, 24-51) file structure and color channel
Document structure
Misc24 BMP height change
Tip: the flag is above the picture
bmp format file
The real flag is on the picture. You can see it by changing the height
Misc25 PNG height change
Tip: the flag is under the picture
Just change the height
misc26-crc32
Tip: the flag is still under the picture, but how much is it?
Open t ...
Posted by kaspari22 on Sat, 11 Sep 2021 23:02:31 -0700