Ramanujan's Dreams is a modular system for advanced search in CMFs.
- This project is supported fully only on Mac-OS and Linux.
If you are a Windows user, it is recommended to use Windows Subsystem for Linux (WSL). - Install via:
pip install git+https://github.com/UriKH/RamanujansDreams.git
Interaction with the system is via the System class (from dreamer import System) and using the config files.
The system is composed of 4 stages:
- Loading - storing and retrieving mapping from a constant to the inspiration functions.
- Extraction - extraction of the searchables from the CMF of the inspiration functions.
- Analysis - analysis of each of the CMFs i.e., filtering and prioritization of shards, borders, etc.
- Search - deep and full search within the searchable spaces. This stage (will) contain further logic and particularly ascend logic.
Configuration management is done using distinct configuration categories which are all accessed via a global configuration manager:
from dreamer import config
# Access different categories of configurations
config.extraction.<CONFIG>
config.analysis.<CONFIG>
config.search.<CONFIG>
config.system.<CONFIG>
config.logging.<CONFIG>
config.database.<CONFIG>
# change specific configurations
config.configure(
<CATEGORY> = {<CONFIG>: <VALUE>, ...},
<CATEGORY> = {<CONFIG>: <VALUE>, ...},
...
)
# Checkout possible configurations using the terminal
config.<CATEGORY>.display()There are a few important configurations you might want to change:
config.search.NUM_TRAJECTORIES_FROM_DIM- a lambda function of the formlambda dim: int(...)which computes the number of trajectories to be generated from a given dimension.config.analysis.NUM_TRAJECTORIES_FROM_DIM- same configuration as above but for analysis stage.config.analysis.IDENTIFY_THRESHOLD- "what fraction of the shard was identified as containing the constant?"
A classic run would look something like this:
from dreamer import System, config, log
from dreamer import analysis, search, extraction, loading
# Optional reconfigure
config.configure(...)
my_system = System(
if_srcs=[loading.pFq(log(2), 2, 1, -1)], # Set up the loading stage - provide inspiration functions
extractor=extraction.extractor.ShardExtractorMod, # Choose an extraction module
analyzers=[analysis.AnalyzerModV1], # Choose an analysis module(s)
searcher=search.SearcherModV1 # Choose the search module
)
my_system.run(constants=[log(2)])Advanced options are:
- Using a database as on of the inspiration functions source.
- Using pickled inspiration function objects from past runs as inspiration functions source.
- Using pickled past analysis results as input to the analysis stage.
If you are a PyCharm user, the output might look a bit off due to tqdm default configurations.
To make sure the output console looks right:
- Enter:
Run > Edit Configurations > Modify Options - Select:
Emulate terminal in output console
This project is licensed under the terms of the MIT License.
- Please open an issue for any bug or error you encounter.
- For further details see instructions.