Skip to content
TheChatArchiveThe Chat Archive
Claudeclaude-3-7-sonnet-20250219· AnthropicHugging Face LMArena Human Preference 140K

随机计算中(stochastic computing),两组数的差值的relu怎么实现

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with Geminigemini-2.5-flash’s answer.
  1. User

    随机计算中(stochastic computing),两组数的差值的relu怎么实现

  2. Claude Assistant

    在随机计算中实现两组数差值的ReLU函数可以通过以下方式:

    对于两个随机比特流A和B,要计算ReLU(A-B),可以使用一个2:1多路复用器和一个D触发器。

    A -------|
             |---> MUX -----> ReLU(A-B)
    B -------|      ^
             |      |
    D触发器 --|------
    

    工作原理:

    1. 当A=1且B=0时,D触发器置1
    2. 当A=0且B=1时,D触发器置0
    3. 当A=B时,D触发器保持原状态
    4. 多路复用器根据D触发器的状态选择输出:
      • 如果D=1(表示A>B),输出A
      • 如果D=0(表示A≤B),输出0

    这样实现的电路会输出一个随机比特流,表示max(A-B,0),即ReLU(A-B)的结果。

    您需要我解释或详细说明这个电路的工作原理吗?

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.