上一页 1 2 3 4 5 6 7 ··· 19 下一页
摘要: 远程命令注入: 在lib中插入特定代码,调用lib时会执行代码,主要用于cs系统,例如绕过激活功能 路径遍历: 利用web服务文件交换功能,直接获取文件 例如:http://www.xxx.com/getfile=image.jgp 防御:过滤特殊字符(../)、目录权限控制 sql注入: 例如输入 阅读全文
posted @ 2021-03-18 15:45 致林 阅读(117) 评论(0) 推荐(0) 编辑
摘要: 完全二叉树:除了最后一层,其他层节点都是满的 满二叉树:每层节点都是满的 平衡二叉树: 左右子树高度差不超过1,插入、删除时间复杂度O(logn) 二叉查找树: 左节点小于根节点,根节点小于右节点 最大最小堆: 最大堆:父节点比子节点大,插入删除O(logn) 最小堆:父节点比子节点小,插入删除O( 阅读全文
posted @ 2021-03-15 17:56 致林 阅读(48) 评论(0) 推荐(0) 编辑
摘要: 1. 使用ps查看相关进程 ps -elf | grep python 2. 使用awk提取进程pid ps -elf | grep python|awk '{print $4}' 这里不一定是$4,根据实际情况调整 3. 使用xargs传参并执行kill ps -elf | grep python 阅读全文
posted @ 2021-02-22 17:22 致林 阅读(2372) 评论(0) 推荐(0) 编辑
摘要: 问题 训练模型时,训练到第2个epoch时程序无缘无故消失,没有打印任何异常日志 定位方法 程序加try catch,捕获异常日志,运行python时使用如下命令记录error信息 nohup python xxx.py > nohup.out 2>&1 & 结果:nohup没有记录任何信息,训练过 阅读全文
posted @ 2021-02-22 17:05 致林 阅读(5892) 评论(0) 推荐(0) 编辑
摘要: github: https://github.com/haibincoder/NlpSummary/tree/master/torchcode/classification 使用TextCNN实现文本分类 使用LSTM实现文本分类 使用Transformers实现文本分类 import copy f 阅读全文
posted @ 2021-02-19 15:56 致林 阅读(231) 评论(0) 推荐(0) 编辑
摘要: github: https://github.com/haibincoder/NlpSummary/tree/master/torchcode/classification 使用TextCNN实现文本分类 使用LSTM实现文本分类 使用Transformers实现文本分类 import torch 阅读全文
posted @ 2021-02-19 15:54 致林 阅读(1171) 评论(0) 推荐(0) 编辑
摘要: github: https://github.com/haibincoder/NlpSummary/tree/master/torchcode/classification 使用TextCNN实现文本分类 使用LSTM实现文本分类 使用Transformers实现文本分类 # model # cod 阅读全文
posted @ 2021-02-19 15:49 致林 阅读(624) 评论(0) 推荐(0) 编辑
摘要: 问题 在清华新闻分类数据集上,使用TextCNN效果不错,使用TextLSTM/RNN学习不动,损失和acc均无变化 定位问题 CNN效果有提升,说明train代码和数据没问题; 更改RNN/LSTM结构,加损失函数还是没效果; 修改lr、embed_dim,num_laber均无效果; 本地一步步 阅读全文
posted @ 2021-02-09 10:42 致林 阅读(401) 评论(0) 推荐(0) 编辑
摘要: 信息熵 信息熵也被称为熵,用来表示所有信息量的期望。 公式如下: 例如在一个三分类问题中,猫狗马的概率如下: |label|猫|狗|马| |:--|:--|:--|:--| |predict|0.7|0.2|0.1| |信息量|-log(0.7)|-log(0.2)|-log(0.1)| 信息熵为: 阅读全文
posted @ 2021-02-02 16:07 致林 阅读(719) 评论(0) 推荐(0) 编辑
摘要: 背景 多线程情况下,子线程的sl4j打印日志缺少traceId等信息,导致定位问题不方便 解决方案 打印日志时添加用户ID、trackId等信息,缺点是每个日志都要手动添加 使用mdc直接拷贝父线程值 实现 // 新建线程时: Map<String, String> mdcContextMap = 阅读全文
posted @ 2021-01-21 14:36 致林 阅读(4758) 评论(2) 推荐(0) 编辑
摘要: 预训练&搜索 背景 传统的Term字面匹配无法处理语义相关性,例如“英语辅导”、“新东方” 发展 2013 word2vec 优点:通过无监督学习获得词向量 缺点:无法处理多义词,上下文无关 2018 ELMo 结构:双层双向RNN 优点:上下文相关,动态生成词向量 2017 transformer 阅读全文
posted @ 2021-01-20 10:13 致林 阅读(267) 评论(0) 推荐(0) 编辑
摘要: 背景 使用pytorch加载huggingface下载的albert-base-chinede模型出错 Exception has occurred: OSError Unable to load weights from pytorch checkpoint file. If you tried 阅读全文
posted @ 2021-01-18 14:59 致林 阅读(8649) 评论(0) 推荐(1) 编辑
摘要: 背景:云物理机没安装tf相关环境,需要使用docker直接跑模型 在docker hub下载一个tensorflow gpu镜像 运行docker,直接进入bash,使用nvidia-smi正常看到现存,然后正常跑代码即可 docker run -v /data/bert:/app --runtim 阅读全文
posted @ 2020-12-25 14:44 致林 阅读(316) 评论(0) 推荐(0) 编辑
摘要: 启动arthas,执行以下命令会提示所有java进程,选择进程id wget https://arthas.aliyun.com/arthas-boot.jar java -jar arthas-boot.jar 使用dashboard或thread列出所有线程 dashboard thread 找 阅读全文
posted @ 2020-12-21 14:40 致林 阅读(456) 评论(0) 推荐(0) 编辑
摘要: # 获取当前设备 device = torch.device("cuda" if torch.cuda.is_available() else "cpu") 阅读全文
posted @ 2020-12-16 11:29 致林 阅读(505) 评论(0) 推荐(0) 编辑
摘要: 参考: Deep Joint Entity Disambiguation with Local Neural Attention. (Ganea and Hofmann, 2017, EMNLP) DeepType: multilingual entity linking by neural typ 阅读全文
posted @ 2020-12-04 15:33 致林 阅读(1020) 评论(0) 推荐(0) 编辑
摘要: import pandas as pd def apply_func_demo(x: int) -> int: return x*10 def apply_func_concat(x: pd.DataFrame) -> str: if x['age'] % 2 == 0: return '男' el 阅读全文
posted @ 2020-11-24 16:27 致林 阅读(541) 评论(0) 推荐(0) 编辑
摘要: 整理了一下目前想看的一些视频: 未看: 哈尔滨工业大学-深度学习基础(MOOC) 面向程序员的深度学习实战课程(2019)(PyTorch/fastai) 阅读全文
posted @ 2020-11-09 20:59 致林 阅读(90) 评论(0) 推荐(0) 编辑
摘要: postmant请求 { "signature_name":"get_result", "inputs":{ "dropout_keep_prob": 1.0, "q1": [[3, 12, 30, 20], [3, 12, 30, 20]], "q1_len": [4, 4], "q2": [[3 阅读全文
posted @ 2020-10-30 09:52 致林 阅读(170) 评论(0) 推荐(0) 编辑
摘要: 目的: L1和L2正则都可以解决过拟合 方法: L1正则:向量中各个元素绝对值的和,适用于稀疏特征。原理:直接删除异常特征,解决过拟合。 缺点:绝对值不可求导,需要特殊处理。 L2正则:向量中各元素平方和求平方根,使用场景更多,计算方便。原理:将异常特征平均化。 图像: L1是蓝色的线,L2是红色的 阅读全文
posted @ 2020-10-22 17:03 致林 阅读(261) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 19 下一页