• [let’s get down to business] how much do you know about the lantern riddle of the ape Festival?


    The Lantern Festival is coming. The moderator wishes all developers a happy festival! It is said that the Lantern Festival is held on the 15th day of the first month. How can it be called the Lantern Festival without guessing lantern riddles? Today, we gave you a few riddles. It is said that only programmers […]

  • Example explanation of Python user-defined exception


    explain 1. Programs can name their own exceptions by creating a new exception class. Exceptions should typically inherit from the exception class, either directly or indirectly. 2. Exception Python has a large base class that inherits exception. Therefore, our custom class must also inherit exception. example class ShortInputException(Exception): def __init__(self, length, atleast): self.length = length […]

  • The pytorch custom parameter does not update


    Parameters defined in nn.module:You don’t need CUDA, you can find the derivative and back-propagation class BiFPN(nn.Module): def __init__(self, fpn_sizes): self.w1 = nn.Parameter(torch.rand(1)) print(“no—————————————————“,self.w1.data, self.w1.grad) The following example shows that the intermediate variable may not have a gradient, but the final variable has a gradient: Both cy1 and CD have gradients import torch xP=torch.Tensor([[ 3233.8557, 3239.0657, […]

  • Detailed explanation of custom data processing in pytorch


    Pytorch adopts the data saving method of dataset in data and needs to inherit the data.dataset class. If you need to process data yourself, you need to implement two basic methods. :. Getitem: returns a piece of data or a sample, obj [index] = obj. Getitem (index).:. Len: returns the number of samples. len(obj) = […]

  • Detailed explanation of spring boot microservice custom starter principle


    This article mainly introduces the principle of spring boot microservice custom starter in detail. It is introduced in great detail through the example code, which has a certain reference value for everyone’s study or work. Friends in need can refer to it After using spring boot to develop microservices, the number of projects has greatly […]

  • JSP custom tag


    How to customize a tag(collated study notes)Step 1. Create a tag handler classpackage javax.servlet.jsp.tagext Develop tag processor classes for empty bodies —– > 1) implements tag 2) extensions tagsupportThe label processor class of an empty body needs an override method:doStartTag() Return value: tag.skip_ BODYdoEndTag() Return value:1)Tag.EVAL_ Page: let the contents under the label continue2)Tag.SKIP_ Page: […]

  • Custom backpropagation in pytorch, derivation instance


    Customize the backward() function in pytorch. In the process of image processing, we sometimes use our own defined algorithms to process images. Most of these algorithms are based on numpy or SciPy packages. So how to add the gradient of the custom algorithm to the calculation diagram of pytorch, and use the loss. Backward () […]

  • Yanyuan Sida Dragon Boat Festival


    “The green poplar is heavy with rain. “Five color new silk wrapped dumplings”, with a strong aroma of dumplings and a long ancient wind, the custom festival “Dragon Boat Festival” which has spread for more than 2000 years has come with the aroma of dumplings.Yanyuan Sida administration department prepared zongzi and afternoon tea for all […]

  • Python: custom network layer instance


    Custom autograd function For shallow networks, we can manually write forward and backward propagation processes. But when the network becomes large, especially in deep learning, the network structure becomes complex. Forward propagation and backward propagation become more and more complex, so manual writing is very difficult. Fortunately, there is an automatic differentiation package in python […]

  • Pytorch neural network — a tutorial on user defined data set


    The first step is to import the required package import os import scipy.io as sio import numpy as np import torch import torch.nn as nn import torch.backends.cudnn as cudnn import torch.optim as optim from torch.utils.data import Dataset, DataLoader from torchvision import transforms, utils from torch.autograd import Variable Batchsize = 128 # the size of batchsize […]

  • Detailed explanation of custom NavigationBar in react native learning tutorial


    preface At the beginning of learning react native, the version was still 0.20, and there were a lot of problems, especially navigation. First of all, there was the problem of NavigationBar. Navigationios had a NavigationBar, but navigation needed to be customized. Finally, I thought about it. Wouldn’t it be better to define a view by […]

  • JQuery based on Ajax method custom no refresh submit form instance


    This paper introduces the method of jQuery to customize the non refresh submission form based on Ajax method. Share with you for your reference. The specific implementation method is as follows: JQuery’s $. Ajax method can be used to call Ajax. You need to set URL, post, parameters, etc. If you need to write a […]