- 博客(478)
- 资源 (1)
- 收藏
- 关注
原创 LangChain WebResearchRetriever检索器使用
这个函数用来初始化 WebResearchRetriever,除了上面说的三个主要参数外,其额外提供了默认的Prompt模板,text_splitter,QuestionListOutputParser等Retriever过程所需的工具和内容。(3)配置 CSE ID 到你的代码中:将这个 CSE ID 放到你的程序 .env 文件中作为环境变量加载。(4)对抓取出来的文本进行分块,向量存储(WebResearchRetriever的工作到这里就结束了)对检索到的文档进行问答,并引用其来源。
2024-11-25 15:09:48
653
原创 深入浅出解析大模型的Top K与Top P参数
随着人工智能技术的日新月异,大型语言模型(简称大模型)已成为我们生活中不可或缺的智能助手。这些模型在自然语言处理、文本生成、智能问答等多个领域发挥着重要作用。然而,比较‘古早’的大模型应用一般会有几个调整参数,比如 Top-k 、Top-p之类的,用于调整输出的多样性。现在则很少见了,因为随着应用的不断迭代升级,这些参数慢慢变成很好的经验值后台隐藏掉了,就像搜索引擎刚出来时一堆参数,而你现在看到的只有一个搜索框。而现在的大模型应用,也基本只看到一个对话框。
2024-11-22 09:37:30
1216
原创 openai 论文Scaling Laws for Neural Language Models学习
最佳性能取决于作为幂律的总计算量 (参见等式(1.3)). 我们为方程提供了一些基本的理论动因(1.5)、对学习曲线拟合及其对训练时间的影响的分析,以及对每个 token 的结果的细分。传输性能随测试性能的提高而提高: 当我们在文本上评估模型的分布不同于它们在其上训练的分布时,结果与训练验证集上的结果强相关,损失的偏移大致恒定——换句话说,转移到不同的分布会招致恒定的惩罚,但其他方面的改进大致与训练集上的性能一致。通过外推训练曲线的早期部分,我们可以大致预测如果我们训练更长的时间,将获得的损失。
2024-11-15 11:19:43
935
原创 cross-attention
这使得模型能够关注输入序列中的其他部分以产生一个位置的输出。主要目的是捕捉输入序列内部的依赖关系。它允许输入序列的每个部分关注序列中的其他部分。查询来自一个输入序列,而键和值来自另一个输入序列。这在诸如序列到序列模型(如机器翻译)中很常见,其中一个序列需要“关注”另一个序列。目的是使一个序列能够关注另一个不同的序列。总的来说,自注意力和交叉注意力都是基于相同的核心机制,但它们的应用和目的有所不同。自注意力旨在处理单一序列内部的关系,而交叉注意力则旨在处理两个不同序列之间的关系。
2024-11-13 15:01:37
360
原创 大模型拒绝采样
对每一个提示词xi生成k个响应,然后从k个响应中选择2个响应对(yil, yij),计算两者的回报(reward)差值,如果差值大于阈值η(超参数),就接收该条偏好数据(xi , yil, yij )
2024-11-13 11:01:27
322
原创 LeetCode括号生成22
数字 n 代表生成括号的对数,请你设计一个函数,用于能够生成所有可能的并且 有效的 括号组合。示例:输入:n = 3输出:[ "((()))", "(()())", "(())()", "()(())", "()()()" ]来源:力扣(LeetCode)链接:https://leetcode-cn.com/problems/generate-parentheses著作权归领扣网络所有。商业转载请联系官...
2020-05-15 01:06:44
270
原创 0-1 knapsack dynamic programming by Python
import os,sysclass knapsack01_dp: def __init__(self, w, v, C): self.w =w self.v = v self.C = C def solve(self): assert len(self.w) == len(self.v) if...
2019-08-30 00:58:27
255
转载 UnicodeEncodeError ‘ascii’ codec can’t encode characters in position ordinal not in range(128)
https://unix.stackexchange.com/questions/399556/how-to-avoid-having-to-export-lc-all-zh-cn-utf-8-upon-each-ssh-connectionYou are missing theexportin your~/.bashrc.export LC_ALL=zh_CN.UTF-8W...
2019-07-24 20:37:23
347
转载 pip install InsecurePlatformWarning: A true SSLContext object is not available.
Refer from https://www.phodal.com/blog/python-pip-openssl-issue/在安装Python库的时候,遇到一些问题。虽然,还是遇到问题了:Collecting PyMySQL/Users/fdhuang/py27/lib/python2.7/site-packages/pip/_vendor/requests/packages
2016-07-26 09:38:44
1419
原创 Numpy ConfigParser.MissingSectionHeaderError: File contains no section headers.
Solution:Remove all space in the section:[openblas]libraries = openblaslibrary_dirs = /opt/OpenBLAS/libinclude_dirs = /opt/OpenBLAS/includeruntime_library_dirs = /opt/OpenBLAS/lib
2016-07-14 21:16:45
3875
转载 spring security3 实现踢出在线用户
Refer from http://blog.youkuaiyun.com/yangxuan0261/article/details/10014111在spring security中有个 SessionRegistryImpl 的类,实现了 SessionRegistry 接口,这个实现类里有session的具体信息。我实现踢出功能用户功能就是比对已注册的session的用户的用
2016-07-01 17:33:50
1209
转载 spring mvc + 表单异步验证插件 Validate.form.js
Refer from http://blog.youkuaiyun.com/yangxuan0261/article/details/10033537很好用的表单异步验证插件,很多时候都是在注册的时候用。看下效果图使用方式html页面[html] view plain copy>
2016-07-01 17:30:38
1470
转载 Why Redis beats Memcached for caching
Refer from http://www.javaworld.com/article/2836878/developer-tools-ide/why-redis-beats-memcached-for-caching.htmlRedis is the first choice at most of cases. Redis is the newer and more versatile da
2016-07-01 15:15:44
448
转载 Java Web中的Action、Dao、Service、Model
Refer from http://blog.youkuaiyun.com/zhangdong305/article/details/48048003首先这是现在最基本的分层方式,结合了SSH架构。modle层就是对应的数据库表的实体类。Dao层是使用了Hibernate连接数据库、操作数据库(增删改查)。Service层:引用对应的Dao数据库操作,在这里可以编写自己需要的代码(比如简单的判断)。A
2016-07-01 10:39:39
1504
原创 log4j:WARN No appenders could be found for logger
Create a file named log4j.properties on the directory target/classes/, then copy following content into this file:log4j.appender.Cons=org.apache.log4j.ConsoleAppenderlog4j.appender.Cons.layout=o
2016-06-29 20:36:43
506
转载 Torch ResNet Installation
Torch ResNet Installation=========================This is the suggested way to install the Torch ResNet dependencies on [Ubuntu 14.04+](http://www.ubuntu.com/):* NVIDIA CUDA 7.0+* NVIDIA c
2016-06-05 13:06:08
1129
转载 VS2010实现opencv基于DCT的图像压缩
Refer from http://blog.youkuaiyun.com/fjssharpsword/article/details/77659081.基于DCT的图像压缩方法是将一幅图像分割成矩形像素块,再分别对每一独立的像素块DCT变换、量化、编码和传输。2.打开VS2010,新建Visual C++下Win32控制台应用程序demo,主程序如下:// demo.cp
2016-05-24 10:55:02
1445
转载 OpenCV滤波之copyMakeBorder和borderInterpolate
Refer from http://blog.youkuaiyun.com/qianqing13579/article/details/42323397在OpenCV滤波算法中,有两个非常重要的基本工具函数,copyMakeBorder和borderInterpolatecopyMakeBorder函数原型void copyMakeBorder( con
2016-05-24 10:51:25
621
转载 Matlab2014b与C/C++(VS2013)混合编程
Refer from http://blog.youkuaiyun.com/langb2014/article/details/48375117很多精通单一语言,c语言或matlab的人,在处理经常遇到Matlab与C/C++混合编程的问题,而且都会出现各种编译问题,使得这两种语言之间产生了代沟,因为我对这些问题也比较反感,因此做一个简单认识和学习。一、Matlab调用C/C++
2016-05-18 10:01:19
931
转载 Linux下命令行压缩照片或图片的脚本 (ImageMagick使用心得,convert,import,display实例)
Refer from http://justcoding.iteye.com/blog/2022467在认识ImageMagick之前,我使用的图像浏览软件是KuickShow,截图软件是KSnapShot,这两款软件都是KDE附带的软件,用起来也是蛮方便的。在一次偶然的机会中,我遇到了ImageMagick,才发现Linux竟然有如此功能强大的图像软件。你将会发现,大部分的操
2016-05-04 11:07:47
835
原创 Ubuntu14.04 install pyaudio
Solution:$ sudo apt-get install python-pyaudio
2016-04-11 15:19:05
1358
转载 VMware虚拟机设置(vmtools&分辨率)
Refer from http://blog.youkuaiyun.com/pipisorry/article/details/23049271VMware中linux与window文件夹共享VMware中安装vmware tools在vmware软件中找到管理manage,点击install vmware tools进行vmware中的linux系统中,会发现有个vmware
2016-04-07 11:43:44
2325
转载 Perplexity定义
Refer from http://blog.youkuaiyun.com/pipisorry/article/details/42460023http://blog.youkuaiyun.com/pipisorry/article/details/42460023熵/信息熵Perplexity定义perplexity是一种信息理论的测量方法,b的perpl
2016-04-07 11:42:31
4753
原创 OSError: libiomp5.so: cannot open shared object file: No such file or directory
Solution:source /opt/intel/bin/compilervars.sh intel64
2016-04-06 16:11:53
3032
原创 Mxnet make : /usr/bin/ld -lippicv not found
Solution:$ locate ippicv$ sudo ln -s /usr/local/share/OpenCV/3rdparty/lib/libippicv.a /usr/local/lib/libippicv.a
2016-04-06 15:54:48
2206
转载 使用Google语音识别引擎(Google Speech API)
转自 http://blog.youkuaiyun.com/dlangu0393/article/details/7214728 最近在使用Qt编写一个客户端程序的时候需要增加语音识别输入的功能。起初尝试使用SAPI来完成这个任务,但是发现SAPI不仅使用起来超级复杂,而且识别效果也很惨烈。于是就需要寻找一个更加便捷优秀的方案。 自从Chrome 11开始,Chrome开始支持HTML5的
2016-03-29 17:07:38
3373
转载 imshow,imagesc,image区别与认识
Refer from http://blog.sciencenet.cn/blog-1003537-715089.html理论介绍imagesc属于图像缩放函数具体说一些例子:要显示一副灰度图像,可以调用函数 imshow 或 imagesc (即 imagescale,图像缩放函数)(1) imshow 函数显示灰度图像使用 imshow(I)
2016-03-21 10:04:31
2826
转载 MATLAB dlopen: cannot load any more object with static TLS
Refer from http://www.cnblogs.com/tornadomeet/p/3482997.html如果遇到下列错误: dlopen: cannot load any more object with static TLS 解决方法是:在matlab下,依次进入Preferences > General > Java-Heap Memory.增加
2016-03-20 20:51:05
2540
转载 sh脚本异常:/bin/sh^M:bad interpreter: No such file or directory
在Linux中执行.sh脚本,异常/bin/sh^M: bad interpreter: No such file or directory。 分析:这是不同系统编码格式引起的:在windows系统中编辑的.sh文件可能有不可见字符,所以在Linux系统下执行会报以上异常信息。 解决:1)在windows下转换: 利用一些编辑器如UltraEdit或EditPlus等工具先将脚本编码转
2016-03-20 14:15:09
373
转载 Caffe学习笔记5-BLAS与boost::thread加速
Refer from http://yufeigan.github.io/2015/01/02/Caffe%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B05-BLAS%E4%B8%8Eboost-thread%E5%8A%A0%E9%80%9F/Caffe中运用了大量的优化方法,最近在优化自己代码时候恰好运用了其中的BLAS和Boost::thread。使用
2016-03-18 17:14:59
607
转载 如何修复在Ubuntu14.04状态栏不显示时间的问题
Refer from http://blog.chinaunix.net/uid-26527046-id-4263539.html有时候我们会看到我们电脑的状态栏那里并没有显示时间,一个原因是日期时间指示器没有工作,另一个可能的原因是用户禁用了时间显示。当你想显示它的 时候,你可能会发现System Settings->Time & Date->Clock这里已经变成灰色,不可以选择,
2016-03-17 15:57:55
543
转载 OpenCV图像质量评价的SSIM算法(图像相似度)
Refer from http://jingyan.baidu.com/article/456c463b67aa310a5931447a.htmlOpenCV图像质量评价的SSIM算法(图像相似度)SSIM 是一种衡量图象的质量的算法,它克服了原有PSNR固有的一些局限性。SSIM的性能好,但是其付出的代价也很大。本经验将在Ubuntu系统下介绍
2016-03-08 11:30:03
5313
转载 模式识别中精确定位之垂直和水平投影
Refer from http://blog.youkuaiyun.com/what_lei/article/details/49099223在模式识别中常用垂直投影和水平投影对目标物进行精确投影,以便于后期的分割。示例: (1)
2016-03-06 16:38:48
1131
原创 Github no password log in
Choosing ssh style to name your project address, if https, then it will always require you enter the account name and password.1. Produce a public key for github. 1.1 # ssh-keygen -t rsa -C
2016-03-02 10:44:45
543
转载 Fastest HOG Feature Extraction implementation
Refer from http://stackoverflow.com/questions/18474897/fastest-hog-feature-extraction-implementationQuestion What's the fastest open-source HOG extraction code for multicore CP
2016-03-01 17:56:13
773
转载 Image Recognition
Refer from https://www.tensorflow.org/versions/master/tutorials/image_recognition/index.htmlImage RecognitionOur brains make vision seem easy. It doesn't take any effort for humans totel
2016-02-29 20:45:51
1271
转载 OpenCV求解的矩阵: CvMat与cvSolve函数
Refer from http://blog.youkuaiyun.com/augusdi/article/details/9014459[cpp] view plain copy // vv.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include #include #include
2016-02-25 15:21:29
1548
转载 Ubuntu14.04英文系统添加中文输入法
Refer from http://jingyan.baidu.com/article/870c6fc3109eeab03fe4be94.html由于安装了Ubuntu纯英文系统在输入汉字时需要添加中文相关的输入法支持,通过系统设置启用系统自带的输入法即可。工具/原料Ubuntu14.04操作系统方法/步骤
2016-02-15 10:28:08
809
转载 Tesseract OCR初探
Refer from http://hellosure.github.io/ocr/2014/10/11/tesseract-ocr/11 October 2014 OPENCV & OCROpenCV(Open Source Computer Vision Library,跨平台计算机视觉库),专注机器视觉,是个更大范围的概念OCR (Optical Ch
2016-02-14 14:34:09
2170
Applied Cryptography
2010-09-20
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人