Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- # Works, is pretty good
- all_pairs: list[tuple[int, int]] = []
- for i in range(100):
- for j in range(i+1, 100):
- i2, j2 = random.sample((i, j), 2)
- all_pairs.append((i2, j2))
- random.shuffle(all_pairs)
- selected_pairs = all_pairs[:600]
- # But this is more sample efficient
- all_pairs = []
- indexes = list(range(100))
- for K in range(4):
- random.shuffle(indexes)
- for i in range(100):
- all_pairs.append((indexes[i], indexes[(i+1) % 100]))
- len(all_pairs) # 400
- # ~400 samples with random cycles, resolves the ELOs as accurately as ~600 randomly sampled pairs. This makes synthetic training data 50% cheaper, which saves a lot when spending >$10k
- # Image Showing Idea: https://private-user-images.githubusercontent.com/8939474/470457008-4731f849-e81f-40bd-a211-fd6f273f1f84.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NTM1NjY3NTcsIm5iZiI6MTc1MzU2NjQ1NywicGF0aCI6Ii84OTM5NDc0LzQ3MDQ1NzAwOC00NzMxZjg0OS1lODFmLTQwYmQtYTIxMS1mZDZmMjczZjFmODQucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDcyNiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTA3MjZUMjE0NzM3WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MDcwNTQ0NWYyYThmN2E1MmQ2NTI3Y2ZkY2MwYmY1YjVkMTViZThmNTU3MTQxOGY0Y2FlYTlhYjE0YmZiZTMzOSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.2xsCZ1cou_nRQRVZnBxxWzsUG21HrA6c6WMGYWPF1kU
Advertisement
Add Comment
Please, Sign In to add comment