Need a better way to switch default program
Created by: reyoung
There are multiple program
when we training a neural network using fluid
API. They are:
- The training program(s). There could be many training programs if we training a complex model, like GAN, RL, etc.
- The testing program(s). Testing programs used to evaluate the accuracy or cost on test data set while training. We use an independent program while testing because there are some operators using a different equation when testing, such as
dropout
.
We need a better way to easily switch default program for layers in our API.
This issue will be done in two steps:
- remove
g_main_program
/g_startup_program
. Usedefault_main_program
anddefault_startup_program
instead. - Add API
switch_program
to change default programs.