This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
import torch.nn as nn | |
import torch.nn.functional as F | |
# * [1] Inputs and labels | |
inputs = torch.randn(4,3) | |
targets = torch.LongTensor([0,2,1,2]) | |
print('[---Inputs and Targets:---]\n',inputs) | |
print(targets,'\n') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- encoding: utf-8 -*- | |
''' | |
@File : testhead.py | |
@Time : 2020/10/23 21:27:41 | |
@Author : GuokLiu | |
@Contact : liuguokai@hust.edu.cn | |
@Institution : Huazhong Univ. of Sci. and Tech. | |
@Desc : None | |
''' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
from torch import nn | |
import pytorch_lightning as pl | |
from torch.utils.data import DataLoader, random_split | |
from torch.nn import functional as F | |
from torchvision.datasets import MNIST | |
from torchvision import datasets, transforms | |
import os |
- MacOS word 中的格式刷快捷键
Command +Shift + C
Command +Shift + V
- Word 文档中如何批量将所有高亮显示部分提取出来
- Word 稿件被修改了怎么办?教你快速找到方法,而且高亮显示!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
print(np.zeros) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
file_name = 'N09_M07_F10_K001_1.mat' | |
kat = sio.loadmat(file_name)[[i for i in kat.keys() if 'N' in i][0]] | |
sensor = 6 # force:0, current1:1, current2:2, speed:3, torque:4, temperature:5, vibration:6 | |
a = kat['Y'][0, 0][0,sensor][2] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
a = np.ones(1) | |
print(a) |
NewerOlder