摘要: import torch import torch.nn as nn import torch.optim as optim from torch.utils.data import DataLoader, Dataset import os from PIL import Image import 阅读全文
posted @ 2025-11-09 21:05 magixx 阅读(1) 评论(0) 推荐(0)
摘要: 神经网络是模拟生物神经系统结构与功能的人工智能模型,其核心思想源于对人类大脑神经元连接机制的仿生设计。自 20 世纪 40 年代 “感知器” 概念提出以来,神经网络经历了 “兴起 — 低谷 — 复兴” 的多轮迭代,如今已成为深度学习的核心技术基石,在计算机视觉、自然语言处理、语音识别等领域实现了从 阅读全文
posted @ 2025-10-16 00:39 magixx 阅读(24) 评论(0) 推荐(0)
摘要: import torch import torch.nn as nn import torch.optim as optim import torchvision import torchvision.transforms as transforms from multiprocessing imp 阅读全文
posted @ 2025-10-16 00:37 magixx 阅读(9) 评论(0) 推荐(0)
摘要: import jieba from collections import Counter import re 加载红楼梦的文本 def load_text(file_path): with open(file_path, 'r', encoding='utf-8') as file: text = 阅读全文
posted @ 2025-06-22 14:56 magixx 阅读(9) 评论(0) 推荐(0)
摘要: import pygame import time import random 初始化pygame pygame.init() 定义颜色 white = (255, 255, 255) yellow = (255, 255, 102) black = (0, 0, 0) red = (213, 50 阅读全文
posted @ 2025-06-22 14:39 magixx 阅读(28) 评论(0) 推荐(0)
摘要: import random def printIntro(): print("这个程序模拟两个选手A和B的乒乓球竞技比赛") print("程序运行需要A和B的能力值(以0到1之间的小数表示)") def getInputs(): a = float(input("请输入选手A的能力值(0-1): 阅读全文
posted @ 2025-05-25 21:39 magixx 阅读(13) 评论(0) 推荐(0)
摘要: def rewrite_py_file(file_path): try: with open(file_path, 'r', encoding='utf - 8') as f: content = f.read() new_content = "" i = 0 while i < len(conte 阅读全文
posted @ 2025-05-18 20:33 magixx 阅读(12) 评论(0) 推荐(0)
摘要: def drawsquare(num): a=int(num**0.5) for i in range(a): print(a"+ "+"+") for j in range(3): print(a"| "+"|") print(a"+ "+"+") n=eval(input("请输入正整数:")) 阅读全文
posted @ 2025-04-20 21:53 magixx 阅读(18) 评论(0) 推荐(0)
摘要: 习题4.1 target = 425 guess = 0 F = 1 while guess != target: guess = eval(input("请输入一个猜测的整数(1至1000):")) if guess > target: print("猜大了") F += 1 elif guess 阅读全文
posted @ 2025-04-06 19:56 magixx 阅读(30) 评论(0) 推荐(0)
摘要: 3.19 import time t = time.gmtime() print(time.strftime("%Y-%m-%d",t)) 3.20 import time current_time = time.localtime() format1 = time.strftime("%Y年%m月 阅读全文
posted @ 2025-03-30 21:39 magixx 阅读(13) 评论(0) 推荐(0)