摘要: PyTorch与卷积神经网络读书报告 近期,我观看了B站上适合新手的卷积神经网络(CNN)原理详解视频,并结合PyTorch相关知识进行学习,对CNN在PyTorch中的应用有了更深入的认识。 一、CNN核心原理 CNN通过卷积层用卷积核提取局部特征,参数共享减少了模型参数;池化层(如最大池化、平均 阅读全文
posted @ 2025-10-17 23:40 linlikun 阅读(2) 评论(0) 推荐(0)
摘要: import torch import torch.nn as nn import torch.optim as optim import torchvision import torchvision.transforms as transforms import matplotlib.pyplot 阅读全文
posted @ 2025-10-17 00:32 linlikun 阅读(3) 评论(0) 推荐(0)
摘要: import pygame import random import sys import math # 初始化pygame pygame.init() pygame.mixer.init() # 屏幕设置 SCREEN_WIDTH = 800 SCREEN_HEIGHT = 600 screen 阅读全文
posted @ 2025-06-23 14:22 linlikun 阅读(15) 评论(0) 推荐(0)
摘要: import pygame import random import sys # 初始化pygame pygame.init() # 屏幕设置 SCREEN_WIDTH = 800 SCREEN_HEIGHT = 600 screen = pygame.display.set_mode((SCREE 阅读全文
posted @ 2025-06-22 00:14 linlikun 阅读(33) 评论(0) 推荐(0)
摘要: import turtle import time screen = turtle.Screen() screen.title("7段数码管显示系统时间") screen.setup(width=1000, height=400) screen.bgcolor("black") pen = turt 阅读全文
posted @ 2025-05-05 08:37 linlikun 阅读(5) 评论(0) 推荐(0)
摘要: def draw_grid(width): for _ in range(width + 1): print("+ ", end="") print("+") for _ in range(width): for _ in range(width + 1): print("| ", end="") 阅读全文
posted @ 2025-04-20 21:53 linlikun 阅读(3) 评论(0) 推荐(0)
摘要: import random target = random.randint(1, 100) count = 0 while True: guess = int(input("请输入你猜测的数字:")) count += 1 if guess > target: print("猜大了") elif g 阅读全文
posted @ 2025-04-07 00:12 linlikun 阅读(12) 评论(0) 推荐(0)
摘要: 3.13 s="Python String" print(s.upper()) print(s.lower()) print(s.find('i')) print(s.replace('ing','gni')) print(s.split(' ')) 3.14 print("{:>15s}:{:<8 阅读全文
posted @ 2025-03-30 21:39 linlikun 阅读(11) 评论(0) 推荐(0)
摘要: # 假设初始体重为0kg,可根据实际情况修改 earth_weight = 0 print("年份\t地球体重(kg)\t月球体重(kg)") for year in range(1, 11): earth_weight += 0.5 moon_weight = earth_weight * 0.1 阅读全文
posted @ 2025-03-23 16:18 linlikun 阅读(5) 评论(0) 推荐(0)
摘要: TempStr = input("请输入带有符号的温度值:") if isinstance(TempStr, str) and TempStr[-1] in ['F', 'f']: C = int((float(TempStr[0:-1]) - 32) / 1.8) print(f"转换后的温度是{ 阅读全文
posted @ 2025-03-16 14:45 linlikun 阅读(10) 评论(0) 推荐(0)