logo
publist
写文章

简介

该用户还未填写简介

擅长的技术栈

可提供的服务

暂无可提供的服务

pytorch基础操作

取整函数 torch.abs(变量)加法函数 torch.add(变量,变量)(3)裁剪函数 torch.clamp (变量,上边界,下边界): 输入参数一共有三个,分别是需要进 行裁剪的Tensor数据类型的变量、裁剪的上边界和裁剪的下边界。如果需要裁剪的数小于下边界的话,就将其变为下边界,如果大于上边界的话,就变为上边界,处于边界内的数就直接输入对应的数。(4)...

使用pytorch搭建一个简易神经网络

一.包的引入:import torchbatch_n = 100#每次迭代个数input_data = 1000#输入特征数hidden_layer = 100 #第一个隐层之后的特征数output_data = 10#输出的变量个数1.Batch_n表示每个批次输入的数据量2.Hidden_layer 表示第一个一层的隐层结束后剩余的特征数3.Inpu...

warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-res

在PAT上写C代码的时候出现warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]原因:使用scanf的时候有一个返回值#include <stdio.h>int main() {int a;s...

python读取文件夹内容

1. 文件夹读取文件Python os.listdir() 方法:os.listdir() 方法用于返回指定的文件夹包含的文件或文件夹的名字的列表import os, sys# 打开文件COOKED_FOLDER = './cooked_traces/'#文件夹的地址dirs = os.listdir( path )# 输出所有文件和文件夹for file in dirs:print (file)

#python
RuntimeWarning: Mean of empty slice.

今天早上在编程的时候出现了下面这两句话,在网上找不到什么解决方案。于是自己记录一下D:\anaconda3\envs\torch\lib\site-packages\numpy\core\fromnumeric.py:3373: RuntimeWarning: Mean of empty slice.out=out, **kwargs)D:\anaconda3\envs\torch\lib\sit

到底了