I have a question about how to re-use Bayesian neural networks built with Edward.
I have built and trained a simple Bayesian neural network.
I imagine that I might want to re-use this model for analyses some time in the future. For example, I might want to save the model that I have built today, but re-use it in several months time to make predictions from a new data set that has become available.
I have saved the parameter set as follows:
saver = tf.train.Saver()
I have re-loaded the parameter set in a new python script using the following code:
loader = tf.train.import_meta_graph(fname+’.meta’)
graph = tf.get_default_graph()
x_data = graph.get_tensor_by_name(“x_data:0”)
q_W1_sample = graph.get_tensor_by_name(“q_W1/sample/Reshape:0”)
q_W1 = Normal(loc=graph.get_tensor_by_name(“q_W1/loc:0”),
q_B1_sample = graph.get_tensor_by_name(“q_B1/sample/Reshape:0”)
q_B1 = Normal(loc=graph.get_tensor_by_name(“q_B1/loc:0”),
q_W2_sample = graph.get_tensor_by_name(“q_W2/sample/Reshape:0”)
q_W2 = Normal(loc=graph.get_tensor_by_name(“q_W2/loc:0”),
q_B2_sample = graph.get_tensor_by_name(“q_B2/sample/Reshape:0”)
q_B2 = Normal(loc=graph.get_tensor_by_name(“q_B2/loc:0”),
I am not sure how I proceed from here to use the model for new predictions. Do I need to re-run the inference process with the re-loaded parameters, and will that involve creating a new and distinct model, or can I somehow re-used the saved model to make new predictions?
Many thanks for your assistance.