自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(149)
  • 资源 (1)
  • 收藏
  • 关注

原创 Typora的使用

Typora的使用1. 下载2. 快捷键使用3. Markdown使用4. 图片的插入4.1 对于复制的图片的处理前段时间登不上CSDN,于是尝试寻找一个好用的Markdown编辑器,遂发现了Typora!一款极简的Markdown编辑器1. 下载官网下载地址:https://typora.io/#download2. 快捷键使用选中光标所在的整句: cmd+L跳到光标位置: cmd+J选中当前的词语:cmd+D删除当前的词语:shift+cmd+D调整标题大小(H1,H2,…):c

2021-06-10 14:02:20 321

原创 INF443 整理

INF443 整理0. 一些词汇1. Pipeline du rendu projectifRendu ProjectifAlgorithme du rendu projectif1. Transformation de la géométrie: Transformation Projective2. Élimination des parties cachéesAlgorithme de balayageAlgorithme du peintreTampon de profondeur (Z-buffe

2021-05-27 03:16:35 627

原创 INF 442 Amphi 8: Linear models for classification

INF 442 Amphi 7: Linear models for classificationIntroductionIntroductionPrediction Error: L:Y×Y→RL: \mathcal{Y} \times \mathcal{Y} \to \mathbb{R}L:Y×Y→R目的: minE(X,Y)L(Y,f(X))min \mathbb{E}_{(X,Y)}L(Y,f(X))minE(X,Y)​L(Y,f(X))实际上:min1n∑iL(Yi,f(Xi))min \

2021-05-15 04:02:16 316

原创 Word2Vec

word2vec0.基本知识0.1 语言模型:0.1.1 统计语言模型 - Laplalce Smoothing - 马尔可夫假设0.1.2 语言模型评价指标:困惑度(Perplexity)0.基本知识0.1 语言模型:计算一个句子是句子的概率的模型。即这些词语按照一定顺序放在一起的概率。应用:输入法0.1.1 统计语言模型 - Laplalce Smoothing - 马尔可夫假设P(s)=P(w1,...,wn)=P(w1)P(w2∣w1)…P(wn∣w1,....,wn−1)P(s)=P(

2021-05-09 19:01:34 476

原创 INF442 Amphi 7:Linear models for regression | Standard Template Library

INF442 Amphi 7:Linear models for regression | Standard Template Libraryk-NN的优缺点1. Linear model for regressionOrdinary Least Squares(OLS) estimatorOptimalityEvaluationDegenerate CasesSol: RegularizationRidge Regression2. Non-Linear regression2.1 Using basis

2021-05-03 20:27:09 191

原创 INF443 Amphi 7: Modélisation Surfacique

INF443 Amphi 7: Modélisation SurfaciqueIntroduction1. Création constructive1.1 Création de primitives1.1.1 Surfaces de révolution1.1.2 Balayage axial (sweeping)1.1.3 Extrusion (free-form sweeping)1.1.4 Création de primitives 的问题1.2 Assemblage1.2.1 Racordem

2021-05-01 21:23:25 275

原创 INF443 Amphi 6: Animation par modèles générateurs

INF443 Amphi 6: Animation par modèles générateurs0. Introuction1. Principes1.1 一些例子1.2 Discrétisation1.3 Boucle d'animation2. Collisions2.1 Détection des collisions2.1.1 Phase Large2.1.2 Phase fine2.2 Réponse aux collisions2.2.1 Par impulsion (轻的或者很重的物体)2.

2021-05-01 19:20:37 175

原创 INF443 Amphi 5: Animation Descriptive

INF443 Amphi 5: Animation Descriptive1.Introduction2. Interpolation des positions3. Interpolation d'orientation3.1 Matrice de rotation3.2 Angles d'Euler3.3 Quaternions4. Animation de solides articulés5. Interpolation des formes1.Introduction为了得到动画,需要25-

2021-05-01 17:34:23 131

原创 2021-04-29 403. 青蛙过河 [dfs,动态规划]

403. 青蛙过河思路一:DFS 暴搜class Solution { HashMap<Integer,Integer> map = new HashMap<>(); // step: 上一步走了多少步 // idx: 当前石头块编号 public boolean dfs(int[] stones, int step,int idx){ if(idx == (stones.length-1)){ // Sy

2021-04-29 20:25:04 289

原创 2021-04-28 633. 平方数之和

633. 平方数之和思路一:利用sqrt为了避免溢出,需要用long。class Solution { public boolean judgeSquareSum(int c) { // 利用sqrt long a = (long)Math.sqrt(c); for(long i=a;i>=0;i--){ long b = (long)Math.sqrt(c-i*i); if((c-i*i-b

2021-04-28 20:37:19 151

原创 2021-04-27 938. 二叉搜索树的范围和 [dfs,递归]

938. 二叉搜索树的范围和思路一: 暴力DFSclass Solution { int sum = 0; public void dfs(TreeNode root,int low, int high){ if(root == null) return; dfs(root.left,low,high); if(low<=root.val && root.val <=high){

2021-04-27 23:47:25 73

原创 Java 概念HandBook

Java 概念HandBook1. 基本语法1.1 基本数据结构1.2 方法1.3 递归2. 面向对象2.1 面向对象的概念2.2 构造方法 Constructor2.3 静态(static)和实例2.4 初始化块2.5 关键字 this2.6 可见性修饰符和数据域封装2.7 字符串2.8 继承2.9 Object类的部分方法2.10 抽象类和接口2.10 例子:自定义比较方法 Comparable,2.11 基本数据类型和包装类2.12 面向对象思想2.12.1 类的关系关联聚集和组合 “has-a”依赖

2021-04-27 06:50:35 525

原创 2021-04-26 1011. 在 D 天内送达包裹的能力 [二分查找]

1011. 在 D 天内送达包裹的能力class Solution { // 判断我们是否能在capacity内完成任务 // 因为是按照给定的顺序,所以只要用O(n) public boolean possible(int[] weights, int D, int capacity){ int tmp = 0; for(int i=0;i<weights.length;i++){ if(tmp + weights[i

2021-04-26 17:16:49 129

原创 隐马尔可夫模型 HMM 在NLP中的运用

隐马尔可夫模型 HMM 在NLP中的运用1. 序列标注问题简介 (Sequence Labelling Introduction)1.1 BMES标注集1.2 词性标注集2. HMM 模型2.1 简介3. HMM 样本生成3.1 例子:医疗诊断4. 概率计算问题4.1 前向概率 - 前向算法4.2 后向概率 - 后向算法4.3 一些由前向概率和后向概率计算的量5. HMM训练 [学习问题]5.1 监督学习5.2 无监督训练: Baum-Weich算法 (EM算法)6. HMM预测 [预测算法]6.1 近似算

2021-04-25 20:49:43 1171

原创 2021-04-25 897. 递增顺序搜索树 [dfs]

897. 递增顺序搜索树思路一:dfs + 重新构建一棵树class Solution { TreeNode start = new TreeNode(); public void dfs(TreeNode root){ if(root==null) return; dfs(root.left); // System.out.println(root.val); start.right = new T

2021-04-25 17:07:36 85

原创 PyTorch | QuickStart

PyTorch | QuickStart1. Quickstart1.1 Data1.2 查询训练用的是CPU还是GPU1.3 创建模型1.4 Optimizing the Model Parameters (优化器设置)1.5 Train & Test1.6 主程序1.7 保存和读取模型2. Tensors2.1 初始化一个Tensor2.2 Attributes of a Tensor2.3 Operations on Tensors2.4 Bridge with NumPy3. DataSet

2021-04-25 01:46:26 745

原创 2021-04-24 377. 组合总和 Ⅳ [动态规划]

377. 组合总和 Ⅳ思路一:回溯法 (超时)class Solution { int tmp = 0; // 记录目前组合的和 int res = 0; // 记录目前有的组合的方案种数 LinkedList<Integer> resTmp = new LinkedList<>(); // 记录目前有的组合方案 // 利用nums public void dfs(int[] nums, int target){ if(tm

2021-04-25 00:04:45 94

原创 2021-04-23 368. 最大整除子集 [动态规划]

368. 最大整除子集因此,我们的结论是,我们每次只需要加入a[n]%a[n−1]==0a[n]\%a[n-1]==0a[n]%a[n−1]==0的元素到list中即可。但是要注意下面的例子[9,18,54,108,540][9,18,90,180,360,720]。即每一个元素的前半部分可能是公用的,如[9,18]。class Solution { public List<Integer> largestDivisibleSubset(int[] nums) {

2021-04-23 23:52:30 102

原创 INF442 Amphi 6: Supervised learning and k-NN predictors | Genericity

INF442 Amphi 6: Supervised learning and k-NN predictors | Genericity1. Supervised Learning1.1 不同的损失函数1.2 Regression with squared error1.3 Classification with 0-1 loss1.4 优缺点1.5 怎么选取k值?1.5.1 Cross-Validation1.5.2 Evaluate a classifier's performance2. Gener

2021-04-22 21:54:25 270

原创 2021-04-22 363. 矩形区域不超过 K 的最大数值和

363. 矩形区域不超过 K 的最大数值和思路一:暴力求解class Solution { public int maxSumSubmatrix(int[][] matrix, int k) { int rows = matrix.length; int cols = matrix[0].length; int max = Integer.MIN_VALUE; int[][][][] dp = new int[rows+1][col

2021-04-22 17:58:42 97

原创 PyTorch学习 | AutoEncoder (自编码器)

PyTorch学习 | AutoEncoder 自编码器1. AutoEncoder 简介2. PyTorch实现参考:https://mofanpy.com/tutorials/machine-learning/torch/autoencoder/1. AutoEncoder 简介即将原数据压缩(Encoder)然后解码(Decoder),我们的目的是让输出尽可能跟输入一样,从而我们压缩保留的就应该是原数据中的精华信息。感觉和GAN有点类似2. PyTorch实现这里我们尝试用MNIST手写

2021-04-21 17:45:32 692

原创 2021-04-21 91. 解码方法 [dfs]

91. 解码方法思路一:能显示解答的做法(超时)class Solution { LinkedList<LinkedList<Integer>> res = new LinkedList<>(); public void dfs(char[] msg,int start,LinkedList<Integer> tmp){ if(start==msg.length){ // System.out.pr

2021-04-21 17:06:18 108

原创 2021-04-20 28. 实现 strStr() [KMP算法]

KMP算法用于在字符串A中寻找是否出现过字符串B第一步:求最长公共前后缀长度,构建Prefix Tablepublic static void getPrefixTable(char[] pattern,int[] prefix){ int n = pattern.length; assert n>0; // 每次填充一个prefix的值 prefix[0]=0; for(int i=1,len=0;i<

2021-04-20 20:13:10 67

原创 2021-04-19 27. 移除元素

2021-04-19 27. 移除元素思路:双指针class Solution { public int removeElement(int[] nums, int val) { int crt = 0, pre = 0; // [0,pre[是已经处理好的要返回的数组,crt每次如果等于val就往后走直到第一个不是val的数 while(crt<nums.length){ while(crt<nums.length &amp

2021-04-19 21:23:36 42

原创 强化学习实践 | DQN和OpenAI Gym中的CartPole

强化学习实践 | DQN1. 直觉介绍2. Experience replay 和 Fixed Q-targets3. 伪代码4. PyTorch实现4.1 CartPole介绍4.2 Dummy Policy4.3 DQN4.4 完整代码(附注释):原论文:Playing Atari with Deep Reinforcement Learning参考:https://mofanpy.com/tutorials/machine-learning/reinforcement-learning/int

2021-04-17 06:00:19 761 1

原创 2021-04-16 87. 扰乱字符串 [动态规划]

87. 扰乱字符串首先不要被这道题目是困难给吓到,实际上还是挺简单的。我们不需要纠结特定的规则,只要关注几个不变量即可。交换不改变字符串的长度,所以如果长度不同就直接返回False如果S被分为s1和s2,T被分为t1和t2,则他们相等的必要前提是s1和t1长度相同。此外,s1的构成元素和t1的构成元素相同。我们引入dp[i][j][l]表示s1[i,i+k-1]是否由s2[j,j+k-1]变换而来。按照规则和我们的第二点观察,dp[i][j][l]=true一定只可能来自于下面两种情况:

2021-04-16 23:42:28 72

原创 强化学习实践 | Sarsa / Sarsa(lambda) 例子

强化学习实践 | Sarsa 例子Q-Learning和Sarsa的区别Sarsa 伪代码二维走迷宫的例子:Sarsa(λ\lambdaλ)参考:https://mofanpy.com/tutorials/machine-learning/reinforcement-learning/tabular-sarsa2/Q-Learning和Sarsa的区别epsilon-greedy使用时机不一样:Q-Learning用epsilon-Greedy选择当前时刻(s)的动作。Sarsa用epsilon-G

2021-04-16 22:47:01 376 1

原创 强化学习实践 | Q-Learning 几个例子

强化学习 Q-Learning 几个例子Q-Learning 算法回顾1. 一维找宝藏总结:2. 二维总结:参考:例子1:https://mofanpy.com/tutorials/machine-learning/reinforcement-learning/general-rl/例子2:https://mofanpy.com/tutorials/machine-learning/reinforcement-learning/tabular-q1/Q-Learning 算法回顾初始化Q表

2021-04-16 20:58:22 611 2

原创 2021-04-15 打家劫舍系列(198, 213, 337) [动态规划]

198. 打家劫舍思路一:dp[i]表示洗劫第i家能获得的最大收益。tmp用来表示[0,i-2]中能获得的最大收益。dp[i]=nums[i]+maxj∈[0,i−2](dp[j])res=maxi∈[0,n]dp[i]dp[i]=nums[i]+max_{j\in[0,i-2]}(dp[j]) \\res = max_{i \in [0,n]} dp[i]dp[i]=nums[i]+maxj∈[0,i−2]​(dp[j])res=maxi∈[0,n]​dp[i]class Soluti

2021-04-15 22:55:28 95

原创 C++ Eigen的安装和使用

C++ Eigen的安装和使用1. 安装Eigen2. 简单测试代码1. 安装Eigen首先前往:http://eigen.tuxfamily.org/index.php?title=Main_Page下载Eigen。我选的是zip。然后解压缩。拖到自己代码的文件夹里,写一个CMakelists.txtcmake_minimum_required(VERSION 3.16)project(testEigen)set(CMAKE_CXX_STANDARD 11)include_dire

2021-04-15 03:49:25 1225

原创 David Silver Lecture 6 | Value Function Approximation

David Silver Lecture 6 | Value Function Approximation1. Introduction2. Incremental Methods2.1 Value Function 预测 | Gradient Descent2.1.1 v^(S,w)\hat{v}(S,w)v^(S,w): Feature Vectors | Linear Function ApproximationTable Lookup Features2.1.2 vπ(S)v_\pi(S)vπ​(S

2021-04-14 21:22:59 293 1

原创 2021-04-14 208. 实现 Trie (前缀树)

208. 实现 Trie (前缀树)思路:每一个节点都有一个属性isEnd,如果isEnd =True,则说明从根结点开始到现在位置是一个之前添加过的词。每一个节点还有26个next指针,指向下一个字母(这里字母用0-25的序号表示),如果下一个字母不存在,则是null每次我们添加一个元素,即说明每一个字母存在,只需要将对应的next指针上开一个节点的空间即可。整个单词的存在由最后一个节点的isEnd = True表示。class Trie { class TrieNode{

2021-04-14 16:39:11 74

原创 2021-04-13 783. 二叉搜索树节点最小距离 [DFS]

783. 二叉搜索树节点最小距离注意这里是任意两个节点,不是相邻!因为是二叉搜索树的原因,我们可以通过BFS获得递增序列class Solution { public int minDiffInBST(TreeNode root) { dfs(root); return 1; } // 左中右 public void dfs(TreeNode root){ if(root==null) retu

2021-04-14 16:34:54 53

原创 2021-04-11 264. 丑数II

263. 丑数把因数一个个除掉。class Solution { public boolean isUgly(int n) { if(n==0) return false; int[] factor = {2,3,5}; for(int f : factor){ while(n%f==0) n/=f; } return n==1; }}...

2021-04-11 22:40:29 70

原创 INF442 Amphi 5: Density estimation|Inheritance

INF442 Amphi 5: Density estimation|Inheritance1. Density Estimation1.1 Quality of a density estimator1.2 Parametric | Non-parametric Estimation1.3 Parametric Method1.3.1 Gaussian Model1.3.2 Mixture Models1.4 Non-parametric Method1.4.1 Histograms1.4.2 Kerne

2021-04-11 19:30:51 275

原创 2021-04-10 263. 丑数

263. 丑数把因数一个个除掉。class Solution { public boolean isUgly(int n) { if(n==0) return false; int[] factor = {2,3,5}; for(int f : factor){ while(n%f==0) n/=f; } return n==1; }}...

2021-04-10 23:49:05 58

原创 David Silver Lecture 5 | Model-Free Control

David Silver Lecture 5 | Model-Free Control1 Introduction1.1 On-policy Learning1.2 Off-policy Learning2 On-Policy Monte-Carlo Control2.1 Generalised Policy Iteration - MC Policy Iteration2.2 ϵ−\epsilon-ϵ−Greedy2.3 GLIE (Greedy in the Limit with Infinite Ex

2021-04-08 00:11:39 324

原创 David Silver Lecture 4 | Model-Free Prediction

David Silver Lecture 4 | Model-Free Prediction1. Introduction2. Monte-Carlo Learning2.1 First-Visit Monte-Carlo Policy Evaluation2.2 Every-Visit Monte-Carlo Policy Evaluation例子:21点 Blackjack3. Temporal-Difference Learning4. TD(λ)(\lambda)(λ)参考:https://zhu

2021-04-06 19:19:54 268 1

原创 剑指 Offer | 动态规划 [14-I,14-II,42,47,63,19,]

剑指 Offer | 动态规划 [14-I,14-II,47,63]42.连续子数组的最大和63. 股票的最大利润14- I. 剪绳子 | 递归+Memoization14- II. 剪绳子 II ????47. 礼物的最大价值19. 正则表达式匹配 | 倒序思考问题Memoization模版注意42.连续子数组的最大和class Solution { // 用tmp[i]表示[0,i]中包括i的最大子数组的和。 // 最后返回的是max i tmp[i] public int

2021-04-06 04:09:21 64

原创 2021-04-06 82.删除排序数组中的重复项 II | 26. 删除有序数组中的重复项 [双指针]

看这架势,估计LeetCode 这个月要是双指针专题了…lol26. 删除有序数组中的重复项class Solution { public int removeDuplicates(int[] nums) { if(nums.length<=1) return nums.length; // [0,pre[ 为原数组[0,cur]删除后最终的结果,即[0,pre[满足题目数组中每一个元素只出现1次的要求。 // 每.

2021-04-06 02:46:02 57

sample_code.zip

OpenGL Sample Code

2021-03-09

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除