import os
import re
import csv
import math
import torch
import keras
import jieba
import random
import warnings
import numpy as np
import pandas as pd
from pylab import *
from torch import nn
from PIL import Image
from tqdm import tqdm
import tensorflow as tf
from torch import optim
# import transformers as tfs
import scipy.stats as stats
import torch.optim as optim
from collections import Counter
import matplotlib.pyplot as plt
from torchvision import transforms
from pandas import Series,DataFrame
from sklearn.metrics import f1_score
from torch.utils.data import random_split
from sklearn.metrics import accuracy_score
from torch.utils.data import Dataset, DataLoader
from sklearn.model_selection import train_test_split
from torch.utils.tensorboard.writer import SummaryWriter
# %matplotlib inline 在页面内显示图像,这样不需要plt.show()语句
%matplotlib inline
warnings.filterwarnings('ignore')
plt.rcParams["axes.unicode_minus"] = False # 图里显示负数
plt.rcParams["font.sans-serif"] = ['Simhei'] # 图里显示中文
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
x_train,x_test,y_train,y_test=train_test_split(x,y,test_size=0.2,random_state=10)
python-神经网络-导包语句
最新推荐文章于 2023-09-12 16:14:22 发布