摘要: 点击查看代码 import torch from torch import optim, nn from torchvision import datasets, transforms from torch.utils.data import DataLoader import torch.nn.f 阅读全文
posted @ 2025-10-22 14:21 佘婷婷 阅读(2) 评论(0) 推荐(0)
摘要: 深度探索图像的语言:卷积神经网络读后感 读完关于卷积神经网络的介绍,我仿佛打开了一扇通往图像世界的新视角。在此之前,我一直认为图像的本质只是像素点组成的二维矩阵,而CNN则像一位经验丰富的翻译官,教会我如何理解这些像素背后所蕴含的丰富信息和深刻含义。 最让我印象深刻的是CNN的层级化特征提取思想。它 阅读全文
posted @ 2025-10-22 14:13 佘婷婷 阅读(6) 评论(0) 推荐(0)
摘要: 点击查看代码 import random from collections import defaultdict import sys class Team: """球队类""" def __init__(self, name, strength): """ 初始化球队 :param name: 球 阅读全文
posted @ 2025-06-22 22:08 佘婷婷 阅读(19) 评论(0) 推荐(0)
摘要: 点击查看代码 import jieba from collections import Counter # 添加自定义词典确保人物名称正确切分 character_names = [ '孙悟空', '孙行者', '行者孙', '齐天大圣', '美猴王', '弼马温', '唐僧', '唐三藏', '玄 阅读全文
posted @ 2025-06-22 21:38 佘婷婷 阅读(11) 评论(0) 推荐(0)
摘要: 点击查看代码 import pygame import sys import random import math # 初始化pygame pygame.init() # 游戏常量 SCREEN_WIDTH = 900 SCREEN_HEIGHT = 600 GRID_SIZE = 80 GRID_ 阅读全文
posted @ 2025-06-22 21:30 佘婷婷 阅读(35) 评论(0) 推荐(0)
摘要: 点击查看代码 import random import time from tqdm import tqdm def calculate_pi(num_samples): """ 使用蒙特卡洛方法计算π。 :param num_samples: 样本数量,即模拟的点数。 :return: 计算得到的 阅读全文
posted @ 2025-04-27 20:26 佘婷婷 阅读(9) 评论(0) 推荐(0)
摘要: 5.1字符田字格绘制 点击查看代码 def print_grid(width): # 打印上边界 print("+" + "-" * (width * 2 - 1) + "+") # 打印中间的横线 for _ in range(width - 1): print("|" + " " * (widt 阅读全文
posted @ 2025-04-20 18:53 佘婷婷 阅读(18) 评论(0) 推荐(0)
摘要: 4.1猜数字游戏的扩展 点击查看代码 #GuessANumMore.py target = 425 guess = 0 n = 0 while guess != target: guess = eval(input("请输入一个猜测的整数(1至1000):")) n += 1 if guess != 阅读全文
posted @ 2025-04-07 20:21 佘婷婷 阅读(26) 评论(0) 推荐(0)
摘要: 计算圆周率PI 计算用到了蒙特卡罗方法: 通过模拟随机点落在区域内的概率,计算圆的面积,间接求得圆周率PI 点击查看代码 from random import random from time import * from tqdm import tqdm N = eval(input()) def 阅读全文
posted @ 2025-03-30 21:47 佘婷婷 阅读(76) 评论(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 点击查看 阅读全文
posted @ 2025-03-30 20:55 佘婷婷 阅读(10) 评论(0) 推荐(0)