08 2025 档案

摘要:##手写数字识别 # 对分类任务而言,标签不可以用数值表示,而应该用向量表示(向量有相似度)。因此,我们需要将标签转换为独热编码形式(onehot )。 # 导入必要的库 import numpy as np # numpy库 import os # 操作系统库 import struct # 数据 阅读全文
posted @ 2025-08-29 17:33 李大嘟嘟 阅读(4) 评论(0) 推荐(0)
摘要:由计算结果可见,softmax和交叉熵结合之后求导,就是softmax之后的结果减去对应的y值,由此进行反向传播。 https://blog.csdn.net/weixin_44750512/article/details/129185574 阅读全文
posted @ 2025-08-29 17:27 李大嘟嘟 阅读(2) 评论(0) 推荐(0)
摘要:https://zhuanlan.zhihu.com/p/56638625 阅读全文
posted @ 2025-08-29 17:18 李大嘟嘟 阅读(6) 评论(0) 推荐(0)
摘要:https://zhuanlan.zhihu.com/p/134495345 阅读全文
posted @ 2025-08-29 16:42 李大嘟嘟 阅读(6) 评论(0) 推荐(0)
摘要:https://zhuanlan.zhihu.com/p/168562182 这个更清楚些 https://blog.csdn.net/bitcarmanlee/article/details/82320853 阅读全文
posted @ 2025-08-29 16:25 李大嘟嘟 阅读(3) 评论(0) 推荐(0)
摘要:参考 https://zhuanlan.zhihu.com/p/155748813 https://www.birdpython.com/posts/5/22/ https://blog.csdn.net/bwqiang/article/details/110203835 阅读全文
posted @ 2025-08-28 15:57 李大嘟嘟 阅读(5) 评论(0) 推荐(0)
摘要:pip install matplotlib 阅读全文
posted @ 2025-08-28 15:54 李大嘟嘟 阅读(2) 评论(0) 推荐(0)
摘要:这个怪难的,而且预测的也没那么准 # 逻辑回归 import numpy as np # 导入numpy库 def sigmoid(x): # sigmoid函数是激活函数,用于将线性模型转换为概率模型 result = 1 / (1 + np.exp(-x)) # 计算sigmoid函数 retu 阅读全文
posted @ 2025-08-27 16:34 李大嘟嘟 阅读(4) 评论(0) 推荐(0)
摘要:https://blog.csdn.net/FriendshipTang/article/details/137601972 https://jishuzhan.net/article/1957858919996502018 阅读全文
posted @ 2025-08-27 15:57 李大嘟嘟 阅读(4) 评论(0) 推荐(0)
摘要:Sigmoid函数 https://baike.baidu.com/item/Sigmoid函数/7981407 https://blog.csdn.net/hy592070616/article/details/120617176 阅读全文
posted @ 2025-08-27 15:56 李大嘟嘟 阅读(3) 评论(0) 推荐(0)
摘要:python -m pip install scikit-learn 阅读全文
posted @ 2025-08-26 16:11 李大嘟嘟 阅读(6) 评论(0) 推荐(0)
摘要:线性回归 y=k1x1+k2x2+b import random import numpy as np 数据获取 xs1 = np.array([i for i in range(2003, 2023)]) # 年份,2003-2022 xs2 = np.array([random.randint( 阅读全文
posted @ 2025-08-26 15:59 李大嘟嘟 阅读(4) 评论(0) 推荐(0)
摘要:reshape()函数用于在不更改数据的情况下为数组赋予新形状。 参考: https://blog.csdn.net/weixin_43937759/article/details/106605680 https://blog.csdn.net/mingyuli/article/details/81 阅读全文
posted @ 2025-08-26 15:52 李大嘟嘟 阅读(5) 评论(0) 推荐(0)
摘要:dstack方法的主要作用是将两个或更多的数组沿着第三个轴(深度方向)堆叠起来。 import numpy as np # 创建两个二维数组(具有相同的行数和列数) a = np.array([[1, 2], [3, 4]]) b = np.array([[5, 6], [7, 8]]) # 使用d 阅读全文
posted @ 2025-08-26 15:49 李大嘟嘟 阅读(5) 评论(0) 推荐(0)
摘要:np.array 是 NumPy 中最基础、最核心的函数之一,用于创建一个 NumPy 数组(ndarray)。下面我们详细讲解它的用法、参数、示例以及常见注意事项。 一、基本语法 numpy.array(object, dtype=None, copy=True, order='K', subok 阅读全文
posted @ 2025-08-26 15:39 李大嘟嘟 阅读(13) 评论(0) 推荐(0)
摘要:shape函数是Numpy中的函数,它的功能是读取矩阵的长度。 直接用.shape可以快速读取矩阵的形状, shape[0]代表行数, shape[1]代表列数。 参考:https://blog.csdn.net/wzk4869/article/details/126022909 阅读全文
posted @ 2025-08-26 15:31 李大嘟嘟 阅读(4) 评论(0) 推荐(0)
摘要:![584322d5aeea8e48f1bb3c0661a6dd9d](https://img2024.cnblogs.com/blog/2709094/202508/2709094-20250820223218959-2145041188.png) ![e8d6f57e9adecfa7a9510640a0d6b946](https://img2024.cnblogs.com/blog/27090 阅读全文
posted @ 2025-08-20 22:32 李大嘟嘟 阅读(4) 评论(0) 推荐(0)
摘要:pip install jupyterlab 阅读全文
posted @ 2025-08-20 22:25 李大嘟嘟 阅读(14) 评论(0) 推荐(0)
摘要:# 线性回归 # y=k1x1+k2x2+b import random # 数据获取 xs1 = [i for i in range(2003, 2023)]#年份 xs2 = [random.randint(60, 150) for i in range(2003, 2023)]#面积 ys = 阅读全文
posted @ 2025-08-20 21:46 李大嘟嘟 阅读(3) 评论(0) 推荐(0)
摘要:# 线性回归 # y=kx+b # 数据获取 xs = [i for i in range(2008, 2023)] ys = [ 5000, 8000, 12000, 20000, 32000, 35000, 40000, 48000, 53000, 54000, 57000, 58000, 59 阅读全文
posted @ 2025-08-20 21:19 李大嘟嘟 阅读(8) 评论(0) 推荐(0)
摘要:https://www.cnblogs.com/BlogNetSpace/p/18861160 阅读全文
posted @ 2025-08-20 20:48 李大嘟嘟 阅读(3) 评论(0) 推荐(0)
摘要:# 梯度下降 # 损失函数的意义是衡量预测值与真实值的差距,越小越好,这里的损失函数是平方误差。 # 梯度下降算法的基本思想是: # 1. 随机初始化模型参数 # 2. 计算损失函数关于模型参数的导数 # 3. 根据导数更新模型参数,使得损失函数最小 # 4. 重复2、3步,直到模型参数收敛或达到最 阅读全文
posted @ 2025-08-20 20:26 李大嘟嘟 阅读(2) 评论(0) 推荐(0)
摘要:参考: https://blog.csdn.net/QLeelq/article/details/122310742 阅读全文
posted @ 2025-08-12 02:28 李大嘟嘟 阅读(5) 评论(0) 推荐(0)
摘要:pip install pandas pip install openpyxl 阅读全文
posted @ 2025-08-12 02:26 李大嘟嘟 阅读(13) 评论(0) 推荐(0)
摘要:# 这版代码是将数据集的读取和处理分离,同时将文本和标签构建字典 # 字典的构建方法是将所有文本中的词汇和标签都加入字典,并给每个词汇和标签分配一个索引 # max_len是设置的最大长度,超过这个长度的文本将被截断 # 如果文本长度小于max_len,则用0填充 # 导入numpy库,并将处理过的 阅读全文
posted @ 2025-08-12 02:22 李大嘟嘟 阅读(1) 评论(0) 推荐(0)
摘要:Question enumerate Answer all_label` � Question enumerate Answer enumerate 是 Python 的一个内置函数,用于在遍历可迭代对象(如列表、字符串等)时,同时获取元素的索引和值。它的基本语法如下: enumerate(iter 阅读全文
posted @ 2025-08-12 01:00 李大嘟嘟 阅读(6) 评论(0) 推荐(0)
摘要:Question raise的用法 Answer 在 Python 中,raise 关键字用于手动引发(抛出)异常。这在处理错误、异常情况或需要中止程序正常流程时非常有用。以下是 raise 关键字的基本用法和一些常见示例: 基本用法 raise 异常类型([异常参数]) 异常类型:这是你想要引发的 阅读全文
posted @ 2025-08-11 23:59 李大嘟嘟 阅读(63) 评论(0) 推荐(0)
摘要:import os import math import random def read_file(filepath): with open(filepath, "r", encoding="utf-8") as f: all_lines = f.read().split("\n") # print 阅读全文
posted @ 2025-08-11 23:56 李大嘟嘟 阅读(4) 评论(0) 推荐(0)
摘要:train2 我国科学家在脑图谱研究领域取得新突破 民生 活力中国调研行|好用好玩!科技I点亮百姓生活 财经 为何动物伪装不完美也能吓退天敌? 科技 重庆黔江被确认为白垩纪恐龙化石集群埋藏地 科技 研究发现运动抗衰老的关键因子 科技 智能设备织密暑期“安全网” 科技 我国首个海水漂浮式光伏项目建成投 阅读全文
posted @ 2025-08-11 00:42 李大嘟嘟 阅读(2) 评论(0) 推荐(0)
摘要:代码再优化,解耦,Dataset负责数据,Dataloder负责数据处理 import os import math import random all_text = [] # 定义一个空列表all_text all_label = [] # 定义一个空列表all_label def read_fi 阅读全文
posted @ 2025-08-10 10:57 李大嘟嘟 阅读(2) 评论(0) 推荐(0)