- We'll start by loading libraries and starting a graph session:
import matplotlib.pyplot as plt import tensorflow as tf sess = tf.Session()
- We then declare our constants and variables in the graph:
x_initial = tf.constant(1.0) y_initial = tf.constant(1.0) X_t1 = tf.Variable(x_initial) Y_t1 = tf.Variable(y_initial) # Make the placeholders t_delta = tf.placeholder(tf.float32, shape=()) a = tf.placeholder(tf.float32, shape=()) b = tf.placeholder(tf.float32, shape=()) c = tf.placeholder(tf.float32, shape=()) d = tf.placeholder(tf.float32, shape=())
- Next, we will implement the prior introduced discrete system, and then update the X and Y populations:
X_t2 = X_t1 + (a * X_t1 + b * X_t1 * Y_t1) * t_delta Y_t2 = Y_t1 + (c * ...