Skip to content

Commit 22a8839

Browse files
authored
Merge pull request #371 from macrocosm-os/staging
staging
2 parents 9afb335 + 25a92d2 commit 22a8839

File tree

5 files changed

+261
-185
lines changed

5 files changed

+261
-185
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ An ideal incentive mechanism defines an asymmetric workload between the validato
8787

8888
Protein folding is also a research topic that is of incredibly high value. Research groups all over the world dedicate their time to solving particular niches within this space. Providing a solution to attack this problem at scale is what Bittensor is meant to provide to the global community.
8989

90-
# Simulation Backend and Reproducability
90+
# Simulation Backend and Reproducibility
9191
Moleccular dynamics (MD) simulations require a physics-based engine to run them, and SN25 utilizes the open-source project [OpenMM](https://openmm.org). As their tagline suggests, they are a "high performance, customizable molecular simulation" package.
9292

9393
One of the key advantages of using OpenMM for MD-simulations is the built-in capabilities for *reproducability*. This is a key component in the reward stack and all miners should be intimately familiar with this. For more information, please read this [document](./documentation/reproducibility.md).

folding/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = "2.1.1"
1+
__version__ = "2.1.2"
22
version_split = __version__.split(".")
33
__spec_version__ = (
44
(10000 * int(version_split[0]))

folding/rewards/linear_reward.py

+8-10
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,13 @@
44
def divide_decreasing(
55
amount_to_distribute: float, number_of_elements: int
66
) -> List[float]:
7-
# Calculate the fixed decrease amount d
8-
d = 2 * amount_to_distribute / ((number_of_elements - 1) * number_of_elements)
7+
# Instead of going from n to 0, we go from n to 1
8+
# This gives us weights that look like [n, n-1, n-2, ..., 1]
9+
weights = [number_of_elements - i for i in range(number_of_elements)]
910

10-
# Calculate the first value a1
11-
a1 = (
12-
amount_to_distribute + d * (number_of_elements - 1) * number_of_elements / 2
13-
) / number_of_elements
11+
# Calculate scaling factor to make weights sum to amount_to_distribute
12+
total_weight = sum(weights)
13+
scaling_factor = amount_to_distribute / total_weight
1414

15-
# Calculate the n values
16-
values = [a1 - i * d for i in range(number_of_elements)]
17-
18-
return values
15+
# Scale all weights proportionally
16+
return [w * scaling_factor for w in weights]

0 commit comments

Comments
 (0)