Author: Jiawei Zhang
(Released: July 8, 2024; latest Revision: July 8, 2024.)
In this example, we will build a 3-layer RPN model with nested_expansion, lorr_reconciliation and zero_remainder
functions to approximate the composite_function dataset formula C.3 with the following formula:
$$
f(x, y) = \exp(x + y) + \ln(x + y),
$$
where \(x, y \in (0, 1)\).
The settings and configurations are very similar to those of the previous elementary function approximation example.
Below, we will directly provide the script code (which is also identical to that used in the previous example)
and the detailed configuration file.
# three-layer rpn for composite function approximationconfigurations:device:cpurandom_seed:4567data_configs:data_class:tinybig.data.composite_functiondata_parameters:name:elementary_functiontrain_batch_size:100test_batch_size:100equation_index:3learner_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:[2,1]layer_configs:-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.nested_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.zero_remainderremainder_parameters:name:zero_remainderrequire_parameters:Falseenable_bias:False-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.nested_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.zero_remainderremainder_parameters:name:zero_remainderrequire_parameters:Falseenable_bias:Falsemetric_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