摘要: 概述 生命周期的每个阶段总是伴随着一些方法的调用,这些方法就是生命周期的钩子函数 钩子函数的作用:为开发人员在不同操作阶段提供了十几 只有 类组件 才有生命周期 生命周期的图片: 同时有: 1.1 创建时 的生命周期执行顺序 编写以下代码,从而验证constructor,render,compone 阅读全文
posted @ 2023-06-12 15:06 Geeksongs 阅读(86) 评论(0) 推荐(0) 编辑
摘要: 一共只有两步。 1.初始化项目 npx create-react-app my-app 2.启动项目,在项目根目录当中执行: cd my-appnpm start 阅读全文
posted @ 2023-06-11 13:02 Geeksongs 阅读(15) 评论(0) 推荐(0) 编辑
摘要: ALTER USER 'root'@'localhost' IDENTIFIED BY 'your password'; flush privileges; exit; 得解! 然后重新登陆: mysql -u root -p 输入你修改的密码即可! 阅读全文
posted @ 2023-04-07 12:41 Geeksongs 阅读(47) 评论(0) 推荐(0) 编辑
摘要: 给定一个字符串 s ,请你找出其中不含有重复字符的 最长子串 的长度。 示例 1: 输入: s = "abcabcbb"输出: 3 解释: 因为无重复字符的最长子串是 "abc",所以其长度为 3。示例 2: 输入: s = "bbbbb"输出: 1解释: 因为无重复字符的最长子串是 "b",所以其 阅读全文
posted @ 2022-12-28 16:54 Geeksongs 阅读(65) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2022-12-07 16:51 Geeksongs 阅读(53) 评论(0) 推荐(0) 编辑
摘要: 在金融风控领域当中,模型可解释性相当重要。我对nips的论文《Monotonic Networks》当中的单调神经网络进行了复现,在权重为正的情况下,我们就称该神经网络为单调神经网络,因为不管如何进行输入,我们输出都会呈现出单调性,也就是输入越大,输出越大。或者输入越大,输出越小。传统的单调神经网络 阅读全文
posted @ 2022-02-11 17:33 Geeksongs 阅读(1389) 评论(0) 推荐(1) 编辑
摘要: 方法一: 首先编写模型结构: class Model(nn.Module): def __init__(self): super(Model,self).__init__() self.l1=nn.Linear(100,50) self.l2=nn.Linear(50,10) self.l3=nn. 阅读全文
posted @ 2022-02-04 22:04 Geeksongs 阅读(2700) 评论(0) 推荐(0) 编辑
摘要: 实现代码如下: import torch.functional as F class LeNet(torch.nn.Module): def __init__(self): super(LeNet, self).__init__() # 1 input image channel (black & 阅读全文
posted @ 2022-02-03 14:56 Geeksongs 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 保存模型: torch.save(model, 'model.pth') 加载模型: model = torch.load('model.pth') 阅读全文
posted @ 2022-02-03 11:45 Geeksongs 阅读(32) 评论(0) 推荐(0) 编辑
摘要: 自定义数据集的代码如下: import os import pandas as pd from torchvision.io import read_image class CustomImageDataset(Dataset): def __init__(self, annotations_fil 阅读全文
posted @ 2022-02-03 11:40 Geeksongs 阅读(352) 评论(0) 推荐(0) 编辑

Coded by Geeksongs on Linux

All rights reserved, no one is allowed to pirate or use the document for other purposes.