原创 AdaptiveAvgPool2d 測試

import torch.nn as nn import torch # 創建三維tensor a = torch.randn(3,4,5) print(a.shape) print(a) # 升維,升成四維 a = torch.u

原创 pytorch彩色圖像轉灰度圖像

from torchvision import transforms transform = transforms.Compose([ transforms.Grayscale(num_output_channels=1)

原创 ConvTranspose2d 輸出尺寸計算方法

轉自:https://www.jianshu.com/p/3ca870451d74 torch.nn.ConvTranspose2d類輸出尺寸計算方法 torch.nn.ConvTranspose2d(in_channels, out_c

原创 plt顯示灰度圖出現Invalid shape問題

轉自:https://blog.csdn.net/grllery/article/details/102470263 transform = transforms.Compose([ transforms.Grayscale(n

原创 python圖結構展示

import networkx as nx import matplotlib.pyplot as plt from pylab import mpl social_network = {'小張': ['老王', '小劉', '小西'

原创 python統計單詞出現的次數

from collections import Counter text = 'hello world hello world hello hello world hello world' print(Counter(text.s

原创 SM2加密解密工具

非原創,網上找的資源,具體地址忘了,請見諒 Cipher類 package com.zjxt.test_post_demo.sm2utils; import java.math.BigInteger; import org.bou

原创 python表示softmax函數

import numpy as np def softmax(v : [int]): l1 = list(map(lambda x: np.exp(x), v)) return list(map(lambda x:

原创 將圖片以流的形式複製,並將中間的字節數組用base64編碼後再解碼

package com.zjxt.demo.test; import org.apache.commons.codec.binary.Base64; import java.io.*; /** * @Author: heihe

原创 torch.max() and torch.view()

import torch import numpy as np np_a = np.array([[1,2,3],[4,5,6],[7,8,9]]) tensor_a = torch.from_numpy(np_a.astype('

原创 python jupiter安裝模塊

!pip install package

原创 python字符串轉數組

import re line = '''{name:'蘭州',name:'張掖', geoCoord:[103.73, 36.03]},''' city = re.findall("name:'(\w+)'",line) code =

原创 python圖搜索深度優先和廣度優先的自我理解

def search_graph(network, start): need_check = [start] expansion = [] while need_check: person = n

原创 使用procyon-decompiler完成反編譯

原文鏈接:https://blog.csdn.net/z_k_h/article/details/80340451 轉自:https://blog.csdn.net/z_k_h/article/

原创 文件隱藏在圖片中

原文鏈接:https://blog.csdn.net/weixin_35757704/article/details/76147518 轉自:https://blog.csdn.net/weix