摘要: import numpy as np import matplotlib.pyplot as plt import random def generate_chinese_char_data(): # 汉字一到十对应标签0-9 char_names = ["一", "二", "三", "四", "五 阅读全文
posted @ 2025-12-26 13:17 木立青 阅读(7) 评论(0) 推荐(0)
摘要: 这份视频教程旨在通过动画和通俗的讲解,让学习者(即使是初学者)能够理解Transformer这一深度学习核心模型的原理。其内容并非围绕一本特定的书籍展开,而是对一个技术概念(Transformer模型) 的系统教学。 主要内容与结构 教程内容非常系统,从基础知识过渡到核心原理和实战应用,主要可以分为 阅读全文
posted @ 2025-12-26 12:22 木立青 阅读(7) 评论(0) 推荐(0)
摘要: 手写数字识别 import numpy as np import matplotlib.pyplot as plt import time import torch import torch.nn as nn import torch.optim as optim from torch.utils.data im 阅读全文
posted @ 2025-12-26 12:19 木立青 阅读(8) 评论(0) 推荐(0)
摘要: 点击查看代码 import pygame import sys import random pygame.init() WIDTH, HEIGHT = 600, 500 GRID_SIZE = 20 GRID_WIDTH = WIDTH // GRID_SIZE GRID_HEIGHT = HEIG 阅读全文
posted @ 2025-06-22 13:27 木立青 阅读(11) 评论(0) 推荐(0)
摘要: 习题8.1 from random import random def printInatro(): print("这个程序模拟两个选手A何B的某种竞技比赛") print("程序运行需要A和B的能力值(用0到1之间的小数表示)") def getInputs(): a = eval(input(" 阅读全文
posted @ 2025-05-25 20:09 木立青 阅读(40) 评论(0) 推荐(0)
摘要: 7.1 import tokenize import keyword from io import BytesIO def convert_python_file(source_path, target_path): with open(source_path, 'rb') as file: tok 阅读全文
posted @ 2025-05-18 19:26 木立青 阅读(19) 评论(0) 推荐(0)
摘要: 5.1 def drawaq(n): line = 3n+1 for i in range(1,line+1): if i%3 == 1: print(n"+ ",end="") print("+") else: print("| "n,end="") print("|") n = eval(inp 阅读全文
posted @ 2025-04-20 17:39 木立青 阅读(28) 评论(0) 推荐(0)
摘要: 4.1 / 4.4 / 4.5 import random def tar(): target = random.randint(1,1000) #下面代码用来方便测试 #print(target) guess = 0 count = 0 a = 1 b = 1000 while guess != 阅读全文
posted @ 2025-04-06 20:48 木立青 阅读(17) 评论(0) 推荐(0)
摘要: 3.19 import time t = time.gmtime() print(time.strftime("%Y-%m-%d",t)) 3.21 import time scale = 36 start = time.perf_counter() print("执行开始".center(scal 阅读全文
posted @ 2025-03-30 19:32 木立青 阅读(23) 评论(0) 推荐(0)
摘要: 3.1 n = 10 weight = eval(input("请输入你的体重:")) def weight_add(year): Your_weight = weight + 0.5*year return Your_weight earth_weight = weight_add(n) lune 阅读全文
posted @ 2025-03-23 16:53 木立青 阅读(23) 评论(0) 推荐(0)