In [1]:
import numpy as np
import tensorflow as tf
from Erwin.models.tf_utils import initializers
In [2]:
shape = (3, 4)
init = initializers.get('glorot_normal_initializer')(shape)
with tf.variable_scope('layer1'):
weights = tf.get_variable('weights', shape, initializer=init)
In [4]:
sess = tf.InteractiveSession()
init = tf.global_variables_initializer()
sess.run(init)
In [5]:
weights_numpy = weights.eval()
In [6]:
weights_numpy
Out[6]:
In [25]:
from tensorflow.python.ops import init_ops
In [32]:
init = init_ops.glorot_uniform_initializer()
In [36]:
with tf.variable_scope('layer3'):
weights = tf.get_variable('weights', shape, initializer=init)
weights.initializer.run()
print(weights.eval())
In [37]:
weights.eval()
Out[37]:
$ output[b, x[0], ..., x[N-1], k] = sum_{z[0], ..., z[N-1], q} filter[z[0], ..., z[N-1], q, k] * padded_input[b, x[0]*strides[0] + dilation_rate[0]*z[0], ..., x[N-1]*strides[N-1] + dilation_rate[N-1]*z[N-1], q] $
In [38]:
from Erwin.datasets.featurizers import graph_featurizer
In [40]:
smiles = '[Cd+2]'
graph = graph_featurizer.graph_from_mol(smiles)
In [ ]: