Author: Jiawei Zhang
(Released: July 8, 2024; latest Revision: July 8, 2024.)
In this example, we will build a 3-layer RPN model with extended_expansion, lorr_reconciliation and linear_remainder
functions to approximate the feynman_function dataset with formula ID I.9.18 (or with numerical equation_index 4).
This formula describes Newton's law of universal gravitation with \(9\) arguments inputs, it is illustrated as follows:
$$
f(G, m_1, m_2, x_1, y_1, z_1, x_2, y_2, z_2) = \frac{G \cdot m_1 \cdot m_2}{(x_2 - x_1)^2+(y_2 - y_1)^2+(z_2 - z_1)^2},
$$
where \(G, m_1, m_2, x_2, y_2, z_2 \in [1, 2]\) and \(x_1, y_1, z_1 \in [3, 4]\).
# three-layer rpn for Newton's law of universal gravitation function approximationconfigurations:device:cpurandom_seed:4567data_configs:data_class:tinybig.data.feynman_functiondata_parameters:name:elementary_functiontrain_batch_size:100test_batch_size:100equation_index:4learner_configs:learner_class:tinybig.learner.backward_learnerlearner_parameters:name:error_backward_propagationn_epochs:2000optimizer_configs:optimizer_class:torch.optim.AdamWoptimizer_parameters:lr:3.0e-03weight_decay:1.0e-04lr_scheduler_configs:lr_scheduler_class:torch.optim.lr_scheduler.ExponentialLRlr_scheduler_parameters:gamma:0.999loss_configs:loss_class:torch.nn.MSELossloss_parameters:reduction:meanmodel_configs:model_class:tinybig.model.rpnmodel_parameters:name:reconciled_polynomial_networkdepth:3depth_alloc:[1,1,1]layer_configs:-layer_class:tinybig.module.rpn_layerlayer_parameters:name:rpn_layerm:9n:2width:1width_alloc:[1]fusion_strategy:averagehead_configs:-head_class:tinybig.module.rpn_headhead_parameters:l:nullchannel_num:1data_transformation_configs:data_transformation_class:tinybig.expansion.extended_expansiondata_transformation_parameters:name:extended_expansionexpansion_function_configs:-expansion_class:tinybig.expansion.bspline_expansionexpansion_parameters:name:bspline_expansiont:10d:4-expansion_class:tinybig.expansion.taylor_expansionexpansion_parameters:name:taylor_expansiond:2parameter_fabrication_configs:parameter_fabrication_class:tinybig.reconciliation.lorr_reconciliationparameter_fabrication_parameters:name:lorr_reconciliationr:1remainder_configs:remainder_class:tinybig.remainder.linear_remainderremainder_parameters:name:linear_remainderrequire_parameters:Trueenable_bias:Falseactivation_functions:torch.nn.functional.silu-layer_class:tinybig.module.rpn_layerlayer_parameters:name:rpn_layerm:2n:2width:1width_alloc:[1]fusion_strategy:averagehead_configs:-head_class:tinybig.module.rpn_headhead_parameters:l:nullchannel_num:1data_transformation_configs:data_transformation_class:tinybig.expansion.extended_expansiondata_transformation_parameters:name:extended_expansionexpansion_function_configs:-expansion_class:tinybig.expansion.bspline_expansionexpansion_parameters:name:bspline_expansiont:10d:4-expansion_class:tinybig.expansion.taylor_expansionexpansion_parameters:name:taylor_expansiond:2parameter_fabrication_configs:parameter_fabrication_class:tinybig.reconciliation.lorr_reconciliationparameter_fabrication_parameters:name:lorr_reconciliationr:1remainder_configs:remainder_class:tinybig.remainder.linear_remainderremainder_parameters:name:linear_remainderrequire_parameters:Trueenable_bias:Falseactivation_functions:torch.nn.functional.silu-layer_class:tinybig.module.rpn_layerlayer_parameters:name:rpn_layerm:2n:1width:1width_alloc:[1]fusion_strategy:averagehead_configs:-head_class:tinybig.module.rpn_headhead_parameters:l:nullchannel_num:1data_transformation_configs:data_transformation_class:tinybig.expansion.extended_expansiondata_transformation_parameters:name:extended_expansionexpansion_function_configs:-expansion_class:tinybig.expansion.bspline_expansionexpansion_parameters:name:bspline_expansiont:10d:4-expansion_class:tinybig.expansion.taylor_expansionexpansion_parameters:name:taylor_expansiond:2parameter_fabrication_configs:parameter_fabrication_class:tinybig.reconciliation.lorr_reconciliationparameter_fabrication_parameters:name:lorr_reconciliationr:1remainder_configs:remainder_class:tinybig.remainder.linear_remainderremainder_parameters:name:linear_remainderrequire_parameters:Trueenable_bias:Falseactivation_functions:torch.nn.functional.silumetric_configs:metric_class:tinybig.metric.msemetric_parameters:name:mseresult_configs:result_class:tinybig.output.rpn_outputresult_parameters:name:rpn_output
rpn with nested expansion testing and evaluation outputs