• Vector Search

    https://medium.com/@vidiptvashist/building-a-vector-database-from-scratch-in-python-6bd683ba5171 关键还是如何做 embedding。以及如何做相似度计算? 后面看一下有哪些常用的embedding model 和算法。 还有,代码中都是简单的字符串,如果特别长,怎么切片呢?这个参数是不是也重要? from typing import Any import numpy as np class VectorStore: def __init__(self): self.vector_data: dict[str, np.ndarray] = {} # A dictionary to store vectors...

  • 这不是有效沟通

    A: Deepseek 为什么成本这么低? B:我不懂。 A:你不懂?你们搞技术的应该都懂啊。 B:我不懂。 A:那你懂啥?

  • Shortcut Connection In Deep Nn

    In conclusion, shortcut connections are important for overcoming the limitations posed by the vanishing gradient problem in deep neural networks. Shortcut connections are a core building block of very large...

  • 认错

    我觉得人生过的顺畅一些的一个改变是,把第一反应从辩解(缺少正确逻辑的辩解)变成认错。

  • Note2 Build A Llm From Scratch

    需要看pytorch的文档,进一步了解里面第一步的作用是什么,以了解MultiHeadAttention的原理 class MultiHeadAttention(nn.Module): def __init__(self, d_in, d_out, context_length, dropout, num_heads, qkv_bias=False): super().__init__() assert d_out % num_heads == 0, "d_out must be divisible by num_heads" self.d_out = d_out self.num_heads = num_heads...

  • Note1 Build A Llm From Scratch

    一句话,像"I am a student.",am 的 tokenID 是一个[xx,xx,xx]这样的“三维”向量。第书的第二章讲的encode token,是变成一个数字,怎么到了第三章,突然成了一个三维向量?中间发生了哪些操作? 在第三章的“Implementing self-attention with trainable weights”这一节,说到“我们成功将6个输入标记从三维投影到二维嵌入空间上”。为什么要把三维转成二维?这里说的“embedding space”又是指什么?

  • Git Pull Pr

    git fetch origin pull/265/head:pr-265

  • Github Pages Cloudflare

    将 GitHub Pages 的自定义域名迁到 cloudflare 之后,一直死循环 301。 原因是,cloudflare 默认的 SSL 配置是 “灵活”:仅在访问者与 Cloudflare 之间启用加密。这可以避免浏览器发出安全警告,但 Cloudflare 与您的源服务器之间的所有连接均通过 HTTP 建立。 而我的 github pages 配置了 enforce https,所以就会出现死循环。 但是,还有一个github pages 项目使用不能配置 enforce https,配置页面显示”Enforce HTTPS...

  • Autogen Question 1

    autogen里面的一段代码如下: selector_group_chat = SelectorGroupChat( [add_agent, multiply_agent, subtract_agent, divide_agent, identity_agent], model_client=OpenAIChatCompletionClient(model="gpt-4o"), termination_condition=termination_condition, allow_repeated_speaker=True, # Allow the same agent to speak multiple times, necessary for this task. selector_prompt=( "Available roles:\n{roles}\nTheir job descriptions:\n{participants}\n"...

  • Python Lambda

    方法一:使用默认参数 functions = [] for i in range(10): functions.append(lambda x=i: print(x)) for f in functions: f() 方法二:使用闭包 def create_printer(i): def inner(): print(i) return inner functions = [create_printer(i) for i in...