NTU_ML_HW1
Homework 1: COVID-19 Cases Prediction (Regression)
Objectives:
Solve a regression problem with deep neural networks (DNN).
Understand basic DNN training tips.
Familiarize yourself with PyTorch.
If you have any questions, please contact the TAs via TA hours, NTU COOL, or email to mlta-2022-spring@googlegroups.com
Download data
If the Google Drive links below do not work, you can download data from Kaggle, and upload data manually to the workspace.
12!gdown --id '1kLSW_-cW2Huj7bh84YTdimGBOJ ...
GPT问答_NN数据拟合源码拆解
Sample code for PyTorch
12345678def same_seed(seed): '''Fixes random number generator seeds for reproducibility.''' torch.backends.cudnn.deterministic = True torch.backends.cudnn.benchmark = False np.random.seed(seed) torch.manual_seed(seed) if torch.cuda.is_available(): torch.cuda.manual_seed_all(seed)
这是一个函数,看起来用于设置随机数生成器的种子以实现可重复性。以下是每一句的解释:
def same_seed(seed):
这是一个Python函数的定义,名为same_seed,它接受一个参数seed。
'''Fixes random number generat ...
人工智能导论HW2黑白棋实验报告
报告题目:黑白棋游戏&博弈算法
detect0530@gmail.com
1 引言
过去曾有关注过博弈论的相关算法,比如那什均衡、博弈树。但是因为效率的担心,往往忽略了最为传统但又花样百出的搜索博弈。这次作业,我将尝试用搜索博弈的思维来考虑黑白棋游戏。
2 实验内容
2.1 Task1 介绍minimax的实现
12345public MiniMaxDecider(boolean maximize, int depth) { this.maximize = maximize; this.depth = depth; computedStates = new HashMap<State, Float>();}
这里的maximize表示当前的决策者是最大化还是最小化,depth表示搜索的深度,computedStates表示已经计算过的状态,用HashMap进行存储。
1234567891011121314151617181920212223242526public Action decide(State state) ...
搜索和演化算法HW1实验报告
报告题目:Pacman Game
detect0530@gmail.com
1 引言
在个人过去的实践中,搜索算法是低效暴力的代名词,但是通过本课程的学习,从深度优先宽度优先到代价优先,再到A*算法,我才发现搜索算法的强大之处。优秀的启发式函数可以大大提高搜索效率,搜索算法的强大之处在于其可以解决各式各样的问题,比如本次实验中的pacman游戏,可以通过搜索算法来解决。并在一次次优化算法的过程中,我也对搜索算法有了更深的理解。
2 实验内容
2.1 TASK1 dfs&bfs in Maze Problem
2.1.1 防止走同样的点
和所有的搜索算法一样,如果遇到了重复的点,那么大可不必再走一遍。
于是在后续所有的程序里,我用VisitedNodeVisitedNodeVisitedNode作为list存储当前的已经走过的状态,如果当前状态已经走过,那么就不再走这个点。
2.1.2 数据结构的选择
在这个实验中,我选择了StackStackStack作为深度优先搜索的数据结构,QueueQueueQueue作为宽度优先搜索的数据结构。
2.1.3 核心代码展示
123 ...
人工智能导论HW1实验报告
报告题目:Bait游戏&搜索算法
detect0530@gmail.com
引言:
在个人过去的实践中,搜索算法是低效暴力的代名词,但是通过本课程的学习,从深度优先宽度优先到代价优先,再到A*算法,我才发现搜索算法的强大之处。优秀的启发式函数可以大大提高搜索效率,搜索算法的强大之处在于其可以解决各式各样的问题,比如本次实验中的Bait游戏,可以通过搜索算法来解决。并在一次次优化算法的过程中,我也对搜索算法有了更深的理解。
2 实验内容
2.1 Task1: 深度优先搜索
2.1.1 记录走过的状态
要求使用深度优先搜索完成Bait游戏,我们首先要确保一定可以遍历完所有的情况(即completion),因为游戏规定精灵可以上下左右移动,那么每张地图都构成一个图,那么首要问题就是避免死循环,即避免走“回头路”,我们使用
1private ArrayList<StateObservation> Visited= new ArrayList<StateObservation>();
定义一个状态数组表示已经走过的状态,仔细阅读源码框架后,StateObs ...
To_Do_List
如何判断一个问题时np难问题
mac item2 各种plugin
命令行里无法使用vpn连接
NJU课程
DS
斐波那契堆 + 可视化展示
搜索与演化算法
HW4 - 芯片放置问题
科研实践
diffusion model 数字水印相关paper
To do list
机器学习
吴恩达课程 ✔
书籍
CS229
python学习
NunPy
Pytorch
c++学习
异常及其处理 ✔
调试方法
线程管理
科研实践
英文:
Latent Diffusion论文:https://arxiv.org/pdf/2112.10752.pdf
Diffusion Models详细公式:https://lilianweng.github.io/posts/2021-07-11-diffusion-models/
各种微调模型方法对比:https://www.youtube.com/watch?v=dVjMiJsuR5o
Scheduler对比图来自论文: https://arxiv.org/pdf/2102.09672.pdf
VAE结构图出处:https://t ...
Date Structure
Data Structure
链表
我们让insert操作和delete操作都返回head,可以简化代码实现。
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106#include <iostream>#include<bits/stdc++.h>using namespace std;// 定义双向链表节点的结构体struct Node { int data; // 存储数据 Node* prev; // 指向前一个节点的指针 Node* next; // 指向下一个节点的指针 Node(int val) : dat ...
Diffusion入门--training
本文介绍有关diffusiondiffusiondiffusion训练的相关
给定数据集进行训练
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186 ...
Diffusion入门--inference
本文为diffusion库用于推理的基本介绍,以代码块功能和实现为主。
三行简化版:
12345678910111213from diffusers import DiffusionPipelineimport ospipeline = DiffusionPipeline.from_pretrained("/data1/sdmodels/stable-diffusion-v1-4", use_safetensors=True)pipeline.to("cuda")image = pipeline("An image of a squirrel in Picasso style").images[0]output_dir = "/data1/sdtest/"output_filename = "2.1.png"output_path = os.path.join(output_dir, output_filename)image.save(output_path)print(" ...
linux常用指令集
远程连接
SFTP上传本地文件
csdn blog
clash for linux
clash for linux
指定服务器调用显卡
export CUDA_VISIBLE_DEVICES=1,3
conda & anaconda & pip
csdn blog
pip换源
python -m pip config set global.index-url http://mirrors.cloud.tencent.com/pypi/simple
代理
一次性打开代理
123export http_proxy=http://127.0.0.1:7890export https_proxy=http://127.0.0.1:7890export ALL_PROXY=socks5://127.0.0.1:7891
打开代理:
clash -d ~/.config/clash
如果你想要临时关闭终端会话中的代理设置,可以运行以下命令:
1unset https_proxy http_proxy all_proxy ALL_PROXY
关于科学上网:
要设置 https_p ...