MCPcopy Create free account
hub / github.com/OpenBMB/ToolBench / softmax_bias

Function softmax_bias

toolbench/inference/utils.py:16–24  ·  view source on GitHub ↗
(answers,temperature=1)

Source from the content-addressed store, hash-verified

14
15# For DFS
16def softmax_bias(answers,temperature=1):
17
18 sums = 0.0
19 answers = [ 10**((cont/temperature)/400) for cont in answers]
20 for cont in answers:
21 assert type(cont) == float or type(cont) == int
22 sums += cont
23 answers = [ cont/sums for cont in answers]
24 return np.array(answers)
25
26def compute_epsilon_new_node(p_new_node):
27 '''

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected