摘要: 将maven本地仓库中没有的jar包下载下来,这里以hibernate-c3p0为例 下载地址: https://mvnrepository.com/ 这里选择5.0.7.Final版本 下载好后放到本地一个位置 然后进入cmd 执行 mvn install:install-file -Dfile= 阅读全文
posted @ 2020-11-25 15:58 fjlruo 阅读(42) 评论(0) 推荐(0) 编辑
摘要: os.makedirs(path) 注意path中要使用\\,且在windows系统中不能出现: 阅读全文
posted @ 2020-11-22 22:59 fjlruo 阅读(100) 评论(0) 推荐(0) 编辑
摘要: 比如一个softmax向量y_soft为[0.8,0.2] 但最后要使用它的单热形式y_hard[1,0] 如果反向传播是对y_soft进行,那么y_soft可以进行如下处理后传给下一步: y=(y_hard-y_soft).detach()+y.soft() y和y_hard值一样,但是求导是对y 阅读全文
posted @ 2020-11-21 15:24 fjlruo 阅读(357) 评论(0) 推荐(0) 编辑
摘要: 用于截断反向传播 detach()源码: def detach(self): result = NoGrad()(self) # this is needed, because it merges version counters result._grad_fn = None return resu 阅读全文
posted @ 2020-11-21 14:38 fjlruo 阅读(1118) 评论(0) 推荐(0) 编辑
摘要: (212) 555-1212对这种类型的字符串,普通正则表达式会写为:(\d{3})\s\d{3}-\d{4} 其中/d匹配0-9任意数字,{3}代表重复3次,\s匹配空格,()匹配括号,-匹配- 但在java中,java字符串中的\具有特殊含义,如果就按照普通正则表达式那么写所以会报错 所以用\\ 阅读全文
posted @ 2020-11-03 16:18 fjlruo 阅读(743) 评论(2) 推荐(0) 编辑
摘要: 运行时间0ms 超过100%思路不复杂,就是分类讨论,从低位往高位计算,radix代表下一位计算结果往上进的位(以下称为r)tmp1,tmp2表示a,b的最低位,key代表结果中对应位的取值,一共有如下6种情况:1.tmp1^tmp2=1,r=1则key=0,r被更新为12.tmp1^tmp2=1, 阅读全文
posted @ 2020-11-01 10:41 fjlruo 阅读(57) 评论(0) 推荐(0) 编辑
摘要: 安装nexus发现报错为 java.lang.TypeNotPresentException: Type javax.xml.bind.JAXBContext not present 这是由于nexus安装目录下lib文件夹缺少两个jar包 jaxb-api-2.2.7.jar 和 activati 阅读全文
posted @ 2020-10-29 22:54 fjlruo 阅读(205) 评论(0) 推荐(0) 编辑
摘要: 没啥说的,直接上代码 class Solution { public int combinationSum4(int[] nums, int target) { if(nums==null||nums.length==0||target==0) return 0; int[] dp=new int[ 阅读全文
posted @ 2020-10-29 11:40 fjlruo 阅读(45) 评论(0) 推荐(0) 编辑
摘要: class Solution { public int minSteps(int n) { int[] dp=new int[n+1]; dp[0]=0; for(int i=1;i<=n;i++){ dp[i]=i; for(int k=1;k<n/2;k++){ if(i%k==0){ dp[i 阅读全文
posted @ 2020-10-28 17:18 fjlruo 阅读(79) 评论(0) 推荐(0) 编辑
摘要: 有两种解法,一种是求两个单词的最长公共子列,最后结果为m*n-dp[m][n] 其中dp[m][n]表示两个单词的最长公共子列长度 另一种解法是直接算: class Solution { public int minDistance(String word1, String word2) { int 阅读全文
posted @ 2020-10-28 16:20 fjlruo 阅读(57) 评论(0) 推荐(0) 编辑