Added build_network method to construct the model