From 54b6a87d1ae85fc5acbe08ffc3a42f9e285621e9 Mon Sep 17 00:00:00 2001 From: psaegert Date: Sat, 11 Jan 2025 14:53:56 +0100 Subject: [PATCH] Add v7 configs for models with better deduplication --- configs/v7.0-large/dataset_train.yaml | 2 + configs/v7.0-large/dataset_val.yaml | 2 + configs/v7.0-large/evaluation.yaml | 14 + configs/v7.0-large/expression_space.yaml | 256 +++++++++++ configs/v7.0-large/nsr.yaml | 25 ++ configs/v7.0-large/skeleton_pool_train.yaml | 37 ++ configs/v7.0-large/skeleton_pool_val.yaml | 36 ++ configs/v7.0-large/train.yaml | 34 ++ configs/v7.0-mini/dataset_train.yaml | 2 + configs/v7.0-mini/dataset_val.yaml | 2 + configs/v7.0-mini/evaluation.yaml | 14 + configs/v7.0-mini/expression_space.yaml | 256 +++++++++++ configs/v7.0-mini/nsr.yaml | 25 ++ configs/v7.0-mini/skeleton_pool_train.yaml | 37 ++ configs/v7.0-mini/skeleton_pool_val.yaml | 36 ++ configs/v7.0-mini/train.yaml | 31 ++ configs/v7.0/dataset_train.yaml | 2 + configs/v7.0/dataset_val.yaml | 2 + configs/v7.0/evaluation.yaml | 14 + configs/v7.0/expression_space.yaml | 256 +++++++++++ configs/v7.0/nsr.yaml | 25 ++ configs/v7.0/skeleton_pool_train.yaml | 37 ++ configs/v7.0/skeleton_pool_val.yaml | 36 ++ configs/v7.0/train.yaml | 31 ++ configs/v7.1/dataset_train.yaml | 2 + configs/v7.1/dataset_val.yaml | 2 + configs/v7.1/evaluation.yaml | 14 + configs/v7.1/expression_space.yaml | 256 +++++++++++ configs/v7.1/nsr.yaml | 25 ++ configs/v7.1/skeleton_pool_train.yaml | 37 ++ configs/v7.1/skeleton_pool_val.yaml | 36 ++ configs/v7.1/train.yaml | 31 ++ configs/v7.2/dataset_train.yaml | 2 + configs/v7.2/dataset_val.yaml | 2 + configs/v7.2/evaluation.yaml | 14 + configs/v7.2/expression_space.yaml | 256 +++++++++++ configs/v7.2/nsr.yaml | 25 ++ configs/v7.2/skeleton_pool_train.yaml | 37 ++ configs/v7.2/skeleton_pool_val.yaml | 36 ++ configs/v7.2/train.yaml | 31 ++ configs/v7.3/dataset_train.yaml | 2 + configs/v7.3/dataset_val.yaml | 2 + configs/v7.3/evaluation.yaml | 14 + configs/v7.3/expression_space.yaml | 256 +++++++++++ configs/v7.3/nsr.yaml | 25 ++ configs/v7.3/skeleton_pool_train.yaml | 37 ++ configs/v7.3/skeleton_pool_val.yaml | 36 ++ configs/v7.3/train.yaml | 31 ++ configs/v7.4/dataset_train.yaml | 2 + configs/v7.4/dataset_val.yaml | 2 + configs/v7.4/evaluation.yaml | 14 + configs/v7.4/expression_space.yaml | 256 +++++++++++ configs/v7.4/nsr.yaml | 25 ++ configs/v7.4/skeleton_pool_train.yaml | 37 ++ configs/v7.4/skeleton_pool_val.yaml | 36 ++ configs/v7.4/train.yaml | 31 ++ configs/v7.5/dataset_train.yaml | 2 + configs/v7.5/dataset_val.yaml | 2 + configs/v7.5/evaluation.yaml | 14 + configs/v7.5/expression_space.yaml | 256 +++++++++++ configs/v7.5/nsr.yaml | 25 ++ configs/v7.5/skeleton_pool_train.yaml | 37 ++ configs/v7.5/skeleton_pool_val.yaml | 36 ++ configs/v7.5/train.yaml | 31 ++ configs/v7.6/dataset_train.yaml | 2 + configs/v7.6/dataset_val.yaml | 2 + configs/v7.6/evaluation.yaml | 14 + configs/v7.6/expression_space.yaml | 256 +++++++++++ configs/v7.6/nsr.yaml | 25 ++ configs/v7.6/skeleton_pool_train.yaml | 37 ++ configs/v7.6/skeleton_pool_val.yaml | 36 ++ configs/v7.6/train.yaml | 31 ++ configs/v7.7/dataset_train.yaml | 2 + configs/v7.7/dataset_val.yaml | 2 + configs/v7.7/evaluation.yaml | 14 + configs/v7.7/expression_space.yaml | 256 +++++++++++ configs/v7.7/nsr.yaml | 25 ++ configs/v7.7/skeleton_pool_train.yaml | 37 ++ configs/v7.7/skeleton_pool_val.yaml | 36 ++ configs/v7.7/train.yaml | 31 ++ configs/v7.8/dataset_train.yaml | 2 + configs/v7.8/dataset_val.yaml | 2 + configs/v7.8/evaluation.yaml | 14 + configs/v7.8/expression_space.yaml | 445 ++++++++++++++++++++ configs/v7.8/nsr.yaml | 25 ++ configs/v7.8/skeleton_pool_train.yaml | 37 ++ configs/v7.8/skeleton_pool_val.yaml | 36 ++ configs/v7.8/train.yaml | 31 ++ configs/v7.9/dataset_train.yaml | 2 + configs/v7.9/dataset_val.yaml | 2 + configs/v7.9/evaluation.yaml | 14 + configs/v7.9/expression_space.yaml | 258 ++++++++++++ configs/v7.9/nsr.yaml | 25 ++ configs/v7.9/skeleton_pool_train.yaml | 37 ++ configs/v7.9/skeleton_pool_val.yaml | 36 ++ configs/v7.9/train.yaml | 31 ++ 96 files changed, 5030 insertions(+) create mode 100644 configs/v7.0-large/dataset_train.yaml create mode 100644 configs/v7.0-large/dataset_val.yaml create mode 100644 configs/v7.0-large/evaluation.yaml create mode 100644 configs/v7.0-large/expression_space.yaml create mode 100644 configs/v7.0-large/nsr.yaml create mode 100644 configs/v7.0-large/skeleton_pool_train.yaml create mode 100644 configs/v7.0-large/skeleton_pool_val.yaml create mode 100644 configs/v7.0-large/train.yaml create mode 100644 configs/v7.0-mini/dataset_train.yaml create mode 100644 configs/v7.0-mini/dataset_val.yaml create mode 100644 configs/v7.0-mini/evaluation.yaml create mode 100644 configs/v7.0-mini/expression_space.yaml create mode 100644 configs/v7.0-mini/nsr.yaml create mode 100644 configs/v7.0-mini/skeleton_pool_train.yaml create mode 100644 configs/v7.0-mini/skeleton_pool_val.yaml create mode 100644 configs/v7.0-mini/train.yaml create mode 100644 configs/v7.0/dataset_train.yaml create mode 100644 configs/v7.0/dataset_val.yaml create mode 100644 configs/v7.0/evaluation.yaml create mode 100644 configs/v7.0/expression_space.yaml create mode 100644 configs/v7.0/nsr.yaml create mode 100644 configs/v7.0/skeleton_pool_train.yaml create mode 100644 configs/v7.0/skeleton_pool_val.yaml create mode 100644 configs/v7.0/train.yaml create mode 100644 configs/v7.1/dataset_train.yaml create mode 100644 configs/v7.1/dataset_val.yaml create mode 100644 configs/v7.1/evaluation.yaml create mode 100644 configs/v7.1/expression_space.yaml create mode 100644 configs/v7.1/nsr.yaml create mode 100644 configs/v7.1/skeleton_pool_train.yaml create mode 100644 configs/v7.1/skeleton_pool_val.yaml create mode 100644 configs/v7.1/train.yaml create mode 100644 configs/v7.2/dataset_train.yaml create mode 100644 configs/v7.2/dataset_val.yaml create mode 100644 configs/v7.2/evaluation.yaml create mode 100644 configs/v7.2/expression_space.yaml create mode 100644 configs/v7.2/nsr.yaml create mode 100644 configs/v7.2/skeleton_pool_train.yaml create mode 100644 configs/v7.2/skeleton_pool_val.yaml create mode 100644 configs/v7.2/train.yaml create mode 100644 configs/v7.3/dataset_train.yaml create mode 100644 configs/v7.3/dataset_val.yaml create mode 100644 configs/v7.3/evaluation.yaml create mode 100644 configs/v7.3/expression_space.yaml create mode 100644 configs/v7.3/nsr.yaml create mode 100644 configs/v7.3/skeleton_pool_train.yaml create mode 100644 configs/v7.3/skeleton_pool_val.yaml create mode 100644 configs/v7.3/train.yaml create mode 100644 configs/v7.4/dataset_train.yaml create mode 100644 configs/v7.4/dataset_val.yaml create mode 100644 configs/v7.4/evaluation.yaml create mode 100644 configs/v7.4/expression_space.yaml create mode 100644 configs/v7.4/nsr.yaml create mode 100644 configs/v7.4/skeleton_pool_train.yaml create mode 100644 configs/v7.4/skeleton_pool_val.yaml create mode 100644 configs/v7.4/train.yaml create mode 100644 configs/v7.5/dataset_train.yaml create mode 100644 configs/v7.5/dataset_val.yaml create mode 100644 configs/v7.5/evaluation.yaml create mode 100644 configs/v7.5/expression_space.yaml create mode 100644 configs/v7.5/nsr.yaml create mode 100644 configs/v7.5/skeleton_pool_train.yaml create mode 100644 configs/v7.5/skeleton_pool_val.yaml create mode 100644 configs/v7.5/train.yaml create mode 100644 configs/v7.6/dataset_train.yaml create mode 100644 configs/v7.6/dataset_val.yaml create mode 100644 configs/v7.6/evaluation.yaml create mode 100644 configs/v7.6/expression_space.yaml create mode 100644 configs/v7.6/nsr.yaml create mode 100644 configs/v7.6/skeleton_pool_train.yaml create mode 100644 configs/v7.6/skeleton_pool_val.yaml create mode 100644 configs/v7.6/train.yaml create mode 100644 configs/v7.7/dataset_train.yaml create mode 100644 configs/v7.7/dataset_val.yaml create mode 100644 configs/v7.7/evaluation.yaml create mode 100644 configs/v7.7/expression_space.yaml create mode 100644 configs/v7.7/nsr.yaml create mode 100644 configs/v7.7/skeleton_pool_train.yaml create mode 100644 configs/v7.7/skeleton_pool_val.yaml create mode 100644 configs/v7.7/train.yaml create mode 100644 configs/v7.8/dataset_train.yaml create mode 100644 configs/v7.8/dataset_val.yaml create mode 100644 configs/v7.8/evaluation.yaml create mode 100644 configs/v7.8/expression_space.yaml create mode 100644 configs/v7.8/nsr.yaml create mode 100644 configs/v7.8/skeleton_pool_train.yaml create mode 100644 configs/v7.8/skeleton_pool_val.yaml create mode 100644 configs/v7.8/train.yaml create mode 100644 configs/v7.9/dataset_train.yaml create mode 100644 configs/v7.9/dataset_val.yaml create mode 100644 configs/v7.9/evaluation.yaml create mode 100644 configs/v7.9/expression_space.yaml create mode 100644 configs/v7.9/nsr.yaml create mode 100644 configs/v7.9/skeleton_pool_train.yaml create mode 100644 configs/v7.9/skeleton_pool_val.yaml create mode 100644 configs/v7.9/train.yaml diff --git a/configs/v7.0-large/dataset_train.yaml b/configs/v7.0-large/dataset_train.yaml new file mode 100644 index 0000000..bb27322 --- /dev/null +++ b/configs/v7.0-large/dataset_train.yaml @@ -0,0 +1,2 @@ +skeleton_pool: './skeleton_pool_train.yaml' +padding: 'zero' \ No newline at end of file diff --git a/configs/v7.0-large/dataset_val.yaml b/configs/v7.0-large/dataset_val.yaml new file mode 100644 index 0000000..c15ed03 --- /dev/null +++ b/configs/v7.0-large/dataset_val.yaml @@ -0,0 +1,2 @@ +skeleton_pool: './skeleton_pool_val.yaml' +padding: 'zero' \ No newline at end of file diff --git a/configs/v7.0-large/evaluation.yaml b/configs/v7.0-large/evaluation.yaml new file mode 100644 index 0000000..98f6576 --- /dev/null +++ b/configs/v7.0-large/evaluation.yaml @@ -0,0 +1,14 @@ +n_support: 512 +beam_width: 32 +n_restarts: 8 +max_len: 32 +refiner_method: 'curve_fit_lm' +numeric_head: False +equivalence_pruning: True +pointwise_close_criterion: 0.95 +pointwise_close_accuracy_rtol: 0.05 +pointwise_close_accuracy_atol: 0.001 +r2_close_criterion: 0.95 +refiner_p0_noise: 'uniform' +refiner_p0_noise_kwargs: {'low': -5, 'high': 5} +device: cuda \ No newline at end of file diff --git a/configs/v7.0-large/expression_space.yaml b/configs/v7.0-large/expression_space.yaml new file mode 100644 index 0000000..8b17a96 --- /dev/null +++ b/configs/v7.0-large/expression_space.yaml @@ -0,0 +1,256 @@ +operators: + "+": + realization: "+" + alias: ["add", "plus"] + inverse: "-" + arity: 2 + weight: 10 + precedence: 1 + commutative: true + symmetry: 0 + positive: false + monotonicity: 0 + "-": + realization: "-" + alias: ["sub", "minus"] + inverse: "+" + arity: 2 + weight: 5 + precedence: 1 + commutative: false + symmetry: 0 + positive: false + monotonicity: 0 + neg: + realization: "nsrops.neg" + alias: ["negative"] + inverse: "neg" + arity: 1 + weight: 5 + precedence: 2.5 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: -1 + "*": + realization: "*" + alias: ["mul", "times"] + inverse: "/" + arity: 2 + weight: 10 + precedence: 2 + commutative: true + symmetry: 0 + positive: false + monotonicity: 0 + "/": + realization: "/" + alias: ["div", "divide"] + inverse: "*" + arity: 2 + weight: 5 + precedence: 2 + commutative: false + symmetry: 0 + positive: false + monotonicity: 0 + abs: + realization: "abs" + alias: ["absolute"] + inverse: null + arity: 1 + weight: 4 + precedence: 3 + commutative: false + symmetry: 1 # symmetric + positive: true + monotonicity: 0 + inv: + realization: "nsrops.inv" + alias: ["inverse"] + inverse: "inv" + arity: 1 + weight: 4 + precedence: 4 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: -1 + pow2: + realization: "nsrops.pow2" + alias: ["square"] + inverse: null + arity: 1 + weight: 4 + precedence: 3 + commutative: false + symmetry: 1 # symmetric + positive: true + monotonicity: 0 + pow3: + realization: "nsrops.pow3" + alias: ["cube"] + inverse: "pow1_3" + arity: 1 + weight: 2 + precedence: 3 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + pow4: + realization: "nsrops.pow4" + alias: [] + inverse: null + arity: 1 + weight: 1 + precedence: 3 + commutative: false + symmetry: 1 + positive: true + monotonicity: 0 + pow5: + realization: "nsrops.pow5" + alias: [] + inverse: "pow1_5" + arity: 1 + weight: 1 + precedence: 3 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + pow1_2: + realization: "nsrops.pow1_2" + alias: ["sqrt"] + inverse: null + arity: 1 + weight: 4 + precedence: 3 + commutative: false + symmetry: 0 + positive: true + monotonicity: 1 + pow1_3: + realization: "nsrops.pow1_3" + alias: [] + inverse: null + arity: 1 + weight: 2 + precedence: 3 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + pow1_4: + realization: "nsrops.pow1_4" + alias: [] + inverse: null + arity: 1 + weight: 1 + precedence: 3 + commutative: false + symmetry: 0 + positive: true + monotonicity: 1 + pow1_5: + realization: "nsrops.pow1_5" + alias: [] + inverse: null + arity: 1 + weight: 1 + precedence: 3 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + sin: + realization: "numpy.sin" + alias: [] + inverse: "asin" + arity: 1 + weight: 4 + precedence: 2 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 0 + cos: + realization: "numpy.cos" + alias: [] + inverse: "acos" + arity: 1 + weight: 4 + precedence: 2 + commutative: false + symmetry: 1 # symmetric + positive: false + monotonicity: 0 + tan: + realization: "numpy.tan" + alias: [] + inverse: "atan" + arity: 1 + weight: 4 + precedence: 2 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 0 + asin: + realization: "numpy.arcsin" + alias: ["arcsin"] + inverse: "sin" + arity: 1 + weight: 2 + precedence: 2 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + acos: + realization: "numpy.arccos" + alias: ["arccos"] + inverse: "cos" + arity: 1 + weight: 2 + precedence: 2 + commutative: false + symmetry: 0 + positive: true + monotonicity: 1 + atan: + realization: "numpy.arctan" + alias: ["arctan"] + inverse: "tan" + arity: 1 + weight: 2 + precedence: 2 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + exp: + realization: "numpy.exp" + alias: [] + inverse: "log" + arity: 1 + weight: 4 + precedence: 3 + commutative: false + symmetry: 0 + positive: true + monotonicity: 1 + log: + realization: "numpy.log" + alias: ["ln"] + inverse: "exp" + arity: 1 + weight: 4 + precedence: 2 + commutative: false + symmetry: 0 + positive: false + monotonicity: 1 + +variables: 3 \ No newline at end of file diff --git a/configs/v7.0-large/nsr.yaml b/configs/v7.0-large/nsr.yaml new file mode 100644 index 0000000..e6621ba --- /dev/null +++ b/configs/v7.0-large/nsr.yaml @@ -0,0 +1,25 @@ +encoder_max_n_variables: 4 # includes the dependent variable +size: 1024 + +pre_encoder_input_type: "ieee-754" +pre_encoder_support_nan: False + +encoder: "SetTransformer" +encoder_kwargs: + hidden_size: 1024 + n_enc_isab: 12 + n_dec_sab: 6 + n_induce: 384 + n_heads: 16 + layer_norm: False + n_seeds: 384 + +decoder_n_heads: 16 +decoder_ff_size: 1024 +decoder_dropout: 0.1 +decoder_n_layers: 12 + +learnable_positional_embeddings: false +max_input_length: null + +expression_space: './expression_space.yaml' \ No newline at end of file diff --git a/configs/v7.0-large/skeleton_pool_train.yaml b/configs/v7.0-large/skeleton_pool_train.yaml new file mode 100644 index 0000000..9945a7f --- /dev/null +++ b/configs/v7.0-large/skeleton_pool_train.yaml @@ -0,0 +1,37 @@ +expression_space: './expression_space.yaml' +holdout_pools: [ + "{{ROOT}}/data/ansr-data/v7.0-large/skeleton_pool_val/", + "{{ROOT}}/data/ansr-data/test_set/soose_nc/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/feynman/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/nguyen/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/pool_15/skeleton_pool/" +] + +sample_strategy: + n_operator_distribution: "length_proportional" + min_operators: 0 + max_operators: 10 + power: 1 + max_length: 21 + max_tries: 1 + independent_dimensions: True + +allow_nan: False +simplify: True + +literal_prior: 'uniform' +literal_prior_kwargs: + low: -5 + high: 5 + +support_prior: "uniform_intervals" +support_prior_kwargs: + low: -10 + high: 10 + +n_support_prior: "uniform" +n_support_prior_kwargs: + low: 16 + high: 512 + min_value: 16 + max_value: 512 \ No newline at end of file diff --git a/configs/v7.0-large/skeleton_pool_val.yaml b/configs/v7.0-large/skeleton_pool_val.yaml new file mode 100644 index 0000000..29470da --- /dev/null +++ b/configs/v7.0-large/skeleton_pool_val.yaml @@ -0,0 +1,36 @@ +expression_space: './expression_space.yaml' +holdout_pools: [ + "{{ROOT}}/data/ansr-data/test_set/soose_nc/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/feynman/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/nguyen/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/pool_15/skeleton_pool/" +] + +sample_strategy: + n_operator_distribution: "length_proportional" + min_operators: 0 + max_operators: 10 + power: 1 + max_length: 21 + max_tries: 1 + independent_dimensions: True + +allow_nan: False +simplify: True + +literal_prior: 'uniform' +literal_prior_kwargs: + low: -5 + high: 5 + +support_prior: "uniform_intervals" +support_prior_kwargs: + low: -10 + high: 10 + +n_support_prior: "uniform" +n_support_prior_kwargs: + low: 16 + high: 512 + min_value: 16 + max_value: 512 \ No newline at end of file diff --git a/configs/v7.0-large/train.yaml b/configs/v7.0-large/train.yaml new file mode 100644 index 0000000..2d3f488 --- /dev/null +++ b/configs/v7.0-large/train.yaml @@ -0,0 +1,34 @@ +model: ./nsr.yaml + +optimizer: + name: AdamW + kwargs: + lr: 1 # Will be multiplied by scheduler + weight_decay: 0.01 + amsgrad: True + +lr_scheduler: + name: WarmupLinearAnnealing + kwargs: + min_lr: 0 + max_lr: 1e-4 + warmup_steps: 10_000 + total_steps: 1_500_000 + +batch_size_scheduler: + name: Constant + kwargs: + batch_size: 32 + gradient_accumulation_steps: 4 # Total: 4 * 32 = 128 + +train_dataset: ./dataset_train.yaml +val_dataset: "./dataset_val.yaml" +val_batch_size: 128 +val_size: 100_000 + +numeric_prediction_loss_weight: 0 + +gradient_accumulation_steps: 4 + +steps: 1_500_000 +device: cuda \ No newline at end of file diff --git a/configs/v7.0-mini/dataset_train.yaml b/configs/v7.0-mini/dataset_train.yaml new file mode 100644 index 0000000..bb27322 --- /dev/null +++ b/configs/v7.0-mini/dataset_train.yaml @@ -0,0 +1,2 @@ +skeleton_pool: './skeleton_pool_train.yaml' +padding: 'zero' \ No newline at end of file diff --git a/configs/v7.0-mini/dataset_val.yaml b/configs/v7.0-mini/dataset_val.yaml new file mode 100644 index 0000000..c15ed03 --- /dev/null +++ b/configs/v7.0-mini/dataset_val.yaml @@ -0,0 +1,2 @@ +skeleton_pool: './skeleton_pool_val.yaml' +padding: 'zero' \ No newline at end of file diff --git a/configs/v7.0-mini/evaluation.yaml b/configs/v7.0-mini/evaluation.yaml new file mode 100644 index 0000000..98f6576 --- /dev/null +++ b/configs/v7.0-mini/evaluation.yaml @@ -0,0 +1,14 @@ +n_support: 512 +beam_width: 32 +n_restarts: 8 +max_len: 32 +refiner_method: 'curve_fit_lm' +numeric_head: False +equivalence_pruning: True +pointwise_close_criterion: 0.95 +pointwise_close_accuracy_rtol: 0.05 +pointwise_close_accuracy_atol: 0.001 +r2_close_criterion: 0.95 +refiner_p0_noise: 'uniform' +refiner_p0_noise_kwargs: {'low': -5, 'high': 5} +device: cuda \ No newline at end of file diff --git a/configs/v7.0-mini/expression_space.yaml b/configs/v7.0-mini/expression_space.yaml new file mode 100644 index 0000000..8b17a96 --- /dev/null +++ b/configs/v7.0-mini/expression_space.yaml @@ -0,0 +1,256 @@ +operators: + "+": + realization: "+" + alias: ["add", "plus"] + inverse: "-" + arity: 2 + weight: 10 + precedence: 1 + commutative: true + symmetry: 0 + positive: false + monotonicity: 0 + "-": + realization: "-" + alias: ["sub", "minus"] + inverse: "+" + arity: 2 + weight: 5 + precedence: 1 + commutative: false + symmetry: 0 + positive: false + monotonicity: 0 + neg: + realization: "nsrops.neg" + alias: ["negative"] + inverse: "neg" + arity: 1 + weight: 5 + precedence: 2.5 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: -1 + "*": + realization: "*" + alias: ["mul", "times"] + inverse: "/" + arity: 2 + weight: 10 + precedence: 2 + commutative: true + symmetry: 0 + positive: false + monotonicity: 0 + "/": + realization: "/" + alias: ["div", "divide"] + inverse: "*" + arity: 2 + weight: 5 + precedence: 2 + commutative: false + symmetry: 0 + positive: false + monotonicity: 0 + abs: + realization: "abs" + alias: ["absolute"] + inverse: null + arity: 1 + weight: 4 + precedence: 3 + commutative: false + symmetry: 1 # symmetric + positive: true + monotonicity: 0 + inv: + realization: "nsrops.inv" + alias: ["inverse"] + inverse: "inv" + arity: 1 + weight: 4 + precedence: 4 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: -1 + pow2: + realization: "nsrops.pow2" + alias: ["square"] + inverse: null + arity: 1 + weight: 4 + precedence: 3 + commutative: false + symmetry: 1 # symmetric + positive: true + monotonicity: 0 + pow3: + realization: "nsrops.pow3" + alias: ["cube"] + inverse: "pow1_3" + arity: 1 + weight: 2 + precedence: 3 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + pow4: + realization: "nsrops.pow4" + alias: [] + inverse: null + arity: 1 + weight: 1 + precedence: 3 + commutative: false + symmetry: 1 + positive: true + monotonicity: 0 + pow5: + realization: "nsrops.pow5" + alias: [] + inverse: "pow1_5" + arity: 1 + weight: 1 + precedence: 3 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + pow1_2: + realization: "nsrops.pow1_2" + alias: ["sqrt"] + inverse: null + arity: 1 + weight: 4 + precedence: 3 + commutative: false + symmetry: 0 + positive: true + monotonicity: 1 + pow1_3: + realization: "nsrops.pow1_3" + alias: [] + inverse: null + arity: 1 + weight: 2 + precedence: 3 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + pow1_4: + realization: "nsrops.pow1_4" + alias: [] + inverse: null + arity: 1 + weight: 1 + precedence: 3 + commutative: false + symmetry: 0 + positive: true + monotonicity: 1 + pow1_5: + realization: "nsrops.pow1_5" + alias: [] + inverse: null + arity: 1 + weight: 1 + precedence: 3 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + sin: + realization: "numpy.sin" + alias: [] + inverse: "asin" + arity: 1 + weight: 4 + precedence: 2 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 0 + cos: + realization: "numpy.cos" + alias: [] + inverse: "acos" + arity: 1 + weight: 4 + precedence: 2 + commutative: false + symmetry: 1 # symmetric + positive: false + monotonicity: 0 + tan: + realization: "numpy.tan" + alias: [] + inverse: "atan" + arity: 1 + weight: 4 + precedence: 2 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 0 + asin: + realization: "numpy.arcsin" + alias: ["arcsin"] + inverse: "sin" + arity: 1 + weight: 2 + precedence: 2 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + acos: + realization: "numpy.arccos" + alias: ["arccos"] + inverse: "cos" + arity: 1 + weight: 2 + precedence: 2 + commutative: false + symmetry: 0 + positive: true + monotonicity: 1 + atan: + realization: "numpy.arctan" + alias: ["arctan"] + inverse: "tan" + arity: 1 + weight: 2 + precedence: 2 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + exp: + realization: "numpy.exp" + alias: [] + inverse: "log" + arity: 1 + weight: 4 + precedence: 3 + commutative: false + symmetry: 0 + positive: true + monotonicity: 1 + log: + realization: "numpy.log" + alias: ["ln"] + inverse: "exp" + arity: 1 + weight: 4 + precedence: 2 + commutative: false + symmetry: 0 + positive: false + monotonicity: 1 + +variables: 3 \ No newline at end of file diff --git a/configs/v7.0-mini/nsr.yaml b/configs/v7.0-mini/nsr.yaml new file mode 100644 index 0000000..9c13be3 --- /dev/null +++ b/configs/v7.0-mini/nsr.yaml @@ -0,0 +1,25 @@ +encoder_max_n_variables: 4 # includes the dependent variable +size: 192 + +pre_encoder_input_type: "ieee-754" +pre_encoder_support_nan: False + +encoder: "SetTransformer" +encoder_kwargs: + hidden_size: 192 + n_enc_isab: 3 + n_dec_sab: 2 + n_induce: 32 + n_heads: 4 + layer_norm: False + n_seeds: 32 + +decoder_n_heads: 4 +decoder_ff_size: 192 +decoder_dropout: 0.1 +decoder_n_layers: 3 + +learnable_positional_embeddings: false +max_input_length: null + +expression_space: './expression_space.yaml' \ No newline at end of file diff --git a/configs/v7.0-mini/skeleton_pool_train.yaml b/configs/v7.0-mini/skeleton_pool_train.yaml new file mode 100644 index 0000000..cc3d5ef --- /dev/null +++ b/configs/v7.0-mini/skeleton_pool_train.yaml @@ -0,0 +1,37 @@ +expression_space: './expression_space.yaml' +holdout_pools: [ + "{{ROOT}}/data/ansr-data/v7.0-mini/skeleton_pool_val/", + "{{ROOT}}/data/ansr-data/test_set/soose_nc/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/feynman/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/nguyen/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/pool_15/skeleton_pool/" +] + +sample_strategy: + n_operator_distribution: "length_proportional" + min_operators: 0 + max_operators: 10 + power: 1 + max_length: 21 + max_tries: 1 + independent_dimensions: True + +allow_nan: False +simplify: True + +literal_prior: 'uniform' +literal_prior_kwargs: + low: -5 + high: 5 + +support_prior: "uniform_intervals" +support_prior_kwargs: + low: -10 + high: 10 + +n_support_prior: "uniform" +n_support_prior_kwargs: + low: 16 + high: 512 + min_value: 16 + max_value: 512 \ No newline at end of file diff --git a/configs/v7.0-mini/skeleton_pool_val.yaml b/configs/v7.0-mini/skeleton_pool_val.yaml new file mode 100644 index 0000000..29470da --- /dev/null +++ b/configs/v7.0-mini/skeleton_pool_val.yaml @@ -0,0 +1,36 @@ +expression_space: './expression_space.yaml' +holdout_pools: [ + "{{ROOT}}/data/ansr-data/test_set/soose_nc/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/feynman/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/nguyen/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/pool_15/skeleton_pool/" +] + +sample_strategy: + n_operator_distribution: "length_proportional" + min_operators: 0 + max_operators: 10 + power: 1 + max_length: 21 + max_tries: 1 + independent_dimensions: True + +allow_nan: False +simplify: True + +literal_prior: 'uniform' +literal_prior_kwargs: + low: -5 + high: 5 + +support_prior: "uniform_intervals" +support_prior_kwargs: + low: -10 + high: 10 + +n_support_prior: "uniform" +n_support_prior_kwargs: + low: 16 + high: 512 + min_value: 16 + max_value: 512 \ No newline at end of file diff --git a/configs/v7.0-mini/train.yaml b/configs/v7.0-mini/train.yaml new file mode 100644 index 0000000..22f9026 --- /dev/null +++ b/configs/v7.0-mini/train.yaml @@ -0,0 +1,31 @@ +model: ./nsr.yaml + +optimizer: + name: AdamW + kwargs: + lr: 1 # Will be multiplied by scheduler + weight_decay: 0.01 + amsgrad: True + +lr_scheduler: + name: WarmupLinearAnnealing + kwargs: + min_lr: 0 + max_lr: 1e-4 + warmup_steps: 10_000 + total_steps: 1_500_000 + +batch_size_scheduler: + name: Constant + kwargs: + batch_size: 128 + +train_dataset: ./dataset_train.yaml +val_dataset: "./dataset_val.yaml" +val_batch_size: 128 +val_size: 100_000 + +numeric_prediction_loss_weight: 0 + +steps: 1_500_000 +device: cuda \ No newline at end of file diff --git a/configs/v7.0/dataset_train.yaml b/configs/v7.0/dataset_train.yaml new file mode 100644 index 0000000..bb27322 --- /dev/null +++ b/configs/v7.0/dataset_train.yaml @@ -0,0 +1,2 @@ +skeleton_pool: './skeleton_pool_train.yaml' +padding: 'zero' \ No newline at end of file diff --git a/configs/v7.0/dataset_val.yaml b/configs/v7.0/dataset_val.yaml new file mode 100644 index 0000000..c15ed03 --- /dev/null +++ b/configs/v7.0/dataset_val.yaml @@ -0,0 +1,2 @@ +skeleton_pool: './skeleton_pool_val.yaml' +padding: 'zero' \ No newline at end of file diff --git a/configs/v7.0/evaluation.yaml b/configs/v7.0/evaluation.yaml new file mode 100644 index 0000000..98f6576 --- /dev/null +++ b/configs/v7.0/evaluation.yaml @@ -0,0 +1,14 @@ +n_support: 512 +beam_width: 32 +n_restarts: 8 +max_len: 32 +refiner_method: 'curve_fit_lm' +numeric_head: False +equivalence_pruning: True +pointwise_close_criterion: 0.95 +pointwise_close_accuracy_rtol: 0.05 +pointwise_close_accuracy_atol: 0.001 +r2_close_criterion: 0.95 +refiner_p0_noise: 'uniform' +refiner_p0_noise_kwargs: {'low': -5, 'high': 5} +device: cuda \ No newline at end of file diff --git a/configs/v7.0/expression_space.yaml b/configs/v7.0/expression_space.yaml new file mode 100644 index 0000000..8b17a96 --- /dev/null +++ b/configs/v7.0/expression_space.yaml @@ -0,0 +1,256 @@ +operators: + "+": + realization: "+" + alias: ["add", "plus"] + inverse: "-" + arity: 2 + weight: 10 + precedence: 1 + commutative: true + symmetry: 0 + positive: false + monotonicity: 0 + "-": + realization: "-" + alias: ["sub", "minus"] + inverse: "+" + arity: 2 + weight: 5 + precedence: 1 + commutative: false + symmetry: 0 + positive: false + monotonicity: 0 + neg: + realization: "nsrops.neg" + alias: ["negative"] + inverse: "neg" + arity: 1 + weight: 5 + precedence: 2.5 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: -1 + "*": + realization: "*" + alias: ["mul", "times"] + inverse: "/" + arity: 2 + weight: 10 + precedence: 2 + commutative: true + symmetry: 0 + positive: false + monotonicity: 0 + "/": + realization: "/" + alias: ["div", "divide"] + inverse: "*" + arity: 2 + weight: 5 + precedence: 2 + commutative: false + symmetry: 0 + positive: false + monotonicity: 0 + abs: + realization: "abs" + alias: ["absolute"] + inverse: null + arity: 1 + weight: 4 + precedence: 3 + commutative: false + symmetry: 1 # symmetric + positive: true + monotonicity: 0 + inv: + realization: "nsrops.inv" + alias: ["inverse"] + inverse: "inv" + arity: 1 + weight: 4 + precedence: 4 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: -1 + pow2: + realization: "nsrops.pow2" + alias: ["square"] + inverse: null + arity: 1 + weight: 4 + precedence: 3 + commutative: false + symmetry: 1 # symmetric + positive: true + monotonicity: 0 + pow3: + realization: "nsrops.pow3" + alias: ["cube"] + inverse: "pow1_3" + arity: 1 + weight: 2 + precedence: 3 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + pow4: + realization: "nsrops.pow4" + alias: [] + inverse: null + arity: 1 + weight: 1 + precedence: 3 + commutative: false + symmetry: 1 + positive: true + monotonicity: 0 + pow5: + realization: "nsrops.pow5" + alias: [] + inverse: "pow1_5" + arity: 1 + weight: 1 + precedence: 3 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + pow1_2: + realization: "nsrops.pow1_2" + alias: ["sqrt"] + inverse: null + arity: 1 + weight: 4 + precedence: 3 + commutative: false + symmetry: 0 + positive: true + monotonicity: 1 + pow1_3: + realization: "nsrops.pow1_3" + alias: [] + inverse: null + arity: 1 + weight: 2 + precedence: 3 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + pow1_4: + realization: "nsrops.pow1_4" + alias: [] + inverse: null + arity: 1 + weight: 1 + precedence: 3 + commutative: false + symmetry: 0 + positive: true + monotonicity: 1 + pow1_5: + realization: "nsrops.pow1_5" + alias: [] + inverse: null + arity: 1 + weight: 1 + precedence: 3 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + sin: + realization: "numpy.sin" + alias: [] + inverse: "asin" + arity: 1 + weight: 4 + precedence: 2 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 0 + cos: + realization: "numpy.cos" + alias: [] + inverse: "acos" + arity: 1 + weight: 4 + precedence: 2 + commutative: false + symmetry: 1 # symmetric + positive: false + monotonicity: 0 + tan: + realization: "numpy.tan" + alias: [] + inverse: "atan" + arity: 1 + weight: 4 + precedence: 2 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 0 + asin: + realization: "numpy.arcsin" + alias: ["arcsin"] + inverse: "sin" + arity: 1 + weight: 2 + precedence: 2 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + acos: + realization: "numpy.arccos" + alias: ["arccos"] + inverse: "cos" + arity: 1 + weight: 2 + precedence: 2 + commutative: false + symmetry: 0 + positive: true + monotonicity: 1 + atan: + realization: "numpy.arctan" + alias: ["arctan"] + inverse: "tan" + arity: 1 + weight: 2 + precedence: 2 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + exp: + realization: "numpy.exp" + alias: [] + inverse: "log" + arity: 1 + weight: 4 + precedence: 3 + commutative: false + symmetry: 0 + positive: true + monotonicity: 1 + log: + realization: "numpy.log" + alias: ["ln"] + inverse: "exp" + arity: 1 + weight: 4 + precedence: 2 + commutative: false + symmetry: 0 + positive: false + monotonicity: 1 + +variables: 3 \ No newline at end of file diff --git a/configs/v7.0/nsr.yaml b/configs/v7.0/nsr.yaml new file mode 100644 index 0000000..8c48ce2 --- /dev/null +++ b/configs/v7.0/nsr.yaml @@ -0,0 +1,25 @@ +encoder_max_n_variables: 4 # includes the dependent variable +size: 512 + +pre_encoder_input_type: "ieee-754" +pre_encoder_support_nan: False + +encoder: "SetTransformer" +encoder_kwargs: + hidden_size: 512 + n_enc_isab: 5 + n_dec_sab: 2 + n_induce: 64 + n_heads: 8 + layer_norm: False + n_seeds: 64 + +decoder_n_heads: 8 +decoder_ff_size: 512 +decoder_dropout: 0.1 +decoder_n_layers: 5 + +learnable_positional_embeddings: false +max_input_length: null + +expression_space: './expression_space.yaml' \ No newline at end of file diff --git a/configs/v7.0/skeleton_pool_train.yaml b/configs/v7.0/skeleton_pool_train.yaml new file mode 100644 index 0000000..0683f6e --- /dev/null +++ b/configs/v7.0/skeleton_pool_train.yaml @@ -0,0 +1,37 @@ +expression_space: './expression_space.yaml' +holdout_pools: [ + "{{ROOT}}/data/ansr-data/v7.0/skeleton_pool_val/", + "{{ROOT}}/data/ansr-data/test_set/soose_nc/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/feynman/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/nguyen/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/pool_15/skeleton_pool/" +] + +sample_strategy: + n_operator_distribution: "length_proportional" + min_operators: 0 + max_operators: 10 + power: 1 + max_length: 21 + max_tries: 1 + independent_dimensions: True + +allow_nan: False +simplify: True + +literal_prior: 'uniform' +literal_prior_kwargs: + low: -5 + high: 5 + +support_prior: "uniform_intervals" +support_prior_kwargs: + low: -10 + high: 10 + +n_support_prior: "uniform" +n_support_prior_kwargs: + low: 16 + high: 512 + min_value: 16 + max_value: 512 \ No newline at end of file diff --git a/configs/v7.0/skeleton_pool_val.yaml b/configs/v7.0/skeleton_pool_val.yaml new file mode 100644 index 0000000..29470da --- /dev/null +++ b/configs/v7.0/skeleton_pool_val.yaml @@ -0,0 +1,36 @@ +expression_space: './expression_space.yaml' +holdout_pools: [ + "{{ROOT}}/data/ansr-data/test_set/soose_nc/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/feynman/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/nguyen/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/pool_15/skeleton_pool/" +] + +sample_strategy: + n_operator_distribution: "length_proportional" + min_operators: 0 + max_operators: 10 + power: 1 + max_length: 21 + max_tries: 1 + independent_dimensions: True + +allow_nan: False +simplify: True + +literal_prior: 'uniform' +literal_prior_kwargs: + low: -5 + high: 5 + +support_prior: "uniform_intervals" +support_prior_kwargs: + low: -10 + high: 10 + +n_support_prior: "uniform" +n_support_prior_kwargs: + low: 16 + high: 512 + min_value: 16 + max_value: 512 \ No newline at end of file diff --git a/configs/v7.0/train.yaml b/configs/v7.0/train.yaml new file mode 100644 index 0000000..22f9026 --- /dev/null +++ b/configs/v7.0/train.yaml @@ -0,0 +1,31 @@ +model: ./nsr.yaml + +optimizer: + name: AdamW + kwargs: + lr: 1 # Will be multiplied by scheduler + weight_decay: 0.01 + amsgrad: True + +lr_scheduler: + name: WarmupLinearAnnealing + kwargs: + min_lr: 0 + max_lr: 1e-4 + warmup_steps: 10_000 + total_steps: 1_500_000 + +batch_size_scheduler: + name: Constant + kwargs: + batch_size: 128 + +train_dataset: ./dataset_train.yaml +val_dataset: "./dataset_val.yaml" +val_batch_size: 128 +val_size: 100_000 + +numeric_prediction_loss_weight: 0 + +steps: 1_500_000 +device: cuda \ No newline at end of file diff --git a/configs/v7.1/dataset_train.yaml b/configs/v7.1/dataset_train.yaml new file mode 100644 index 0000000..bb27322 --- /dev/null +++ b/configs/v7.1/dataset_train.yaml @@ -0,0 +1,2 @@ +skeleton_pool: './skeleton_pool_train.yaml' +padding: 'zero' \ No newline at end of file diff --git a/configs/v7.1/dataset_val.yaml b/configs/v7.1/dataset_val.yaml new file mode 100644 index 0000000..c15ed03 --- /dev/null +++ b/configs/v7.1/dataset_val.yaml @@ -0,0 +1,2 @@ +skeleton_pool: './skeleton_pool_val.yaml' +padding: 'zero' \ No newline at end of file diff --git a/configs/v7.1/evaluation.yaml b/configs/v7.1/evaluation.yaml new file mode 100644 index 0000000..98f6576 --- /dev/null +++ b/configs/v7.1/evaluation.yaml @@ -0,0 +1,14 @@ +n_support: 512 +beam_width: 32 +n_restarts: 8 +max_len: 32 +refiner_method: 'curve_fit_lm' +numeric_head: False +equivalence_pruning: True +pointwise_close_criterion: 0.95 +pointwise_close_accuracy_rtol: 0.05 +pointwise_close_accuracy_atol: 0.001 +r2_close_criterion: 0.95 +refiner_p0_noise: 'uniform' +refiner_p0_noise_kwargs: {'low': -5, 'high': 5} +device: cuda \ No newline at end of file diff --git a/configs/v7.1/expression_space.yaml b/configs/v7.1/expression_space.yaml new file mode 100644 index 0000000..8b17a96 --- /dev/null +++ b/configs/v7.1/expression_space.yaml @@ -0,0 +1,256 @@ +operators: + "+": + realization: "+" + alias: ["add", "plus"] + inverse: "-" + arity: 2 + weight: 10 + precedence: 1 + commutative: true + symmetry: 0 + positive: false + monotonicity: 0 + "-": + realization: "-" + alias: ["sub", "minus"] + inverse: "+" + arity: 2 + weight: 5 + precedence: 1 + commutative: false + symmetry: 0 + positive: false + monotonicity: 0 + neg: + realization: "nsrops.neg" + alias: ["negative"] + inverse: "neg" + arity: 1 + weight: 5 + precedence: 2.5 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: -1 + "*": + realization: "*" + alias: ["mul", "times"] + inverse: "/" + arity: 2 + weight: 10 + precedence: 2 + commutative: true + symmetry: 0 + positive: false + monotonicity: 0 + "/": + realization: "/" + alias: ["div", "divide"] + inverse: "*" + arity: 2 + weight: 5 + precedence: 2 + commutative: false + symmetry: 0 + positive: false + monotonicity: 0 + abs: + realization: "abs" + alias: ["absolute"] + inverse: null + arity: 1 + weight: 4 + precedence: 3 + commutative: false + symmetry: 1 # symmetric + positive: true + monotonicity: 0 + inv: + realization: "nsrops.inv" + alias: ["inverse"] + inverse: "inv" + arity: 1 + weight: 4 + precedence: 4 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: -1 + pow2: + realization: "nsrops.pow2" + alias: ["square"] + inverse: null + arity: 1 + weight: 4 + precedence: 3 + commutative: false + symmetry: 1 # symmetric + positive: true + monotonicity: 0 + pow3: + realization: "nsrops.pow3" + alias: ["cube"] + inverse: "pow1_3" + arity: 1 + weight: 2 + precedence: 3 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + pow4: + realization: "nsrops.pow4" + alias: [] + inverse: null + arity: 1 + weight: 1 + precedence: 3 + commutative: false + symmetry: 1 + positive: true + monotonicity: 0 + pow5: + realization: "nsrops.pow5" + alias: [] + inverse: "pow1_5" + arity: 1 + weight: 1 + precedence: 3 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + pow1_2: + realization: "nsrops.pow1_2" + alias: ["sqrt"] + inverse: null + arity: 1 + weight: 4 + precedence: 3 + commutative: false + symmetry: 0 + positive: true + monotonicity: 1 + pow1_3: + realization: "nsrops.pow1_3" + alias: [] + inverse: null + arity: 1 + weight: 2 + precedence: 3 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + pow1_4: + realization: "nsrops.pow1_4" + alias: [] + inverse: null + arity: 1 + weight: 1 + precedence: 3 + commutative: false + symmetry: 0 + positive: true + monotonicity: 1 + pow1_5: + realization: "nsrops.pow1_5" + alias: [] + inverse: null + arity: 1 + weight: 1 + precedence: 3 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + sin: + realization: "numpy.sin" + alias: [] + inverse: "asin" + arity: 1 + weight: 4 + precedence: 2 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 0 + cos: + realization: "numpy.cos" + alias: [] + inverse: "acos" + arity: 1 + weight: 4 + precedence: 2 + commutative: false + symmetry: 1 # symmetric + positive: false + monotonicity: 0 + tan: + realization: "numpy.tan" + alias: [] + inverse: "atan" + arity: 1 + weight: 4 + precedence: 2 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 0 + asin: + realization: "numpy.arcsin" + alias: ["arcsin"] + inverse: "sin" + arity: 1 + weight: 2 + precedence: 2 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + acos: + realization: "numpy.arccos" + alias: ["arccos"] + inverse: "cos" + arity: 1 + weight: 2 + precedence: 2 + commutative: false + symmetry: 0 + positive: true + monotonicity: 1 + atan: + realization: "numpy.arctan" + alias: ["arctan"] + inverse: "tan" + arity: 1 + weight: 2 + precedence: 2 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + exp: + realization: "numpy.exp" + alias: [] + inverse: "log" + arity: 1 + weight: 4 + precedence: 3 + commutative: false + symmetry: 0 + positive: true + monotonicity: 1 + log: + realization: "numpy.log" + alias: ["ln"] + inverse: "exp" + arity: 1 + weight: 4 + precedence: 2 + commutative: false + symmetry: 0 + positive: false + monotonicity: 1 + +variables: 3 \ No newline at end of file diff --git a/configs/v7.1/nsr.yaml b/configs/v7.1/nsr.yaml new file mode 100644 index 0000000..8c48ce2 --- /dev/null +++ b/configs/v7.1/nsr.yaml @@ -0,0 +1,25 @@ +encoder_max_n_variables: 4 # includes the dependent variable +size: 512 + +pre_encoder_input_type: "ieee-754" +pre_encoder_support_nan: False + +encoder: "SetTransformer" +encoder_kwargs: + hidden_size: 512 + n_enc_isab: 5 + n_dec_sab: 2 + n_induce: 64 + n_heads: 8 + layer_norm: False + n_seeds: 64 + +decoder_n_heads: 8 +decoder_ff_size: 512 +decoder_dropout: 0.1 +decoder_n_layers: 5 + +learnable_positional_embeddings: false +max_input_length: null + +expression_space: './expression_space.yaml' \ No newline at end of file diff --git a/configs/v7.1/skeleton_pool_train.yaml b/configs/v7.1/skeleton_pool_train.yaml new file mode 100644 index 0000000..b8d067b --- /dev/null +++ b/configs/v7.1/skeleton_pool_train.yaml @@ -0,0 +1,37 @@ +expression_space: './expression_space.yaml' +holdout_pools: [ + "{{ROOT}}/data/ansr-data/v7.1/skeleton_pool_val/", + "{{ROOT}}/data/ansr-data/test_set/soose_nc/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/feynman/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/nguyen/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/pool_15/skeleton_pool/" +] + +sample_strategy: + n_operator_distribution: "length_proportional" + min_operators: 0 + max_operators: 10 + power: 1 + max_length: 21 + max_tries: 1 + independent_dimensions: True + +allow_nan: False +simplify: False + +literal_prior: 'uniform' +literal_prior_kwargs: + low: -5 + high: 5 + +support_prior: "uniform_intervals" +support_prior_kwargs: + low: -10 + high: 10 + +n_support_prior: "uniform" +n_support_prior_kwargs: + low: 16 + high: 512 + min_value: 16 + max_value: 512 \ No newline at end of file diff --git a/configs/v7.1/skeleton_pool_val.yaml b/configs/v7.1/skeleton_pool_val.yaml new file mode 100644 index 0000000..b5e6bfe --- /dev/null +++ b/configs/v7.1/skeleton_pool_val.yaml @@ -0,0 +1,36 @@ +expression_space: './expression_space.yaml' +holdout_pools: [ + "{{ROOT}}/data/ansr-data/test_set/soose_nc/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/feynman/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/nguyen/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/pool_15/skeleton_pool/" +] + +sample_strategy: + n_operator_distribution: "length_proportional" + min_operators: 0 + max_operators: 10 + power: 1 + max_length: 21 + max_tries: 1 + independent_dimensions: True + +allow_nan: False +simplify: False + +literal_prior: 'uniform' +literal_prior_kwargs: + low: -5 + high: 5 + +support_prior: "uniform_intervals" +support_prior_kwargs: + low: -10 + high: 10 + +n_support_prior: "uniform" +n_support_prior_kwargs: + low: 16 + high: 512 + min_value: 16 + max_value: 512 \ No newline at end of file diff --git a/configs/v7.1/train.yaml b/configs/v7.1/train.yaml new file mode 100644 index 0000000..22f9026 --- /dev/null +++ b/configs/v7.1/train.yaml @@ -0,0 +1,31 @@ +model: ./nsr.yaml + +optimizer: + name: AdamW + kwargs: + lr: 1 # Will be multiplied by scheduler + weight_decay: 0.01 + amsgrad: True + +lr_scheduler: + name: WarmupLinearAnnealing + kwargs: + min_lr: 0 + max_lr: 1e-4 + warmup_steps: 10_000 + total_steps: 1_500_000 + +batch_size_scheduler: + name: Constant + kwargs: + batch_size: 128 + +train_dataset: ./dataset_train.yaml +val_dataset: "./dataset_val.yaml" +val_batch_size: 128 +val_size: 100_000 + +numeric_prediction_loss_weight: 0 + +steps: 1_500_000 +device: cuda \ No newline at end of file diff --git a/configs/v7.2/dataset_train.yaml b/configs/v7.2/dataset_train.yaml new file mode 100644 index 0000000..bb27322 --- /dev/null +++ b/configs/v7.2/dataset_train.yaml @@ -0,0 +1,2 @@ +skeleton_pool: './skeleton_pool_train.yaml' +padding: 'zero' \ No newline at end of file diff --git a/configs/v7.2/dataset_val.yaml b/configs/v7.2/dataset_val.yaml new file mode 100644 index 0000000..c15ed03 --- /dev/null +++ b/configs/v7.2/dataset_val.yaml @@ -0,0 +1,2 @@ +skeleton_pool: './skeleton_pool_val.yaml' +padding: 'zero' \ No newline at end of file diff --git a/configs/v7.2/evaluation.yaml b/configs/v7.2/evaluation.yaml new file mode 100644 index 0000000..98f6576 --- /dev/null +++ b/configs/v7.2/evaluation.yaml @@ -0,0 +1,14 @@ +n_support: 512 +beam_width: 32 +n_restarts: 8 +max_len: 32 +refiner_method: 'curve_fit_lm' +numeric_head: False +equivalence_pruning: True +pointwise_close_criterion: 0.95 +pointwise_close_accuracy_rtol: 0.05 +pointwise_close_accuracy_atol: 0.001 +r2_close_criterion: 0.95 +refiner_p0_noise: 'uniform' +refiner_p0_noise_kwargs: {'low': -5, 'high': 5} +device: cuda \ No newline at end of file diff --git a/configs/v7.2/expression_space.yaml b/configs/v7.2/expression_space.yaml new file mode 100644 index 0000000..8b17a96 --- /dev/null +++ b/configs/v7.2/expression_space.yaml @@ -0,0 +1,256 @@ +operators: + "+": + realization: "+" + alias: ["add", "plus"] + inverse: "-" + arity: 2 + weight: 10 + precedence: 1 + commutative: true + symmetry: 0 + positive: false + monotonicity: 0 + "-": + realization: "-" + alias: ["sub", "minus"] + inverse: "+" + arity: 2 + weight: 5 + precedence: 1 + commutative: false + symmetry: 0 + positive: false + monotonicity: 0 + neg: + realization: "nsrops.neg" + alias: ["negative"] + inverse: "neg" + arity: 1 + weight: 5 + precedence: 2.5 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: -1 + "*": + realization: "*" + alias: ["mul", "times"] + inverse: "/" + arity: 2 + weight: 10 + precedence: 2 + commutative: true + symmetry: 0 + positive: false + monotonicity: 0 + "/": + realization: "/" + alias: ["div", "divide"] + inverse: "*" + arity: 2 + weight: 5 + precedence: 2 + commutative: false + symmetry: 0 + positive: false + monotonicity: 0 + abs: + realization: "abs" + alias: ["absolute"] + inverse: null + arity: 1 + weight: 4 + precedence: 3 + commutative: false + symmetry: 1 # symmetric + positive: true + monotonicity: 0 + inv: + realization: "nsrops.inv" + alias: ["inverse"] + inverse: "inv" + arity: 1 + weight: 4 + precedence: 4 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: -1 + pow2: + realization: "nsrops.pow2" + alias: ["square"] + inverse: null + arity: 1 + weight: 4 + precedence: 3 + commutative: false + symmetry: 1 # symmetric + positive: true + monotonicity: 0 + pow3: + realization: "nsrops.pow3" + alias: ["cube"] + inverse: "pow1_3" + arity: 1 + weight: 2 + precedence: 3 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + pow4: + realization: "nsrops.pow4" + alias: [] + inverse: null + arity: 1 + weight: 1 + precedence: 3 + commutative: false + symmetry: 1 + positive: true + monotonicity: 0 + pow5: + realization: "nsrops.pow5" + alias: [] + inverse: "pow1_5" + arity: 1 + weight: 1 + precedence: 3 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + pow1_2: + realization: "nsrops.pow1_2" + alias: ["sqrt"] + inverse: null + arity: 1 + weight: 4 + precedence: 3 + commutative: false + symmetry: 0 + positive: true + monotonicity: 1 + pow1_3: + realization: "nsrops.pow1_3" + alias: [] + inverse: null + arity: 1 + weight: 2 + precedence: 3 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + pow1_4: + realization: "nsrops.pow1_4" + alias: [] + inverse: null + arity: 1 + weight: 1 + precedence: 3 + commutative: false + symmetry: 0 + positive: true + monotonicity: 1 + pow1_5: + realization: "nsrops.pow1_5" + alias: [] + inverse: null + arity: 1 + weight: 1 + precedence: 3 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + sin: + realization: "numpy.sin" + alias: [] + inverse: "asin" + arity: 1 + weight: 4 + precedence: 2 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 0 + cos: + realization: "numpy.cos" + alias: [] + inverse: "acos" + arity: 1 + weight: 4 + precedence: 2 + commutative: false + symmetry: 1 # symmetric + positive: false + monotonicity: 0 + tan: + realization: "numpy.tan" + alias: [] + inverse: "atan" + arity: 1 + weight: 4 + precedence: 2 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 0 + asin: + realization: "numpy.arcsin" + alias: ["arcsin"] + inverse: "sin" + arity: 1 + weight: 2 + precedence: 2 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + acos: + realization: "numpy.arccos" + alias: ["arccos"] + inverse: "cos" + arity: 1 + weight: 2 + precedence: 2 + commutative: false + symmetry: 0 + positive: true + monotonicity: 1 + atan: + realization: "numpy.arctan" + alias: ["arctan"] + inverse: "tan" + arity: 1 + weight: 2 + precedence: 2 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + exp: + realization: "numpy.exp" + alias: [] + inverse: "log" + arity: 1 + weight: 4 + precedence: 3 + commutative: false + symmetry: 0 + positive: true + monotonicity: 1 + log: + realization: "numpy.log" + alias: ["ln"] + inverse: "exp" + arity: 1 + weight: 4 + precedence: 2 + commutative: false + symmetry: 0 + positive: false + monotonicity: 1 + +variables: 3 \ No newline at end of file diff --git a/configs/v7.2/nsr.yaml b/configs/v7.2/nsr.yaml new file mode 100644 index 0000000..8c48ce2 --- /dev/null +++ b/configs/v7.2/nsr.yaml @@ -0,0 +1,25 @@ +encoder_max_n_variables: 4 # includes the dependent variable +size: 512 + +pre_encoder_input_type: "ieee-754" +pre_encoder_support_nan: False + +encoder: "SetTransformer" +encoder_kwargs: + hidden_size: 512 + n_enc_isab: 5 + n_dec_sab: 2 + n_induce: 64 + n_heads: 8 + layer_norm: False + n_seeds: 64 + +decoder_n_heads: 8 +decoder_ff_size: 512 +decoder_dropout: 0.1 +decoder_n_layers: 5 + +learnable_positional_embeddings: false +max_input_length: null + +expression_space: './expression_space.yaml' \ No newline at end of file diff --git a/configs/v7.2/skeleton_pool_train.yaml b/configs/v7.2/skeleton_pool_train.yaml new file mode 100644 index 0000000..62ab437 --- /dev/null +++ b/configs/v7.2/skeleton_pool_train.yaml @@ -0,0 +1,37 @@ +expression_space: './expression_space.yaml' +holdout_pools: [ + "{{ROOT}}/data/ansr-data/v7.2/skeleton_pool_val/", + "{{ROOT}}/data/ansr-data/test_set/soose_nc/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/feynman/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/nguyen/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/pool_15/skeleton_pool/" +] + +sample_strategy: + n_operator_distribution: "length_proportional" + min_operators: 0 + max_operators: 5 + power: 1 + max_length: 11 + max_tries: 1 + independent_dimensions: True + +allow_nan: False +simplify: True + +literal_prior: 'uniform' +literal_prior_kwargs: + low: -5 + high: 5 + +support_prior: "uniform_intervals" +support_prior_kwargs: + low: -10 + high: 10 + +n_support_prior: "uniform" +n_support_prior_kwargs: + low: 16 + high: 512 + min_value: 16 + max_value: 512 \ No newline at end of file diff --git a/configs/v7.2/skeleton_pool_val.yaml b/configs/v7.2/skeleton_pool_val.yaml new file mode 100644 index 0000000..0ef964b --- /dev/null +++ b/configs/v7.2/skeleton_pool_val.yaml @@ -0,0 +1,36 @@ +expression_space: './expression_space.yaml' +holdout_pools: [ + "{{ROOT}}/data/ansr-data/test_set/soose_nc/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/feynman/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/nguyen/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/pool_15/skeleton_pool/" +] + +sample_strategy: + n_operator_distribution: "length_proportional" + min_operators: 0 + max_operators: 5 + power: 1 + max_length: 11 + max_tries: 1 + independent_dimensions: True + +allow_nan: False +simplify: True + +literal_prior: 'uniform' +literal_prior_kwargs: + low: -5 + high: 5 + +support_prior: "uniform_intervals" +support_prior_kwargs: + low: -10 + high: 10 + +n_support_prior: "uniform" +n_support_prior_kwargs: + low: 16 + high: 512 + min_value: 16 + max_value: 512 \ No newline at end of file diff --git a/configs/v7.2/train.yaml b/configs/v7.2/train.yaml new file mode 100644 index 0000000..22f9026 --- /dev/null +++ b/configs/v7.2/train.yaml @@ -0,0 +1,31 @@ +model: ./nsr.yaml + +optimizer: + name: AdamW + kwargs: + lr: 1 # Will be multiplied by scheduler + weight_decay: 0.01 + amsgrad: True + +lr_scheduler: + name: WarmupLinearAnnealing + kwargs: + min_lr: 0 + max_lr: 1e-4 + warmup_steps: 10_000 + total_steps: 1_500_000 + +batch_size_scheduler: + name: Constant + kwargs: + batch_size: 128 + +train_dataset: ./dataset_train.yaml +val_dataset: "./dataset_val.yaml" +val_batch_size: 128 +val_size: 100_000 + +numeric_prediction_loss_weight: 0 + +steps: 1_500_000 +device: cuda \ No newline at end of file diff --git a/configs/v7.3/dataset_train.yaml b/configs/v7.3/dataset_train.yaml new file mode 100644 index 0000000..bb27322 --- /dev/null +++ b/configs/v7.3/dataset_train.yaml @@ -0,0 +1,2 @@ +skeleton_pool: './skeleton_pool_train.yaml' +padding: 'zero' \ No newline at end of file diff --git a/configs/v7.3/dataset_val.yaml b/configs/v7.3/dataset_val.yaml new file mode 100644 index 0000000..c15ed03 --- /dev/null +++ b/configs/v7.3/dataset_val.yaml @@ -0,0 +1,2 @@ +skeleton_pool: './skeleton_pool_val.yaml' +padding: 'zero' \ No newline at end of file diff --git a/configs/v7.3/evaluation.yaml b/configs/v7.3/evaluation.yaml new file mode 100644 index 0000000..98f6576 --- /dev/null +++ b/configs/v7.3/evaluation.yaml @@ -0,0 +1,14 @@ +n_support: 512 +beam_width: 32 +n_restarts: 8 +max_len: 32 +refiner_method: 'curve_fit_lm' +numeric_head: False +equivalence_pruning: True +pointwise_close_criterion: 0.95 +pointwise_close_accuracy_rtol: 0.05 +pointwise_close_accuracy_atol: 0.001 +r2_close_criterion: 0.95 +refiner_p0_noise: 'uniform' +refiner_p0_noise_kwargs: {'low': -5, 'high': 5} +device: cuda \ No newline at end of file diff --git a/configs/v7.3/expression_space.yaml b/configs/v7.3/expression_space.yaml new file mode 100644 index 0000000..8b17a96 --- /dev/null +++ b/configs/v7.3/expression_space.yaml @@ -0,0 +1,256 @@ +operators: + "+": + realization: "+" + alias: ["add", "plus"] + inverse: "-" + arity: 2 + weight: 10 + precedence: 1 + commutative: true + symmetry: 0 + positive: false + monotonicity: 0 + "-": + realization: "-" + alias: ["sub", "minus"] + inverse: "+" + arity: 2 + weight: 5 + precedence: 1 + commutative: false + symmetry: 0 + positive: false + monotonicity: 0 + neg: + realization: "nsrops.neg" + alias: ["negative"] + inverse: "neg" + arity: 1 + weight: 5 + precedence: 2.5 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: -1 + "*": + realization: "*" + alias: ["mul", "times"] + inverse: "/" + arity: 2 + weight: 10 + precedence: 2 + commutative: true + symmetry: 0 + positive: false + monotonicity: 0 + "/": + realization: "/" + alias: ["div", "divide"] + inverse: "*" + arity: 2 + weight: 5 + precedence: 2 + commutative: false + symmetry: 0 + positive: false + monotonicity: 0 + abs: + realization: "abs" + alias: ["absolute"] + inverse: null + arity: 1 + weight: 4 + precedence: 3 + commutative: false + symmetry: 1 # symmetric + positive: true + monotonicity: 0 + inv: + realization: "nsrops.inv" + alias: ["inverse"] + inverse: "inv" + arity: 1 + weight: 4 + precedence: 4 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: -1 + pow2: + realization: "nsrops.pow2" + alias: ["square"] + inverse: null + arity: 1 + weight: 4 + precedence: 3 + commutative: false + symmetry: 1 # symmetric + positive: true + monotonicity: 0 + pow3: + realization: "nsrops.pow3" + alias: ["cube"] + inverse: "pow1_3" + arity: 1 + weight: 2 + precedence: 3 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + pow4: + realization: "nsrops.pow4" + alias: [] + inverse: null + arity: 1 + weight: 1 + precedence: 3 + commutative: false + symmetry: 1 + positive: true + monotonicity: 0 + pow5: + realization: "nsrops.pow5" + alias: [] + inverse: "pow1_5" + arity: 1 + weight: 1 + precedence: 3 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + pow1_2: + realization: "nsrops.pow1_2" + alias: ["sqrt"] + inverse: null + arity: 1 + weight: 4 + precedence: 3 + commutative: false + symmetry: 0 + positive: true + monotonicity: 1 + pow1_3: + realization: "nsrops.pow1_3" + alias: [] + inverse: null + arity: 1 + weight: 2 + precedence: 3 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + pow1_4: + realization: "nsrops.pow1_4" + alias: [] + inverse: null + arity: 1 + weight: 1 + precedence: 3 + commutative: false + symmetry: 0 + positive: true + monotonicity: 1 + pow1_5: + realization: "nsrops.pow1_5" + alias: [] + inverse: null + arity: 1 + weight: 1 + precedence: 3 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + sin: + realization: "numpy.sin" + alias: [] + inverse: "asin" + arity: 1 + weight: 4 + precedence: 2 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 0 + cos: + realization: "numpy.cos" + alias: [] + inverse: "acos" + arity: 1 + weight: 4 + precedence: 2 + commutative: false + symmetry: 1 # symmetric + positive: false + monotonicity: 0 + tan: + realization: "numpy.tan" + alias: [] + inverse: "atan" + arity: 1 + weight: 4 + precedence: 2 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 0 + asin: + realization: "numpy.arcsin" + alias: ["arcsin"] + inverse: "sin" + arity: 1 + weight: 2 + precedence: 2 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + acos: + realization: "numpy.arccos" + alias: ["arccos"] + inverse: "cos" + arity: 1 + weight: 2 + precedence: 2 + commutative: false + symmetry: 0 + positive: true + monotonicity: 1 + atan: + realization: "numpy.arctan" + alias: ["arctan"] + inverse: "tan" + arity: 1 + weight: 2 + precedence: 2 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + exp: + realization: "numpy.exp" + alias: [] + inverse: "log" + arity: 1 + weight: 4 + precedence: 3 + commutative: false + symmetry: 0 + positive: true + monotonicity: 1 + log: + realization: "numpy.log" + alias: ["ln"] + inverse: "exp" + arity: 1 + weight: 4 + precedence: 2 + commutative: false + symmetry: 0 + positive: false + monotonicity: 1 + +variables: 3 \ No newline at end of file diff --git a/configs/v7.3/nsr.yaml b/configs/v7.3/nsr.yaml new file mode 100644 index 0000000..87b5c20 --- /dev/null +++ b/configs/v7.3/nsr.yaml @@ -0,0 +1,25 @@ +encoder_max_n_variables: 4 # includes the dependent variable +size: 512 + +pre_encoder_input_type: "ieee-754" +pre_encoder_support_nan: False + +encoder: "SetTransformer" +encoder_kwargs: + hidden_size: 512 + n_enc_isab: 5 + n_dec_sab: 2 + n_induce: 64 + n_heads: 8 + layer_norm: False + n_seeds: 10 + +decoder_n_heads: 8 +decoder_ff_size: 512 +decoder_dropout: 0.1 +decoder_n_layers: 5 + +learnable_positional_embeddings: false +max_input_length: null + +expression_space: './expression_space.yaml' \ No newline at end of file diff --git a/configs/v7.3/skeleton_pool_train.yaml b/configs/v7.3/skeleton_pool_train.yaml new file mode 100644 index 0000000..0c29419 --- /dev/null +++ b/configs/v7.3/skeleton_pool_train.yaml @@ -0,0 +1,37 @@ +expression_space: './expression_space.yaml' +holdout_pools: [ + "{{ROOT}}/data/ansr-data/v7.3/skeleton_pool_val/", + "{{ROOT}}/data/ansr-data/test_set/soose_nc/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/feynman/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/nguyen/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/pool_15/skeleton_pool/" +] + +sample_strategy: + n_operator_distribution: "length_proportional" + min_operators: 0 + max_operators: 10 + power: 1 + max_length: 21 + max_tries: 1 + independent_dimensions: True + +allow_nan: False +simplify: True + +literal_prior: 'uniform' +literal_prior_kwargs: + low: -5 + high: 5 + +support_prior: "uniform_intervals" +support_prior_kwargs: + low: -10 + high: 10 + +n_support_prior: "uniform" +n_support_prior_kwargs: + low: 16 + high: 512 + min_value: 16 + max_value: 512 \ No newline at end of file diff --git a/configs/v7.3/skeleton_pool_val.yaml b/configs/v7.3/skeleton_pool_val.yaml new file mode 100644 index 0000000..29470da --- /dev/null +++ b/configs/v7.3/skeleton_pool_val.yaml @@ -0,0 +1,36 @@ +expression_space: './expression_space.yaml' +holdout_pools: [ + "{{ROOT}}/data/ansr-data/test_set/soose_nc/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/feynman/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/nguyen/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/pool_15/skeleton_pool/" +] + +sample_strategy: + n_operator_distribution: "length_proportional" + min_operators: 0 + max_operators: 10 + power: 1 + max_length: 21 + max_tries: 1 + independent_dimensions: True + +allow_nan: False +simplify: True + +literal_prior: 'uniform' +literal_prior_kwargs: + low: -5 + high: 5 + +support_prior: "uniform_intervals" +support_prior_kwargs: + low: -10 + high: 10 + +n_support_prior: "uniform" +n_support_prior_kwargs: + low: 16 + high: 512 + min_value: 16 + max_value: 512 \ No newline at end of file diff --git a/configs/v7.3/train.yaml b/configs/v7.3/train.yaml new file mode 100644 index 0000000..22f9026 --- /dev/null +++ b/configs/v7.3/train.yaml @@ -0,0 +1,31 @@ +model: ./nsr.yaml + +optimizer: + name: AdamW + kwargs: + lr: 1 # Will be multiplied by scheduler + weight_decay: 0.01 + amsgrad: True + +lr_scheduler: + name: WarmupLinearAnnealing + kwargs: + min_lr: 0 + max_lr: 1e-4 + warmup_steps: 10_000 + total_steps: 1_500_000 + +batch_size_scheduler: + name: Constant + kwargs: + batch_size: 128 + +train_dataset: ./dataset_train.yaml +val_dataset: "./dataset_val.yaml" +val_batch_size: 128 +val_size: 100_000 + +numeric_prediction_loss_weight: 0 + +steps: 1_500_000 +device: cuda \ No newline at end of file diff --git a/configs/v7.4/dataset_train.yaml b/configs/v7.4/dataset_train.yaml new file mode 100644 index 0000000..bb27322 --- /dev/null +++ b/configs/v7.4/dataset_train.yaml @@ -0,0 +1,2 @@ +skeleton_pool: './skeleton_pool_train.yaml' +padding: 'zero' \ No newline at end of file diff --git a/configs/v7.4/dataset_val.yaml b/configs/v7.4/dataset_val.yaml new file mode 100644 index 0000000..c15ed03 --- /dev/null +++ b/configs/v7.4/dataset_val.yaml @@ -0,0 +1,2 @@ +skeleton_pool: './skeleton_pool_val.yaml' +padding: 'zero' \ No newline at end of file diff --git a/configs/v7.4/evaluation.yaml b/configs/v7.4/evaluation.yaml new file mode 100644 index 0000000..d043590 --- /dev/null +++ b/configs/v7.4/evaluation.yaml @@ -0,0 +1,14 @@ +n_support: 512 +beam_width: 32 +n_restarts: 4 +max_len: 32 +refiner_method: 'curve_fit_lm' +numeric_head: False +equivalence_pruning: True +pointwise_close_criterion: 0.95 +pointwise_close_accuracy_rtol: 0.05 +pointwise_close_accuracy_atol: 0.001 +r2_close_criterion: 0.95 +refiner_p0_noise: 'uniform' +refiner_p0_noise_kwargs: {'low': 1, 'high': 5} +device: cuda \ No newline at end of file diff --git a/configs/v7.4/expression_space.yaml b/configs/v7.4/expression_space.yaml new file mode 100644 index 0000000..8b17a96 --- /dev/null +++ b/configs/v7.4/expression_space.yaml @@ -0,0 +1,256 @@ +operators: + "+": + realization: "+" + alias: ["add", "plus"] + inverse: "-" + arity: 2 + weight: 10 + precedence: 1 + commutative: true + symmetry: 0 + positive: false + monotonicity: 0 + "-": + realization: "-" + alias: ["sub", "minus"] + inverse: "+" + arity: 2 + weight: 5 + precedence: 1 + commutative: false + symmetry: 0 + positive: false + monotonicity: 0 + neg: + realization: "nsrops.neg" + alias: ["negative"] + inverse: "neg" + arity: 1 + weight: 5 + precedence: 2.5 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: -1 + "*": + realization: "*" + alias: ["mul", "times"] + inverse: "/" + arity: 2 + weight: 10 + precedence: 2 + commutative: true + symmetry: 0 + positive: false + monotonicity: 0 + "/": + realization: "/" + alias: ["div", "divide"] + inverse: "*" + arity: 2 + weight: 5 + precedence: 2 + commutative: false + symmetry: 0 + positive: false + monotonicity: 0 + abs: + realization: "abs" + alias: ["absolute"] + inverse: null + arity: 1 + weight: 4 + precedence: 3 + commutative: false + symmetry: 1 # symmetric + positive: true + monotonicity: 0 + inv: + realization: "nsrops.inv" + alias: ["inverse"] + inverse: "inv" + arity: 1 + weight: 4 + precedence: 4 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: -1 + pow2: + realization: "nsrops.pow2" + alias: ["square"] + inverse: null + arity: 1 + weight: 4 + precedence: 3 + commutative: false + symmetry: 1 # symmetric + positive: true + monotonicity: 0 + pow3: + realization: "nsrops.pow3" + alias: ["cube"] + inverse: "pow1_3" + arity: 1 + weight: 2 + precedence: 3 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + pow4: + realization: "nsrops.pow4" + alias: [] + inverse: null + arity: 1 + weight: 1 + precedence: 3 + commutative: false + symmetry: 1 + positive: true + monotonicity: 0 + pow5: + realization: "nsrops.pow5" + alias: [] + inverse: "pow1_5" + arity: 1 + weight: 1 + precedence: 3 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + pow1_2: + realization: "nsrops.pow1_2" + alias: ["sqrt"] + inverse: null + arity: 1 + weight: 4 + precedence: 3 + commutative: false + symmetry: 0 + positive: true + monotonicity: 1 + pow1_3: + realization: "nsrops.pow1_3" + alias: [] + inverse: null + arity: 1 + weight: 2 + precedence: 3 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + pow1_4: + realization: "nsrops.pow1_4" + alias: [] + inverse: null + arity: 1 + weight: 1 + precedence: 3 + commutative: false + symmetry: 0 + positive: true + monotonicity: 1 + pow1_5: + realization: "nsrops.pow1_5" + alias: [] + inverse: null + arity: 1 + weight: 1 + precedence: 3 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + sin: + realization: "numpy.sin" + alias: [] + inverse: "asin" + arity: 1 + weight: 4 + precedence: 2 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 0 + cos: + realization: "numpy.cos" + alias: [] + inverse: "acos" + arity: 1 + weight: 4 + precedence: 2 + commutative: false + symmetry: 1 # symmetric + positive: false + monotonicity: 0 + tan: + realization: "numpy.tan" + alias: [] + inverse: "atan" + arity: 1 + weight: 4 + precedence: 2 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 0 + asin: + realization: "numpy.arcsin" + alias: ["arcsin"] + inverse: "sin" + arity: 1 + weight: 2 + precedence: 2 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + acos: + realization: "numpy.arccos" + alias: ["arccos"] + inverse: "cos" + arity: 1 + weight: 2 + precedence: 2 + commutative: false + symmetry: 0 + positive: true + monotonicity: 1 + atan: + realization: "numpy.arctan" + alias: ["arctan"] + inverse: "tan" + arity: 1 + weight: 2 + precedence: 2 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + exp: + realization: "numpy.exp" + alias: [] + inverse: "log" + arity: 1 + weight: 4 + precedence: 3 + commutative: false + symmetry: 0 + positive: true + monotonicity: 1 + log: + realization: "numpy.log" + alias: ["ln"] + inverse: "exp" + arity: 1 + weight: 4 + precedence: 2 + commutative: false + symmetry: 0 + positive: false + monotonicity: 1 + +variables: 3 \ No newline at end of file diff --git a/configs/v7.4/nsr.yaml b/configs/v7.4/nsr.yaml new file mode 100644 index 0000000..8c48ce2 --- /dev/null +++ b/configs/v7.4/nsr.yaml @@ -0,0 +1,25 @@ +encoder_max_n_variables: 4 # includes the dependent variable +size: 512 + +pre_encoder_input_type: "ieee-754" +pre_encoder_support_nan: False + +encoder: "SetTransformer" +encoder_kwargs: + hidden_size: 512 + n_enc_isab: 5 + n_dec_sab: 2 + n_induce: 64 + n_heads: 8 + layer_norm: False + n_seeds: 64 + +decoder_n_heads: 8 +decoder_ff_size: 512 +decoder_dropout: 0.1 +decoder_n_layers: 5 + +learnable_positional_embeddings: false +max_input_length: null + +expression_space: './expression_space.yaml' \ No newline at end of file diff --git a/configs/v7.4/skeleton_pool_train.yaml b/configs/v7.4/skeleton_pool_train.yaml new file mode 100644 index 0000000..5dbc644 --- /dev/null +++ b/configs/v7.4/skeleton_pool_train.yaml @@ -0,0 +1,37 @@ +expression_space: './expression_space.yaml' +holdout_pools: [ + "{{ROOT}}/data/ansr-data/v7.4/skeleton_pool_val/", + "{{ROOT}}/data/ansr-data/test_set/soose_nc/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/feynman/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/nguyen/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/pool_15/skeleton_pool/" +] + +sample_strategy: + n_operator_distribution: "length_proportional" + min_operators: 0 + max_operators: 10 + power: 1 + max_length: 21 + max_tries: 1 + independent_dimensions: True + +allow_nan: False +simplify: True + +literal_prior: 'uniform' +literal_prior_kwargs: + low: 1 + high: 5 + +support_prior: "uniform_intervals" +support_prior_kwargs: + low: -10 + high: 10 + +n_support_prior: "uniform" +n_support_prior_kwargs: + low: 16 + high: 512 + min_value: 16 + max_value: 512 \ No newline at end of file diff --git a/configs/v7.4/skeleton_pool_val.yaml b/configs/v7.4/skeleton_pool_val.yaml new file mode 100644 index 0000000..2a6ad1c --- /dev/null +++ b/configs/v7.4/skeleton_pool_val.yaml @@ -0,0 +1,36 @@ +expression_space: './expression_space.yaml' +holdout_pools: [ + "{{ROOT}}/data/ansr-data/test_set/soose_nc/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/feynman/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/nguyen/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/pool_15/skeleton_pool/" +] + +sample_strategy: + n_operator_distribution: "length_proportional" + min_operators: 0 + max_operators: 10 + power: 1 + max_length: 21 + max_tries: 1 + independent_dimensions: True + +allow_nan: False +simplify: True + +literal_prior: 'uniform' +literal_prior_kwargs: + low: 1 + high: 5 + +support_prior: "uniform_intervals" +support_prior_kwargs: + low: -10 + high: 10 + +n_support_prior: "uniform" +n_support_prior_kwargs: + low: 16 + high: 512 + min_value: 16 + max_value: 512 \ No newline at end of file diff --git a/configs/v7.4/train.yaml b/configs/v7.4/train.yaml new file mode 100644 index 0000000..22f9026 --- /dev/null +++ b/configs/v7.4/train.yaml @@ -0,0 +1,31 @@ +model: ./nsr.yaml + +optimizer: + name: AdamW + kwargs: + lr: 1 # Will be multiplied by scheduler + weight_decay: 0.01 + amsgrad: True + +lr_scheduler: + name: WarmupLinearAnnealing + kwargs: + min_lr: 0 + max_lr: 1e-4 + warmup_steps: 10_000 + total_steps: 1_500_000 + +batch_size_scheduler: + name: Constant + kwargs: + batch_size: 128 + +train_dataset: ./dataset_train.yaml +val_dataset: "./dataset_val.yaml" +val_batch_size: 128 +val_size: 100_000 + +numeric_prediction_loss_weight: 0 + +steps: 1_500_000 +device: cuda \ No newline at end of file diff --git a/configs/v7.5/dataset_train.yaml b/configs/v7.5/dataset_train.yaml new file mode 100644 index 0000000..bb27322 --- /dev/null +++ b/configs/v7.5/dataset_train.yaml @@ -0,0 +1,2 @@ +skeleton_pool: './skeleton_pool_train.yaml' +padding: 'zero' \ No newline at end of file diff --git a/configs/v7.5/dataset_val.yaml b/configs/v7.5/dataset_val.yaml new file mode 100644 index 0000000..c15ed03 --- /dev/null +++ b/configs/v7.5/dataset_val.yaml @@ -0,0 +1,2 @@ +skeleton_pool: './skeleton_pool_val.yaml' +padding: 'zero' \ No newline at end of file diff --git a/configs/v7.5/evaluation.yaml b/configs/v7.5/evaluation.yaml new file mode 100644 index 0000000..6bf5f03 --- /dev/null +++ b/configs/v7.5/evaluation.yaml @@ -0,0 +1,14 @@ +n_support: 512 +beam_width: 32 +n_restarts: 8 +max_len: 32 +refiner_method: 'curve_fit_lm' +numeric_head: False +equivalence_pruning: False +pointwise_close_criterion: 0.95 +pointwise_close_accuracy_rtol: 0.05 +pointwise_close_accuracy_atol: 0.001 +r2_close_criterion: 0.95 +refiner_p0_noise: 'uniform' +refiner_p0_noise_kwargs: {'low': -5, 'high': 5} +device: cuda \ No newline at end of file diff --git a/configs/v7.5/expression_space.yaml b/configs/v7.5/expression_space.yaml new file mode 100644 index 0000000..8b17a96 --- /dev/null +++ b/configs/v7.5/expression_space.yaml @@ -0,0 +1,256 @@ +operators: + "+": + realization: "+" + alias: ["add", "plus"] + inverse: "-" + arity: 2 + weight: 10 + precedence: 1 + commutative: true + symmetry: 0 + positive: false + monotonicity: 0 + "-": + realization: "-" + alias: ["sub", "minus"] + inverse: "+" + arity: 2 + weight: 5 + precedence: 1 + commutative: false + symmetry: 0 + positive: false + monotonicity: 0 + neg: + realization: "nsrops.neg" + alias: ["negative"] + inverse: "neg" + arity: 1 + weight: 5 + precedence: 2.5 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: -1 + "*": + realization: "*" + alias: ["mul", "times"] + inverse: "/" + arity: 2 + weight: 10 + precedence: 2 + commutative: true + symmetry: 0 + positive: false + monotonicity: 0 + "/": + realization: "/" + alias: ["div", "divide"] + inverse: "*" + arity: 2 + weight: 5 + precedence: 2 + commutative: false + symmetry: 0 + positive: false + monotonicity: 0 + abs: + realization: "abs" + alias: ["absolute"] + inverse: null + arity: 1 + weight: 4 + precedence: 3 + commutative: false + symmetry: 1 # symmetric + positive: true + monotonicity: 0 + inv: + realization: "nsrops.inv" + alias: ["inverse"] + inverse: "inv" + arity: 1 + weight: 4 + precedence: 4 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: -1 + pow2: + realization: "nsrops.pow2" + alias: ["square"] + inverse: null + arity: 1 + weight: 4 + precedence: 3 + commutative: false + symmetry: 1 # symmetric + positive: true + monotonicity: 0 + pow3: + realization: "nsrops.pow3" + alias: ["cube"] + inverse: "pow1_3" + arity: 1 + weight: 2 + precedence: 3 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + pow4: + realization: "nsrops.pow4" + alias: [] + inverse: null + arity: 1 + weight: 1 + precedence: 3 + commutative: false + symmetry: 1 + positive: true + monotonicity: 0 + pow5: + realization: "nsrops.pow5" + alias: [] + inverse: "pow1_5" + arity: 1 + weight: 1 + precedence: 3 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + pow1_2: + realization: "nsrops.pow1_2" + alias: ["sqrt"] + inverse: null + arity: 1 + weight: 4 + precedence: 3 + commutative: false + symmetry: 0 + positive: true + monotonicity: 1 + pow1_3: + realization: "nsrops.pow1_3" + alias: [] + inverse: null + arity: 1 + weight: 2 + precedence: 3 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + pow1_4: + realization: "nsrops.pow1_4" + alias: [] + inverse: null + arity: 1 + weight: 1 + precedence: 3 + commutative: false + symmetry: 0 + positive: true + monotonicity: 1 + pow1_5: + realization: "nsrops.pow1_5" + alias: [] + inverse: null + arity: 1 + weight: 1 + precedence: 3 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + sin: + realization: "numpy.sin" + alias: [] + inverse: "asin" + arity: 1 + weight: 4 + precedence: 2 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 0 + cos: + realization: "numpy.cos" + alias: [] + inverse: "acos" + arity: 1 + weight: 4 + precedence: 2 + commutative: false + symmetry: 1 # symmetric + positive: false + monotonicity: 0 + tan: + realization: "numpy.tan" + alias: [] + inverse: "atan" + arity: 1 + weight: 4 + precedence: 2 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 0 + asin: + realization: "numpy.arcsin" + alias: ["arcsin"] + inverse: "sin" + arity: 1 + weight: 2 + precedence: 2 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + acos: + realization: "numpy.arccos" + alias: ["arccos"] + inverse: "cos" + arity: 1 + weight: 2 + precedence: 2 + commutative: false + symmetry: 0 + positive: true + monotonicity: 1 + atan: + realization: "numpy.arctan" + alias: ["arctan"] + inverse: "tan" + arity: 1 + weight: 2 + precedence: 2 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + exp: + realization: "numpy.exp" + alias: [] + inverse: "log" + arity: 1 + weight: 4 + precedence: 3 + commutative: false + symmetry: 0 + positive: true + monotonicity: 1 + log: + realization: "numpy.log" + alias: ["ln"] + inverse: "exp" + arity: 1 + weight: 4 + precedence: 2 + commutative: false + symmetry: 0 + positive: false + monotonicity: 1 + +variables: 3 \ No newline at end of file diff --git a/configs/v7.5/nsr.yaml b/configs/v7.5/nsr.yaml new file mode 100644 index 0000000..8c48ce2 --- /dev/null +++ b/configs/v7.5/nsr.yaml @@ -0,0 +1,25 @@ +encoder_max_n_variables: 4 # includes the dependent variable +size: 512 + +pre_encoder_input_type: "ieee-754" +pre_encoder_support_nan: False + +encoder: "SetTransformer" +encoder_kwargs: + hidden_size: 512 + n_enc_isab: 5 + n_dec_sab: 2 + n_induce: 64 + n_heads: 8 + layer_norm: False + n_seeds: 64 + +decoder_n_heads: 8 +decoder_ff_size: 512 +decoder_dropout: 0.1 +decoder_n_layers: 5 + +learnable_positional_embeddings: false +max_input_length: null + +expression_space: './expression_space.yaml' \ No newline at end of file diff --git a/configs/v7.5/skeleton_pool_train.yaml b/configs/v7.5/skeleton_pool_train.yaml new file mode 100644 index 0000000..522ac30 --- /dev/null +++ b/configs/v7.5/skeleton_pool_train.yaml @@ -0,0 +1,37 @@ +expression_space: './expression_space.yaml' +holdout_pools: [ + "{{ROOT}}/data/ansr-data/v7.0/skeleton_pool_val/", # Same as v7.0, just different inference + "{{ROOT}}/data/ansr-data/test_set/soose_nc/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/feynman/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/nguyen/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/pool_15/skeleton_pool/" +] + +sample_strategy: + n_operator_distribution: "length_proportional" + min_operators: 0 + max_operators: 10 + power: 1 + max_length: 21 + max_tries: 1 + independent_dimensions: True + +allow_nan: False +simplify: True + +literal_prior: 'uniform' +literal_prior_kwargs: + low: -5 + high: 5 + +support_prior: "uniform_intervals" +support_prior_kwargs: + low: -10 + high: 10 + +n_support_prior: "uniform" +n_support_prior_kwargs: + low: 16 + high: 512 + min_value: 16 + max_value: 512 \ No newline at end of file diff --git a/configs/v7.5/skeleton_pool_val.yaml b/configs/v7.5/skeleton_pool_val.yaml new file mode 100644 index 0000000..29470da --- /dev/null +++ b/configs/v7.5/skeleton_pool_val.yaml @@ -0,0 +1,36 @@ +expression_space: './expression_space.yaml' +holdout_pools: [ + "{{ROOT}}/data/ansr-data/test_set/soose_nc/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/feynman/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/nguyen/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/pool_15/skeleton_pool/" +] + +sample_strategy: + n_operator_distribution: "length_proportional" + min_operators: 0 + max_operators: 10 + power: 1 + max_length: 21 + max_tries: 1 + independent_dimensions: True + +allow_nan: False +simplify: True + +literal_prior: 'uniform' +literal_prior_kwargs: + low: -5 + high: 5 + +support_prior: "uniform_intervals" +support_prior_kwargs: + low: -10 + high: 10 + +n_support_prior: "uniform" +n_support_prior_kwargs: + low: 16 + high: 512 + min_value: 16 + max_value: 512 \ No newline at end of file diff --git a/configs/v7.5/train.yaml b/configs/v7.5/train.yaml new file mode 100644 index 0000000..22f9026 --- /dev/null +++ b/configs/v7.5/train.yaml @@ -0,0 +1,31 @@ +model: ./nsr.yaml + +optimizer: + name: AdamW + kwargs: + lr: 1 # Will be multiplied by scheduler + weight_decay: 0.01 + amsgrad: True + +lr_scheduler: + name: WarmupLinearAnnealing + kwargs: + min_lr: 0 + max_lr: 1e-4 + warmup_steps: 10_000 + total_steps: 1_500_000 + +batch_size_scheduler: + name: Constant + kwargs: + batch_size: 128 + +train_dataset: ./dataset_train.yaml +val_dataset: "./dataset_val.yaml" +val_batch_size: 128 +val_size: 100_000 + +numeric_prediction_loss_weight: 0 + +steps: 1_500_000 +device: cuda \ No newline at end of file diff --git a/configs/v7.6/dataset_train.yaml b/configs/v7.6/dataset_train.yaml new file mode 100644 index 0000000..bb27322 --- /dev/null +++ b/configs/v7.6/dataset_train.yaml @@ -0,0 +1,2 @@ +skeleton_pool: './skeleton_pool_train.yaml' +padding: 'zero' \ No newline at end of file diff --git a/configs/v7.6/dataset_val.yaml b/configs/v7.6/dataset_val.yaml new file mode 100644 index 0000000..c15ed03 --- /dev/null +++ b/configs/v7.6/dataset_val.yaml @@ -0,0 +1,2 @@ +skeleton_pool: './skeleton_pool_val.yaml' +padding: 'zero' \ No newline at end of file diff --git a/configs/v7.6/evaluation.yaml b/configs/v7.6/evaluation.yaml new file mode 100644 index 0000000..98f6576 --- /dev/null +++ b/configs/v7.6/evaluation.yaml @@ -0,0 +1,14 @@ +n_support: 512 +beam_width: 32 +n_restarts: 8 +max_len: 32 +refiner_method: 'curve_fit_lm' +numeric_head: False +equivalence_pruning: True +pointwise_close_criterion: 0.95 +pointwise_close_accuracy_rtol: 0.05 +pointwise_close_accuracy_atol: 0.001 +r2_close_criterion: 0.95 +refiner_p0_noise: 'uniform' +refiner_p0_noise_kwargs: {'low': -5, 'high': 5} +device: cuda \ No newline at end of file diff --git a/configs/v7.6/expression_space.yaml b/configs/v7.6/expression_space.yaml new file mode 100644 index 0000000..8b17a96 --- /dev/null +++ b/configs/v7.6/expression_space.yaml @@ -0,0 +1,256 @@ +operators: + "+": + realization: "+" + alias: ["add", "plus"] + inverse: "-" + arity: 2 + weight: 10 + precedence: 1 + commutative: true + symmetry: 0 + positive: false + monotonicity: 0 + "-": + realization: "-" + alias: ["sub", "minus"] + inverse: "+" + arity: 2 + weight: 5 + precedence: 1 + commutative: false + symmetry: 0 + positive: false + monotonicity: 0 + neg: + realization: "nsrops.neg" + alias: ["negative"] + inverse: "neg" + arity: 1 + weight: 5 + precedence: 2.5 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: -1 + "*": + realization: "*" + alias: ["mul", "times"] + inverse: "/" + arity: 2 + weight: 10 + precedence: 2 + commutative: true + symmetry: 0 + positive: false + monotonicity: 0 + "/": + realization: "/" + alias: ["div", "divide"] + inverse: "*" + arity: 2 + weight: 5 + precedence: 2 + commutative: false + symmetry: 0 + positive: false + monotonicity: 0 + abs: + realization: "abs" + alias: ["absolute"] + inverse: null + arity: 1 + weight: 4 + precedence: 3 + commutative: false + symmetry: 1 # symmetric + positive: true + monotonicity: 0 + inv: + realization: "nsrops.inv" + alias: ["inverse"] + inverse: "inv" + arity: 1 + weight: 4 + precedence: 4 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: -1 + pow2: + realization: "nsrops.pow2" + alias: ["square"] + inverse: null + arity: 1 + weight: 4 + precedence: 3 + commutative: false + symmetry: 1 # symmetric + positive: true + monotonicity: 0 + pow3: + realization: "nsrops.pow3" + alias: ["cube"] + inverse: "pow1_3" + arity: 1 + weight: 2 + precedence: 3 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + pow4: + realization: "nsrops.pow4" + alias: [] + inverse: null + arity: 1 + weight: 1 + precedence: 3 + commutative: false + symmetry: 1 + positive: true + monotonicity: 0 + pow5: + realization: "nsrops.pow5" + alias: [] + inverse: "pow1_5" + arity: 1 + weight: 1 + precedence: 3 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + pow1_2: + realization: "nsrops.pow1_2" + alias: ["sqrt"] + inverse: null + arity: 1 + weight: 4 + precedence: 3 + commutative: false + symmetry: 0 + positive: true + monotonicity: 1 + pow1_3: + realization: "nsrops.pow1_3" + alias: [] + inverse: null + arity: 1 + weight: 2 + precedence: 3 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + pow1_4: + realization: "nsrops.pow1_4" + alias: [] + inverse: null + arity: 1 + weight: 1 + precedence: 3 + commutative: false + symmetry: 0 + positive: true + monotonicity: 1 + pow1_5: + realization: "nsrops.pow1_5" + alias: [] + inverse: null + arity: 1 + weight: 1 + precedence: 3 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + sin: + realization: "numpy.sin" + alias: [] + inverse: "asin" + arity: 1 + weight: 4 + precedence: 2 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 0 + cos: + realization: "numpy.cos" + alias: [] + inverse: "acos" + arity: 1 + weight: 4 + precedence: 2 + commutative: false + symmetry: 1 # symmetric + positive: false + monotonicity: 0 + tan: + realization: "numpy.tan" + alias: [] + inverse: "atan" + arity: 1 + weight: 4 + precedence: 2 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 0 + asin: + realization: "numpy.arcsin" + alias: ["arcsin"] + inverse: "sin" + arity: 1 + weight: 2 + precedence: 2 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + acos: + realization: "numpy.arccos" + alias: ["arccos"] + inverse: "cos" + arity: 1 + weight: 2 + precedence: 2 + commutative: false + symmetry: 0 + positive: true + monotonicity: 1 + atan: + realization: "numpy.arctan" + alias: ["arctan"] + inverse: "tan" + arity: 1 + weight: 2 + precedence: 2 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + exp: + realization: "numpy.exp" + alias: [] + inverse: "log" + arity: 1 + weight: 4 + precedence: 3 + commutative: false + symmetry: 0 + positive: true + monotonicity: 1 + log: + realization: "numpy.log" + alias: ["ln"] + inverse: "exp" + arity: 1 + weight: 4 + precedence: 2 + commutative: false + symmetry: 0 + positive: false + monotonicity: 1 + +variables: 3 \ No newline at end of file diff --git a/configs/v7.6/nsr.yaml b/configs/v7.6/nsr.yaml new file mode 100644 index 0000000..8c48ce2 --- /dev/null +++ b/configs/v7.6/nsr.yaml @@ -0,0 +1,25 @@ +encoder_max_n_variables: 4 # includes the dependent variable +size: 512 + +pre_encoder_input_type: "ieee-754" +pre_encoder_support_nan: False + +encoder: "SetTransformer" +encoder_kwargs: + hidden_size: 512 + n_enc_isab: 5 + n_dec_sab: 2 + n_induce: 64 + n_heads: 8 + layer_norm: False + n_seeds: 64 + +decoder_n_heads: 8 +decoder_ff_size: 512 +decoder_dropout: 0.1 +decoder_n_layers: 5 + +learnable_positional_embeddings: false +max_input_length: null + +expression_space: './expression_space.yaml' \ No newline at end of file diff --git a/configs/v7.6/skeleton_pool_train.yaml b/configs/v7.6/skeleton_pool_train.yaml new file mode 100644 index 0000000..6b515b2 --- /dev/null +++ b/configs/v7.6/skeleton_pool_train.yaml @@ -0,0 +1,37 @@ +expression_space: './expression_space.yaml' +holdout_pools: [ + "{{ROOT}}/data/ansr-data/v7.6/skeleton_pool_val/", + "{{ROOT}}/data/ansr-data/test_set/soose_nc/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/feynman/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/nguyen/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/pool_15/skeleton_pool/" +] + +sample_strategy: + n_operator_distribution: "length_proportional" + min_operators: 0 + max_operators: 10 + power: 0 + max_length: 21 + max_tries: 1 + independent_dimensions: True + +allow_nan: False +simplify: True + +literal_prior: 'uniform' +literal_prior_kwargs: + low: -5 + high: 5 + +support_prior: "uniform_intervals" +support_prior_kwargs: + low: -10 + high: 10 + +n_support_prior: "uniform" +n_support_prior_kwargs: + low: 16 + high: 512 + min_value: 16 + max_value: 512 \ No newline at end of file diff --git a/configs/v7.6/skeleton_pool_val.yaml b/configs/v7.6/skeleton_pool_val.yaml new file mode 100644 index 0000000..d608a8e --- /dev/null +++ b/configs/v7.6/skeleton_pool_val.yaml @@ -0,0 +1,36 @@ +expression_space: './expression_space.yaml' +holdout_pools: [ + "{{ROOT}}/data/ansr-data/test_set/soose_nc/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/feynman/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/nguyen/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/pool_15/skeleton_pool/" +] + +sample_strategy: + n_operator_distribution: "length_proportional" + min_operators: 0 + max_operators: 10 + power: 0 + max_length: 21 + max_tries: 1 + independent_dimensions: True + +allow_nan: False +simplify: True + +literal_prior: 'uniform' +literal_prior_kwargs: + low: -5 + high: 5 + +support_prior: "uniform_intervals" +support_prior_kwargs: + low: -10 + high: 10 + +n_support_prior: "uniform" +n_support_prior_kwargs: + low: 16 + high: 512 + min_value: 16 + max_value: 512 \ No newline at end of file diff --git a/configs/v7.6/train.yaml b/configs/v7.6/train.yaml new file mode 100644 index 0000000..22f9026 --- /dev/null +++ b/configs/v7.6/train.yaml @@ -0,0 +1,31 @@ +model: ./nsr.yaml + +optimizer: + name: AdamW + kwargs: + lr: 1 # Will be multiplied by scheduler + weight_decay: 0.01 + amsgrad: True + +lr_scheduler: + name: WarmupLinearAnnealing + kwargs: + min_lr: 0 + max_lr: 1e-4 + warmup_steps: 10_000 + total_steps: 1_500_000 + +batch_size_scheduler: + name: Constant + kwargs: + batch_size: 128 + +train_dataset: ./dataset_train.yaml +val_dataset: "./dataset_val.yaml" +val_batch_size: 128 +val_size: 100_000 + +numeric_prediction_loss_weight: 0 + +steps: 1_500_000 +device: cuda \ No newline at end of file diff --git a/configs/v7.7/dataset_train.yaml b/configs/v7.7/dataset_train.yaml new file mode 100644 index 0000000..bb27322 --- /dev/null +++ b/configs/v7.7/dataset_train.yaml @@ -0,0 +1,2 @@ +skeleton_pool: './skeleton_pool_train.yaml' +padding: 'zero' \ No newline at end of file diff --git a/configs/v7.7/dataset_val.yaml b/configs/v7.7/dataset_val.yaml new file mode 100644 index 0000000..c15ed03 --- /dev/null +++ b/configs/v7.7/dataset_val.yaml @@ -0,0 +1,2 @@ +skeleton_pool: './skeleton_pool_val.yaml' +padding: 'zero' \ No newline at end of file diff --git a/configs/v7.7/evaluation.yaml b/configs/v7.7/evaluation.yaml new file mode 100644 index 0000000..446275c --- /dev/null +++ b/configs/v7.7/evaluation.yaml @@ -0,0 +1,14 @@ +n_support: 512 +beam_width: 32 +n_restarts: 8 +max_len: 32 +refiner_method: 'minimize_bfgs' +numeric_head: False +equivalence_pruning: True +pointwise_close_criterion: 0.95 +pointwise_close_accuracy_rtol: 0.05 +pointwise_close_accuracy_atol: 0.001 +r2_close_criterion: 0.95 +refiner_p0_noise: 'uniform' +refiner_p0_noise_kwargs: {'low': -5, 'high': 5} +device: cuda \ No newline at end of file diff --git a/configs/v7.7/expression_space.yaml b/configs/v7.7/expression_space.yaml new file mode 100644 index 0000000..8b17a96 --- /dev/null +++ b/configs/v7.7/expression_space.yaml @@ -0,0 +1,256 @@ +operators: + "+": + realization: "+" + alias: ["add", "plus"] + inverse: "-" + arity: 2 + weight: 10 + precedence: 1 + commutative: true + symmetry: 0 + positive: false + monotonicity: 0 + "-": + realization: "-" + alias: ["sub", "minus"] + inverse: "+" + arity: 2 + weight: 5 + precedence: 1 + commutative: false + symmetry: 0 + positive: false + monotonicity: 0 + neg: + realization: "nsrops.neg" + alias: ["negative"] + inverse: "neg" + arity: 1 + weight: 5 + precedence: 2.5 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: -1 + "*": + realization: "*" + alias: ["mul", "times"] + inverse: "/" + arity: 2 + weight: 10 + precedence: 2 + commutative: true + symmetry: 0 + positive: false + monotonicity: 0 + "/": + realization: "/" + alias: ["div", "divide"] + inverse: "*" + arity: 2 + weight: 5 + precedence: 2 + commutative: false + symmetry: 0 + positive: false + monotonicity: 0 + abs: + realization: "abs" + alias: ["absolute"] + inverse: null + arity: 1 + weight: 4 + precedence: 3 + commutative: false + symmetry: 1 # symmetric + positive: true + monotonicity: 0 + inv: + realization: "nsrops.inv" + alias: ["inverse"] + inverse: "inv" + arity: 1 + weight: 4 + precedence: 4 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: -1 + pow2: + realization: "nsrops.pow2" + alias: ["square"] + inverse: null + arity: 1 + weight: 4 + precedence: 3 + commutative: false + symmetry: 1 # symmetric + positive: true + monotonicity: 0 + pow3: + realization: "nsrops.pow3" + alias: ["cube"] + inverse: "pow1_3" + arity: 1 + weight: 2 + precedence: 3 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + pow4: + realization: "nsrops.pow4" + alias: [] + inverse: null + arity: 1 + weight: 1 + precedence: 3 + commutative: false + symmetry: 1 + positive: true + monotonicity: 0 + pow5: + realization: "nsrops.pow5" + alias: [] + inverse: "pow1_5" + arity: 1 + weight: 1 + precedence: 3 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + pow1_2: + realization: "nsrops.pow1_2" + alias: ["sqrt"] + inverse: null + arity: 1 + weight: 4 + precedence: 3 + commutative: false + symmetry: 0 + positive: true + monotonicity: 1 + pow1_3: + realization: "nsrops.pow1_3" + alias: [] + inverse: null + arity: 1 + weight: 2 + precedence: 3 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + pow1_4: + realization: "nsrops.pow1_4" + alias: [] + inverse: null + arity: 1 + weight: 1 + precedence: 3 + commutative: false + symmetry: 0 + positive: true + monotonicity: 1 + pow1_5: + realization: "nsrops.pow1_5" + alias: [] + inverse: null + arity: 1 + weight: 1 + precedence: 3 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + sin: + realization: "numpy.sin" + alias: [] + inverse: "asin" + arity: 1 + weight: 4 + precedence: 2 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 0 + cos: + realization: "numpy.cos" + alias: [] + inverse: "acos" + arity: 1 + weight: 4 + precedence: 2 + commutative: false + symmetry: 1 # symmetric + positive: false + monotonicity: 0 + tan: + realization: "numpy.tan" + alias: [] + inverse: "atan" + arity: 1 + weight: 4 + precedence: 2 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 0 + asin: + realization: "numpy.arcsin" + alias: ["arcsin"] + inverse: "sin" + arity: 1 + weight: 2 + precedence: 2 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + acos: + realization: "numpy.arccos" + alias: ["arccos"] + inverse: "cos" + arity: 1 + weight: 2 + precedence: 2 + commutative: false + symmetry: 0 + positive: true + monotonicity: 1 + atan: + realization: "numpy.arctan" + alias: ["arctan"] + inverse: "tan" + arity: 1 + weight: 2 + precedence: 2 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + exp: + realization: "numpy.exp" + alias: [] + inverse: "log" + arity: 1 + weight: 4 + precedence: 3 + commutative: false + symmetry: 0 + positive: true + monotonicity: 1 + log: + realization: "numpy.log" + alias: ["ln"] + inverse: "exp" + arity: 1 + weight: 4 + precedence: 2 + commutative: false + symmetry: 0 + positive: false + monotonicity: 1 + +variables: 3 \ No newline at end of file diff --git a/configs/v7.7/nsr.yaml b/configs/v7.7/nsr.yaml new file mode 100644 index 0000000..8c48ce2 --- /dev/null +++ b/configs/v7.7/nsr.yaml @@ -0,0 +1,25 @@ +encoder_max_n_variables: 4 # includes the dependent variable +size: 512 + +pre_encoder_input_type: "ieee-754" +pre_encoder_support_nan: False + +encoder: "SetTransformer" +encoder_kwargs: + hidden_size: 512 + n_enc_isab: 5 + n_dec_sab: 2 + n_induce: 64 + n_heads: 8 + layer_norm: False + n_seeds: 64 + +decoder_n_heads: 8 +decoder_ff_size: 512 +decoder_dropout: 0.1 +decoder_n_layers: 5 + +learnable_positional_embeddings: false +max_input_length: null + +expression_space: './expression_space.yaml' \ No newline at end of file diff --git a/configs/v7.7/skeleton_pool_train.yaml b/configs/v7.7/skeleton_pool_train.yaml new file mode 100644 index 0000000..0d066d4 --- /dev/null +++ b/configs/v7.7/skeleton_pool_train.yaml @@ -0,0 +1,37 @@ +expression_space: './expression_space.yaml' +holdout_pools: [ + "{{ROOT}}/data/ansr-data/v7.0/skeleton_pool_val/", # Same as v7.0, just different inference + "{{ROOT}}/data/ansr-data/test_set/soose_nc/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/feynman/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/nguyen/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/pool_15/skeleton_pool/" +] + +sample_strategy: + n_operator_distribution: "length_proportional" + min_operators: 0 + max_operators: 10 + power: 0 + max_length: 21 + max_tries: 1 + independent_dimensions: True + +allow_nan: False +simplify: True + +literal_prior: 'uniform' +literal_prior_kwargs: + low: -5 + high: 5 + +support_prior: "uniform_intervals" +support_prior_kwargs: + low: -10 + high: 10 + +n_support_prior: "uniform" +n_support_prior_kwargs: + low: 16 + high: 512 + min_value: 16 + max_value: 512 \ No newline at end of file diff --git a/configs/v7.7/skeleton_pool_val.yaml b/configs/v7.7/skeleton_pool_val.yaml new file mode 100644 index 0000000..d608a8e --- /dev/null +++ b/configs/v7.7/skeleton_pool_val.yaml @@ -0,0 +1,36 @@ +expression_space: './expression_space.yaml' +holdout_pools: [ + "{{ROOT}}/data/ansr-data/test_set/soose_nc/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/feynman/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/nguyen/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/pool_15/skeleton_pool/" +] + +sample_strategy: + n_operator_distribution: "length_proportional" + min_operators: 0 + max_operators: 10 + power: 0 + max_length: 21 + max_tries: 1 + independent_dimensions: True + +allow_nan: False +simplify: True + +literal_prior: 'uniform' +literal_prior_kwargs: + low: -5 + high: 5 + +support_prior: "uniform_intervals" +support_prior_kwargs: + low: -10 + high: 10 + +n_support_prior: "uniform" +n_support_prior_kwargs: + low: 16 + high: 512 + min_value: 16 + max_value: 512 \ No newline at end of file diff --git a/configs/v7.7/train.yaml b/configs/v7.7/train.yaml new file mode 100644 index 0000000..22f9026 --- /dev/null +++ b/configs/v7.7/train.yaml @@ -0,0 +1,31 @@ +model: ./nsr.yaml + +optimizer: + name: AdamW + kwargs: + lr: 1 # Will be multiplied by scheduler + weight_decay: 0.01 + amsgrad: True + +lr_scheduler: + name: WarmupLinearAnnealing + kwargs: + min_lr: 0 + max_lr: 1e-4 + warmup_steps: 10_000 + total_steps: 1_500_000 + +batch_size_scheduler: + name: Constant + kwargs: + batch_size: 128 + +train_dataset: ./dataset_train.yaml +val_dataset: "./dataset_val.yaml" +val_batch_size: 128 +val_size: 100_000 + +numeric_prediction_loss_weight: 0 + +steps: 1_500_000 +device: cuda \ No newline at end of file diff --git a/configs/v7.8/dataset_train.yaml b/configs/v7.8/dataset_train.yaml new file mode 100644 index 0000000..bb27322 --- /dev/null +++ b/configs/v7.8/dataset_train.yaml @@ -0,0 +1,2 @@ +skeleton_pool: './skeleton_pool_train.yaml' +padding: 'zero' \ No newline at end of file diff --git a/configs/v7.8/dataset_val.yaml b/configs/v7.8/dataset_val.yaml new file mode 100644 index 0000000..c15ed03 --- /dev/null +++ b/configs/v7.8/dataset_val.yaml @@ -0,0 +1,2 @@ +skeleton_pool: './skeleton_pool_val.yaml' +padding: 'zero' \ No newline at end of file diff --git a/configs/v7.8/evaluation.yaml b/configs/v7.8/evaluation.yaml new file mode 100644 index 0000000..98f6576 --- /dev/null +++ b/configs/v7.8/evaluation.yaml @@ -0,0 +1,14 @@ +n_support: 512 +beam_width: 32 +n_restarts: 8 +max_len: 32 +refiner_method: 'curve_fit_lm' +numeric_head: False +equivalence_pruning: True +pointwise_close_criterion: 0.95 +pointwise_close_accuracy_rtol: 0.05 +pointwise_close_accuracy_atol: 0.001 +r2_close_criterion: 0.95 +refiner_p0_noise: 'uniform' +refiner_p0_noise_kwargs: {'low': -5, 'high': 5} +device: cuda \ No newline at end of file diff --git a/configs/v7.8/expression_space.yaml b/configs/v7.8/expression_space.yaml new file mode 100644 index 0000000..e38c1d3 --- /dev/null +++ b/configs/v7.8/expression_space.yaml @@ -0,0 +1,445 @@ +operators: + "+": + realization: "+" + alias: ["add", "plus"] + inverse: "-" + arity: 2 + weight: 10 + precedence: 1 + commutative: true + symmetry: 0 + positive: false + monotonicity: 0 + "-": + realization: "-" + alias: ["sub", "minus"] + inverse: "+" + arity: 2 + weight: 5 + precedence: 1 + commutative: false + symmetry: 0 + positive: false + monotonicity: 0 + neg: + realization: "nsrops.neg" + alias: ["negative"] + inverse: "neg" + arity: 1 + weight: 5 + precedence: 2.5 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: -1 + "*": + realization: "*" + alias: ["mul", "times"] + inverse: "/" + arity: 2 + weight: 10 + precedence: 2 + commutative: true + symmetry: 0 + positive: false + monotonicity: 0 + "/": + realization: "/" + alias: ["div", "divide"] + inverse: "*" + arity: 2 + weight: 5 + precedence: 2 + commutative: false + symmetry: 0 + positive: false + monotonicity: 0 + abs: + realization: "abs" + alias: ["absolute"] + inverse: null + arity: 1 + weight: 4 + precedence: 3 + commutative: false + symmetry: 1 # symmetric + positive: true + monotonicity: 0 + inv: + realization: "nsrops.inv" + alias: ["inverse"] + inverse: "inv" + arity: 1 + weight: 4 + precedence: 4 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: -1 + pow2: + realization: "nsrops.pow2" + alias: ["square"] + inverse: null + arity: 1 + weight: 4 + precedence: 3 + commutative: false + symmetry: 1 # symmetric + positive: true + monotonicity: 0 + pow3: + realization: "nsrops.pow3" + alias: ["cube"] + inverse: "pow1_3" + arity: 1 + weight: 2 + precedence: 3 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + pow4: + realization: "nsrops.pow4" + alias: [] + inverse: null + arity: 1 + weight: 1 + precedence: 3 + commutative: false + symmetry: 1 + positive: true + monotonicity: 0 + pow5: + realization: "nsrops.pow5" + alias: [] + inverse: "pow1_5" + arity: 1 + weight: 1 + precedence: 3 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + pow1_2: + realization: "nsrops.pow1_2" + alias: ["sqrt"] + inverse: null + arity: 1 + weight: 4 + precedence: 3 + commutative: false + symmetry: 0 + positive: true + monotonicity: 1 + pow1_3: + realization: "nsrops.pow1_3" + alias: [] + inverse: null + arity: 1 + weight: 2 + precedence: 3 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + pow1_4: + realization: "nsrops.pow1_4" + alias: [] + inverse: null + arity: 1 + weight: 1 + precedence: 3 + commutative: false + symmetry: 0 + positive: true + monotonicity: 1 + pow1_5: + realization: "nsrops.pow1_5" + alias: [] + inverse: null + arity: 1 + weight: 1 + precedence: 3 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + sin: + realization: "numpy.sin" + alias: [] + inverse: "asin" + arity: 1 + weight: 4 + precedence: 2 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 0 + cos: + realization: "numpy.cos" + alias: [] + inverse: "acos" + arity: 1 + weight: 4 + precedence: 2 + commutative: false + symmetry: 1 # symmetric + positive: false + monotonicity: 0 + tan: + realization: "numpy.tan" + alias: [] + inverse: "atan" + arity: 1 + weight: 4 + precedence: 2 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 0 + asin: + realization: "numpy.arcsin" + alias: ["arcsin"] + inverse: "sin" + arity: 1 + weight: 2 + precedence: 2 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + acos: + realization: "numpy.arccos" + alias: ["arccos"] + inverse: "cos" + arity: 1 + weight: 2 + precedence: 2 + commutative: false + symmetry: 0 + positive: true + monotonicity: 1 + atan: + realization: "numpy.arctan" + alias: ["arctan"] + inverse: "tan" + arity: 1 + weight: 2 + precedence: 2 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + atan2: + realization: "numpy.arctan2" + alias: ["arctan2"] + inverse: null + arity: 2 + weight: 2 + precedence: 2 + commutative: false + symmetry: 0 + positive: false + monotonicity: 0 + exp: + realization: "numpy.exp" + alias: [] + inverse: "log" + arity: 1 + weight: 4 + precedence: 3 + commutative: false + symmetry: 0 + positive: true + monotonicity: + log: + realization: "numpy.log" + alias: ["ln"] + inverse: "exp" + arity: 1 + weight: 4 + precedence: 2 + commutative: false + symmetry: 0 + positive: false + monotonicity: 1 + sinh: + realization: "numpy.sinh" + alias: [] + inverse: "asinh" + arity: 1 + weight: 2 + precedence: 2 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + cosh: + realization: "numpy.cosh" + alias: [] + inverse: null + arity: 1 + weight: 2 + precedence: 2 + commutative: false + symmetry: 1 # symmetric + positive: true + monotonicity: 0 + tanh: + realization: "numpy.tanh" + alias: [] + inverse: "atanh" + arity: 1 + weight: 2 + precedence: 2 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + asinh: + realization: "numpy.arcsinh" + alias: [] + inverse: "sinh" + arity: 1 + weight: 2 + precedence: 2 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + acosh: + realization: "numpy.arccosh" + alias: [] + inverse: null + arity: 1 + weight: 2 + precedence: 2 + commutative: false + symmetry: 1 # symmetric + positive: true + monotonicity: 1 + atanh: + realization: "numpy.arctanh" + alias: [] + inverse: "tanh" + arity: 1 + weight: 2 + precedence: 2 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + t2: # chebyshev t2 + realization: "nsrops.t2" + alias: [] + inverse: null + arity: 1 + weight: 1 + precedence: 3 + commutative: false + symmetry: 1 + positive: false + monotonicity: 0 + t3: # chebyshev T3 + realization: "nsrops.t3" + alias: [] + inverse: null + arity: 1 + weight: 1 + precedence: 3 + commutative: false + symmetry: -1 + positive: false + monotonicity: 0 + t4: # chebyshev t4 + realization: "nsrops.t4" + alias: [] + inverse: null + arity: 1 + weight: 1 + precedence: 3 + commutative: false + symmetry: 1 + positive: false + monotonicity: 0 + t5: # chebyshev t5 + realization: "nsrops.t5" + alias: [] + inverse: null + arity: 1 + weight: 1 + precedence: 3 + commutative: false + symmetry: -1 + positive: false + monotonicity: 0 + j0: # bessel J0 + realization: "scipy.special.j0" + alias: [] + inverse: null + arity: 1 + weight: 1 + precedence: 3 + commutative: false + symmetry: 1 + positive: false + monotonicity: 0 + j1: # bessel j1 + realization: "scipy.special.j1" + alias: [] + inverse: null + arity: 1 + weight: 1 + precedence: 3 + commutative: false + symmetry: -1 + positive: false + monotonicity: 0 + j2: # bessel j2 + realization: "nsrops.j2" + alias: [] + inverse: null + arity: 1 + weight: 1 + precedence: 3 + commutative: false + symmetry: 1 + positive: false + monotonicity: 0 + y0: # bessel y0 + realization: "scipy.special.y0" + alias: [] + inverse: null + arity: 1 + weight: 1 + precedence: 3 + commutative: false + symmetry: 0 + positive: false + monotonicity: 0 + y1: # bessel y1 + realization: "scipy.special.y1" + alias: [] + inverse: null + arity: 1 + weight: 1 + precedence: 3 + commutative: false + symmetry: 0 + positive: false + monotonicity: 0 + y2: # bessel y2 + realization: "nsrops.y2" + alias: [] + inverse: null + arity: 1 + weight: 1 + precedence: 3 + commutative: false + symmetry: 0 + positive: false + monotonicity: 0 + + + +variables: 3 \ No newline at end of file diff --git a/configs/v7.8/nsr.yaml b/configs/v7.8/nsr.yaml new file mode 100644 index 0000000..8c48ce2 --- /dev/null +++ b/configs/v7.8/nsr.yaml @@ -0,0 +1,25 @@ +encoder_max_n_variables: 4 # includes the dependent variable +size: 512 + +pre_encoder_input_type: "ieee-754" +pre_encoder_support_nan: False + +encoder: "SetTransformer" +encoder_kwargs: + hidden_size: 512 + n_enc_isab: 5 + n_dec_sab: 2 + n_induce: 64 + n_heads: 8 + layer_norm: False + n_seeds: 64 + +decoder_n_heads: 8 +decoder_ff_size: 512 +decoder_dropout: 0.1 +decoder_n_layers: 5 + +learnable_positional_embeddings: false +max_input_length: null + +expression_space: './expression_space.yaml' \ No newline at end of file diff --git a/configs/v7.8/skeleton_pool_train.yaml b/configs/v7.8/skeleton_pool_train.yaml new file mode 100644 index 0000000..c7cf21b --- /dev/null +++ b/configs/v7.8/skeleton_pool_train.yaml @@ -0,0 +1,37 @@ +expression_space: './expression_space.yaml' +holdout_pools: [ + "{{ROOT}}/data/ansr-data/v7.8/skeleton_pool_val/", + "{{ROOT}}/data/ansr-data/test_set/soose_nc/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/feynman/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/nguyen/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/pool_15/skeleton_pool/" +] + +sample_strategy: + n_operator_distribution: "length_proportional" + min_operators: 0 + max_operators: 10 + power: 1 + max_length: 21 + max_tries: 1 + independent_dimensions: True + +allow_nan: False +simplify: True + +literal_prior: 'uniform' +literal_prior_kwargs: + low: -5 + high: 5 + +support_prior: "uniform_intervals" +support_prior_kwargs: + low: -10 + high: 10 + +n_support_prior: "uniform" +n_support_prior_kwargs: + low: 16 + high: 512 + min_value: 16 + max_value: 512 \ No newline at end of file diff --git a/configs/v7.8/skeleton_pool_val.yaml b/configs/v7.8/skeleton_pool_val.yaml new file mode 100644 index 0000000..29470da --- /dev/null +++ b/configs/v7.8/skeleton_pool_val.yaml @@ -0,0 +1,36 @@ +expression_space: './expression_space.yaml' +holdout_pools: [ + "{{ROOT}}/data/ansr-data/test_set/soose_nc/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/feynman/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/nguyen/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/pool_15/skeleton_pool/" +] + +sample_strategy: + n_operator_distribution: "length_proportional" + min_operators: 0 + max_operators: 10 + power: 1 + max_length: 21 + max_tries: 1 + independent_dimensions: True + +allow_nan: False +simplify: True + +literal_prior: 'uniform' +literal_prior_kwargs: + low: -5 + high: 5 + +support_prior: "uniform_intervals" +support_prior_kwargs: + low: -10 + high: 10 + +n_support_prior: "uniform" +n_support_prior_kwargs: + low: 16 + high: 512 + min_value: 16 + max_value: 512 \ No newline at end of file diff --git a/configs/v7.8/train.yaml b/configs/v7.8/train.yaml new file mode 100644 index 0000000..22f9026 --- /dev/null +++ b/configs/v7.8/train.yaml @@ -0,0 +1,31 @@ +model: ./nsr.yaml + +optimizer: + name: AdamW + kwargs: + lr: 1 # Will be multiplied by scheduler + weight_decay: 0.01 + amsgrad: True + +lr_scheduler: + name: WarmupLinearAnnealing + kwargs: + min_lr: 0 + max_lr: 1e-4 + warmup_steps: 10_000 + total_steps: 1_500_000 + +batch_size_scheduler: + name: Constant + kwargs: + batch_size: 128 + +train_dataset: ./dataset_train.yaml +val_dataset: "./dataset_val.yaml" +val_batch_size: 128 +val_size: 100_000 + +numeric_prediction_loss_weight: 0 + +steps: 1_500_000 +device: cuda \ No newline at end of file diff --git a/configs/v7.9/dataset_train.yaml b/configs/v7.9/dataset_train.yaml new file mode 100644 index 0000000..bb27322 --- /dev/null +++ b/configs/v7.9/dataset_train.yaml @@ -0,0 +1,2 @@ +skeleton_pool: './skeleton_pool_train.yaml' +padding: 'zero' \ No newline at end of file diff --git a/configs/v7.9/dataset_val.yaml b/configs/v7.9/dataset_val.yaml new file mode 100644 index 0000000..c15ed03 --- /dev/null +++ b/configs/v7.9/dataset_val.yaml @@ -0,0 +1,2 @@ +skeleton_pool: './skeleton_pool_val.yaml' +padding: 'zero' \ No newline at end of file diff --git a/configs/v7.9/evaluation.yaml b/configs/v7.9/evaluation.yaml new file mode 100644 index 0000000..98f6576 --- /dev/null +++ b/configs/v7.9/evaluation.yaml @@ -0,0 +1,14 @@ +n_support: 512 +beam_width: 32 +n_restarts: 8 +max_len: 32 +refiner_method: 'curve_fit_lm' +numeric_head: False +equivalence_pruning: True +pointwise_close_criterion: 0.95 +pointwise_close_accuracy_rtol: 0.05 +pointwise_close_accuracy_atol: 0.001 +r2_close_criterion: 0.95 +refiner_p0_noise: 'uniform' +refiner_p0_noise_kwargs: {'low': -5, 'high': 5} +device: cuda \ No newline at end of file diff --git a/configs/v7.9/expression_space.yaml b/configs/v7.9/expression_space.yaml new file mode 100644 index 0000000..1381040 --- /dev/null +++ b/configs/v7.9/expression_space.yaml @@ -0,0 +1,258 @@ +operators: + "+": + realization: "+" + alias: ["add", "plus"] + inverse: "-" + arity: 2 + weight: 10 + precedence: 1 + commutative: true + symmetry: 0 + positive: false + monotonicity: 0 + "-": + realization: "-" + alias: ["sub", "minus"] + inverse: "+" + arity: 2 + weight: 5 + precedence: 1 + commutative: false + symmetry: 0 + positive: false + monotonicity: 0 + neg: + realization: "nsrops.neg" + alias: ["negative"] + inverse: "neg" + arity: 1 + weight: 5 + precedence: 2.5 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: -1 + "*": + realization: "*" + alias: ["mul", "times"] + inverse: "/" + arity: 2 + weight: 10 + precedence: 2 + commutative: true + symmetry: 0 + positive: false + monotonicity: 0 + "/": + realization: "/" + alias: ["div", "divide"] + inverse: "*" + arity: 2 + weight: 5 + precedence: 2 + commutative: false + symmetry: 0 + positive: false + monotonicity: 0 + abs: + realization: "abs" + alias: ["absolute"] + inverse: null + arity: 1 + weight: 4 + precedence: 3 + commutative: false + symmetry: 1 # symmetric + positive: true + monotonicity: 0 + inv: + realization: "nsrops.inv" + alias: ["inverse"] + inverse: "inv" + arity: 1 + weight: 4 + precedence: 4 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: -1 + pow2: + realization: "nsrops.pow2" + alias: ["square"] + inverse: null + arity: 1 + weight: 4 + precedence: 3 + commutative: false + symmetry: 1 # symmetric + positive: true + monotonicity: 0 + pow3: + realization: "nsrops.pow3" + alias: ["cube"] + inverse: "pow1_3" + arity: 1 + weight: 2 + precedence: 3 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + pow4: + realization: "nsrops.pow4" + alias: [] + inverse: null + arity: 1 + weight: 1 + precedence: 3 + commutative: false + symmetry: 1 + positive: true + monotonicity: 0 + pow5: + realization: "nsrops.pow5" + alias: [] + inverse: "pow1_5" + arity: 1 + weight: 1 + precedence: 3 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + pow1_2: + realization: "nsrops.pow1_2" + alias: ["sqrt"] + inverse: null + arity: 1 + weight: 4 + precedence: 3 + commutative: false + symmetry: 0 + positive: true + monotonicity: 1 + pow1_3: + realization: "nsrops.pow1_3" + alias: [] + inverse: null + arity: 1 + weight: 2 + precedence: 3 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + pow1_4: + realization: "nsrops.pow1_4" + alias: [] + inverse: null + arity: 1 + weight: 1 + precedence: 3 + commutative: false + symmetry: 0 + positive: true + monotonicity: 1 + pow1_5: + realization: "nsrops.pow1_5" + alias: [] + inverse: null + arity: 1 + weight: 1 + precedence: 3 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + sin: + realization: "numpy.sin" + alias: [] + inverse: "asin" + arity: 1 + weight: 4 + precedence: 2 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 0 + cos: + realization: "numpy.cos" + alias: [] + inverse: "acos" + arity: 1 + weight: 4 + precedence: 2 + commutative: false + symmetry: 1 # symmetric + positive: false + monotonicity: 0 + tan: + realization: "numpy.tan" + alias: [] + inverse: "atan" + arity: 1 + weight: 4 + precedence: 2 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 0 + asin: + realization: "numpy.arcsin" + alias: ["arcsin"] + inverse: "sin" + arity: 1 + weight: 2 + precedence: 2 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + acos: + realization: "numpy.arccos" + alias: ["arccos"] + inverse: "cos" + arity: 1 + weight: 2 + precedence: 2 + commutative: false + symmetry: 0 + positive: true + monotonicity: 1 + atan: + realization: "numpy.arctan" + alias: ["arctan"] + inverse: "tan" + arity: 1 + weight: 2 + precedence: 2 + commutative: false + symmetry: -1 # anti-symmetric + positive: false + monotonicity: 1 + exp: + realization: "numpy.exp" + alias: [] + inverse: "log" + arity: 1 + weight: 4 + precedence: 3 + commutative: false + symmetry: 0 + positive: true + monotonicity: 1 + log: + realization: "numpy.log" + alias: ["ln"] + inverse: "exp" + arity: 1 + weight: 4 + precedence: 2 + commutative: false + symmetry: 0 + positive: false + monotonicity: 1 + +variables: 3 + +simplification: "sympy" \ No newline at end of file diff --git a/configs/v7.9/nsr.yaml b/configs/v7.9/nsr.yaml new file mode 100644 index 0000000..8c48ce2 --- /dev/null +++ b/configs/v7.9/nsr.yaml @@ -0,0 +1,25 @@ +encoder_max_n_variables: 4 # includes the dependent variable +size: 512 + +pre_encoder_input_type: "ieee-754" +pre_encoder_support_nan: False + +encoder: "SetTransformer" +encoder_kwargs: + hidden_size: 512 + n_enc_isab: 5 + n_dec_sab: 2 + n_induce: 64 + n_heads: 8 + layer_norm: False + n_seeds: 64 + +decoder_n_heads: 8 +decoder_ff_size: 512 +decoder_dropout: 0.1 +decoder_n_layers: 5 + +learnable_positional_embeddings: false +max_input_length: null + +expression_space: './expression_space.yaml' \ No newline at end of file diff --git a/configs/v7.9/skeleton_pool_train.yaml b/configs/v7.9/skeleton_pool_train.yaml new file mode 100644 index 0000000..bf6f864 --- /dev/null +++ b/configs/v7.9/skeleton_pool_train.yaml @@ -0,0 +1,37 @@ +expression_space: './expression_space.yaml' +holdout_pools: [ + "{{ROOT}}/data/ansr-data/v7.9/skeleton_pool_val/", + "{{ROOT}}/data/ansr-data/test_set/soose_nc/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/feynman/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/nguyen/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/pool_15/skeleton_pool/" +] + +sample_strategy: + n_operator_distribution: "length_proportional" + min_operators: 0 + max_operators: 10 + power: 1 + max_length: 21 + max_tries: 1 + independent_dimensions: True + +allow_nan: False +simplify: True + +literal_prior: 'uniform' +literal_prior_kwargs: + low: -5 + high: 5 + +support_prior: "uniform_intervals" +support_prior_kwargs: + low: -10 + high: 10 + +n_support_prior: "uniform" +n_support_prior_kwargs: + low: 16 + high: 512 + min_value: 16 + max_value: 512 \ No newline at end of file diff --git a/configs/v7.9/skeleton_pool_val.yaml b/configs/v7.9/skeleton_pool_val.yaml new file mode 100644 index 0000000..29470da --- /dev/null +++ b/configs/v7.9/skeleton_pool_val.yaml @@ -0,0 +1,36 @@ +expression_space: './expression_space.yaml' +holdout_pools: [ + "{{ROOT}}/data/ansr-data/test_set/soose_nc/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/feynman/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/nguyen/skeleton_pool/", + "{{ROOT}}/data/ansr-data/test_set/pool_15/skeleton_pool/" +] + +sample_strategy: + n_operator_distribution: "length_proportional" + min_operators: 0 + max_operators: 10 + power: 1 + max_length: 21 + max_tries: 1 + independent_dimensions: True + +allow_nan: False +simplify: True + +literal_prior: 'uniform' +literal_prior_kwargs: + low: -5 + high: 5 + +support_prior: "uniform_intervals" +support_prior_kwargs: + low: -10 + high: 10 + +n_support_prior: "uniform" +n_support_prior_kwargs: + low: 16 + high: 512 + min_value: 16 + max_value: 512 \ No newline at end of file diff --git a/configs/v7.9/train.yaml b/configs/v7.9/train.yaml new file mode 100644 index 0000000..22f9026 --- /dev/null +++ b/configs/v7.9/train.yaml @@ -0,0 +1,31 @@ +model: ./nsr.yaml + +optimizer: + name: AdamW + kwargs: + lr: 1 # Will be multiplied by scheduler + weight_decay: 0.01 + amsgrad: True + +lr_scheduler: + name: WarmupLinearAnnealing + kwargs: + min_lr: 0 + max_lr: 1e-4 + warmup_steps: 10_000 + total_steps: 1_500_000 + +batch_size_scheduler: + name: Constant + kwargs: + batch_size: 128 + +train_dataset: ./dataset_train.yaml +val_dataset: "./dataset_val.yaml" +val_batch_size: 128 +val_size: 100_000 + +numeric_prediction_loss_weight: 0 + +steps: 1_500_000 +device: cuda \ No newline at end of file