Datasets:
Formats:
json
Languages:
English
Size:
< 1K
Tags:
recursive-self-improvement
autonomous-learning
formal-power-series
exact-arithmetic
certified-compilation
reproducible-research
Download research/src/context_policy.py from PureOne/SORILUN-RSI: direct link, hf CLI and curl.
- Browser
- Download file 812 Bytes
-
https://huggingface.co/datasets/PureOne/SORILUN-RSI/resolve/main/research/src/context_policy.py
- Command line
-
hf download hf://datasets/PureOne/SORILUN-RSI/research/src/context_policy.py
-
curl -L -o context_policy.py https://huggingface.co/datasets/PureOne/SORILUN-RSI/resolve/main/research/src/context_policy.py
812 Bytes
| """Do not export a hardware promotion beyond its measured task context.""" | |
| from dataclasses import dataclass | |
| import json | |
| from pathlib import Path | |
| class ContextPolicy: | |
| accepted: tuple | |
| def from_gate(cls, path): | |
| report=json.loads(Path(path).read_text()) | |
| items=[] | |
| for event in report['records']: | |
| if event['accepted']: | |
| items.append(('reciprocal',int(event['length']),int(event['after_cap']))) | |
| return cls(tuple(items)) | |
| def choose_cap(self,family,length): | |
| if not isinstance(family,str) or not isinstance(length,int) or length<1: | |
| raise ValueError('Invalid context') | |
| matches=[cap for fam,n,cap in self.accepted if fam==family and n==length] | |
| return max(matches,default=0) | |