Recreating our NumPy model in Rust
Now that we can use our NumPy module in Rust, we need to explore how to structure it so that we can use Python modules to solve bigger problems. We will do this by building a NumPy model with a Python interface. To achieve this, we can break down the processes into functions that can be used as and when we need them. The structure of our NumPy model can be seen here:
Considering the flow of our model structure in the preceding diagram, we can build our NumPy model in Rust with the following steps:
- Build
get_weight_matrix
andinverse_weight_matrix
functions. - Build
get_parameters
,get_times
, andget_input_vector
functions. - Build
calculate_parameters
andcalculate_times
functions. - Add calculate functions to the Python bindings and add a NumPy dependency to our
setup.py
file. - Build our Python interface.
We can see that each step has dependencies...