Example #1
0
def test_Gather_pickle():
    tg = TensorGraph()
    feature = Feature(shape=(tg.batch_size, 1))
    layer = Gather(indices=[[0], [2], [3]], in_layers=feature)
    tg.add_output(layer)
    tg.set_loss(layer)
    tg.build()
    tg.save()
Example #2
0
def test_Repeat_pickle():
    tg = TensorGraph()
    feature = Feature(shape=(tg.batch_size, 1))
    layer = Repeat(n_times=10, in_layers=feature)
    tg.add_output(layer)
    tg.set_loss(layer)
    tg.build()
    tg.save()
Example #3
0
def test_Cast_pickle():
    tg = TensorGraph()
    feature = Feature(shape=(tg.batch_size, 1))
    layer = Cast(in_layers=feature, dtype=tf.int32)
    tg.add_output(layer)
    tg.set_loss(layer)
    tg.build()
    tg.save()
Example #4
0
def test_GRU_pickle():
    tg = TensorGraph()
    feature = Feature(shape=(tg.batch_size, 10, 10))
    layer = GRU(n_hidden=10, batch_size=tg.batch_size, in_layers=feature)
    tg.add_output(layer)
    tg.set_loss(layer)
    tg.build()
    tg.save()
Example #5
0
def test_DTNNEmbedding_pickle():
    tg = TensorGraph()
    atom_numbers = Feature(shape=(None, 23), dtype=tf.int32)
    Embedding = DTNNEmbedding(in_layers=[atom_numbers])
    tg.add_output(Embedding)
    tg.set_loss(Embedding)
    tg.build()
    tg.save()
Example #6
0
def test_BatchNorm_pickle():
    tg = TensorGraph()
    feature = Feature(shape=(tg.batch_size, 10))
    layer = BatchNorm(in_layers=feature)
    tg.add_output(layer)
    tg.set_loss(layer)
    tg.build()
    tg.save()
Example #7
0
def test_SoftmaxCrossEntropy_pickle():
    tg = TensorGraph()
    feature = Feature(shape=(tg.batch_size, 1))
    layer = SoftMaxCrossEntropy(in_layers=[feature, feature])
    tg.add_output(layer)
    tg.set_loss(layer)
    tg.build()
    tg.save()
Example #8
0
def test_Reshape_pickle():
    tg = TensorGraph()
    feature = Feature(shape=(tg.batch_size, 1))
    layer = Reshape(shape=(None, 2), in_layers=feature)
    tg.add_output(layer)
    tg.set_loss(layer)
    tg.build()
    tg.save()
Example #9
0
def test_ReduceSquareDifference_pickle():
    tg = TensorGraph()
    feature = Feature(shape=(tg.batch_size, 1))
    layer = ReduceSquareDifference(in_layers=[feature, feature])
    tg.add_output(layer)
    tg.set_loss(layer)
    tg.build()
    tg.save()
Example #10
0
def test_ToFloat_pickle():
    tg = TensorGraph()
    feature = Feature(shape=(tg.batch_size, 1))
    layer = ToFloat(in_layers=[feature])
    tg.add_output(layer)
    tg.set_loss(layer)
    tg.build()
    tg.save()
Example #11
0
def test_Dense_pickle():
    tg = TensorGraph()
    feature = Feature(shape=(tg.batch_size, 1))
    dense = Dense(out_channels=1, in_layers=feature)
    tg.add_output(dense)
    tg.set_loss(dense)
    tg.build()
    tg.save()
Example #12
0
def test_Conv3DTranspose_pickle():
    tg = TensorGraph()
    feature = Feature(shape=(tg.batch_size, 10, 10, 10, 1))
    layer = Conv3DTranspose(num_outputs=3, in_layers=feature)
    tg.add_output(layer)
    tg.set_loss(layer)
    tg.build()
    tg.save()
Example #13
0
def test_Slice_pickle():
    V = Feature(shape=(None, 10))
    out = Slice(5, 1, in_layers=[V])
    tg = TensorGraph()
    tg.add_output(out)
    tg.set_loss(out)
    tg.build()
    tg.save()
Example #14
0
def test_CombineMeanStd_pickle():
    tg = TensorGraph()
    feature = Feature(shape=(tg.batch_size, 1))
    layer = CombineMeanStd(in_layers=[feature, feature])
    tg.add_output(layer)
    tg.set_loss(layer)
    tg.build()
    tg.save()
Example #15
0
def test_Exp_pickle():
    tg = TensorGraph()
    feature = Feature(shape=(tg.batch_size, 1))
    layer = Exp(feature)
    tg.add_output(layer)
    tg.set_loss(layer)
    tg.build()
    tg.save()
Example #16
0
def test_Transpose_pickle():
    tg = TensorGraph()
    feature = Feature(shape=(tg.batch_size, 1))
    layer = Transpose(perm=(1, 0), in_layers=feature)
    tg.add_output(layer)
    tg.set_loss(layer)
    tg.build()
    tg.save()
Example #17
0
def test_StopGradient_pickle():
    tg = TensorGraph()
    feature = Feature(shape=(tg.batch_size, 1))
    output = StopGradient(feature)
    tg.add_output(output)
    tg.set_loss(output)
    tg.build()
    tg.save()
Example #18
0
def test_DTNNExtract_pickle():
    tg = TensorGraph()
    atom_features = Feature(shape=(None, 30))
    Ext = DTNNExtract(0, in_layers=[atom_features])
    tg.add_output(Ext)
    tg.set_loss(Ext)
    tg.build()
    tg.save()
Example #19
0
def test_Conv1D_pickle():
    tg = TensorGraph()
    feature = Feature(shape=(tg.batch_size, 1, 1))
    conv = Conv1D(2, 1, in_layers=feature)
    tg.add_output(conv)
    tg.set_loss(conv)
    tg.build()
    tg.save()
Example #20
0
def test_WeightedError_pickle():
    tg = TensorGraph()
    feature = Feature(shape=(tg.batch_size, 10))
    layer = WeightedError(in_layers=[feature, feature])
    tg.add_output(layer)
    tg.set_loss(layer)
    tg.build()
    tg.save()
Example #21
0
def test_Softmax_pickle():
    tg = TensorGraph()
    feature = Feature(shape=(tg.batch_size, 1))
    layer = SoftMax(in_layers=feature)
    tg.add_output(layer)
    tg.set_loss(layer)
    tg.build()
    tg.save()
Example #22
0
def test_Squeeze_pickle():
    tg = TensorGraph()
    feature = Feature(shape=(tg.batch_size, 1))
    layer = Squeeze(squeeze_dims=-1, in_layers=feature)
    tg.add_output(layer)
    tg.set_loss(layer)
    tg.build()
    tg.save()
Example #23
0
def test_hingeloss_pickle():
  tg = TensorGraph()
  feature = Feature(shape=(1, None))
  layer = HingeLoss(in_layers=[feature, feature])
  tg.add_output(layer)
  tg.set_loss(layer)
  tg.build()
  tg.save()
Example #24
0
def testGraphCNNPoolLayer_pickle():
  V = Feature(shape=(None, 200, 50))
  A = Feature(shape=(None, 200, 1, 200))
  gcnnpool = GraphEmbedPoolLayer(32, in_layers=[V, A])
  tg = TensorGraph()
  tg.add_output(gcnnpool)
  tg.set_loss(gcnnpool)
  tg.build()
  tg.save()
Example #25
0
def testGraphCNN_pickle():
  V = Feature(shape=(None, 200, 50))
  A = Feature(shape=(None, 200, 1, 200))
  gcnn = GraphCNN(32, in_layers=[V, A])
  tg = TensorGraph()
  tg.add_output(gcnn)
  tg.set_loss(gcnn)
  tg.build()
  tg.save()
Example #26
0
def test_SetGather_pickle():
  tg = TensorGraph()
  atom_feature = Feature(shape=(None, 100))
  atom_split = Feature(shape=(None,), dtype=tf.int32)
  Gather = SetGather(5, 16, in_layers=[atom_feature, atom_split])
  tg.add_output(Gather)
  tg.set_loss(Gather)
  tg.build()
  tg.save()
Example #27
0
def test_DAGGather_pickle():
  tg = TensorGraph()
  atom_features = Feature(shape=(None, 30))
  membership = Feature(shape=(None,), dtype=tf.int32)
  Gather = DAGGather(in_layers=[atom_features, membership])
  tg.add_output(Gather)
  tg.set_loss(Gather)
  tg.build()
  tg.save()
Example #28
0
def test_SparseSoftmaxCrossEntropy_pickle():
    tg = TensorGraph()
    logits = Feature(shape=(tg.batch_size, 5))
    labels = Feature(shape=(tg.batch_size, ), dtype=tf.int32)
    layer = SparseSoftMaxCrossEntropy(in_layers=[labels, logits])
    tg.add_output(layer)
    tg.set_loss(layer)
    tg.build()
    tg.save()
Example #29
0
def test_Constant_pickle():
  tg = TensorGraph()
  feature = Feature(shape=(tg.batch_size, 1))
  layer = Constant(np.array([15.0]))
  output = Add(in_layers=[feature, layer])
  tg.add_output(output)
  tg.set_loss(output)
  tg.build()
  tg.save()
Example #30
0
def test_Variable_pickle():
  tg = TensorGraph()
  feature = Feature(shape=(tg.batch_size, 1))
  layer = Variable(np.array([15.0]))
  output = Multiply(in_layers=[feature, layer])
  tg.add_output(output)
  tg.set_loss(output)
  tg.build()
  tg.save()
Example #31
0
def test_ReduceSquareDifference_pickle():
  tg = TensorGraph()
  feature = Feature(shape=(tg.batch_size, 1))
  layer = ReduceSquareDifference(in_layers=[feature, feature])
  tg.add_output(layer)
  tg.set_loss(layer)
  tg.build()
  tg.save()
Example #32
0
def test_Conv3DTranspose_pickle():
  tg = TensorGraph()
  feature = Feature(shape=(tg.batch_size, 10, 10, 10, 1))
  layer = Conv3DTranspose(num_outputs=3, in_layers=feature)
  tg.add_output(layer)
  tg.set_loss(layer)
  tg.build()
  tg.save()
Example #33
0
def test_BatchNorm_pickle():
  tg = TensorGraph()
  feature = Feature(shape=(tg.batch_size, 10))
  layer = BatchNorm(in_layers=feature)
  tg.add_output(layer)
  tg.set_loss(layer)
  tg.build()
  tg.save()
Example #34
0
def test_WeightedError_pickle():
  tg = TensorGraph()
  feature = Feature(shape=(tg.batch_size, 10))
  layer = WeightedError(in_layers=[feature, feature])
  tg.add_output(layer)
  tg.set_loss(layer)
  tg.build()
  tg.save()
Example #35
0
def test_Reshape_pickle():
  tg = TensorGraph()
  feature = Feature(shape=(tg.batch_size, 1))
  layer = Reshape(shape=(None, 2), in_layers=feature)
  tg.add_output(layer)
  tg.set_loss(layer)
  tg.build()
  tg.save()
Example #36
0
def test_Exp_pickle():
  tg = TensorGraph()
  feature = Feature(shape=(tg.batch_size, 1))
  layer = Exp(feature)
  tg.add_output(layer)
  tg.set_loss(layer)
  tg.build()
  tg.save()
Example #37
0
def test_Repeat_pickle():
  tg = TensorGraph()
  feature = Feature(shape=(tg.batch_size, 1))
  layer = Repeat(n_times=10, in_layers=feature)
  tg.add_output(layer)
  tg.set_loss(layer)
  tg.build()
  tg.save()
Example #38
0
def test_CombineMeanStd_pickle():
  tg = TensorGraph()
  feature = Feature(shape=(tg.batch_size, 1))
  layer = CombineMeanStd(in_layers=[feature, feature])
  tg.add_output(layer)
  tg.set_loss(layer)
  tg.build()
  tg.save()
Example #39
0
def test_Squeeze_pickle():
  tg = TensorGraph()
  feature = Feature(shape=(tg.batch_size, 1))
  layer = Squeeze(in_layers=feature)
  tg.add_output(layer)
  tg.set_loss(layer)
  tg.build()
  tg.save()
Example #40
0
def test_hingeloss_pickle():
  tg = TensorGraph()
  feature = Feature(shape=(1, None))
  layer = HingeLoss(in_layers=[feature, feature])
  tg.add_output(layer)
  tg.set_loss(layer)
  tg.build()
  tg.save()
Example #41
0
def test_Slice_pickle():
  V = Feature(shape=(None, 10))
  out = Slice(5, 1, in_layers=[V])
  tg = TensorGraph()
  tg.add_output(out)
  tg.set_loss(out)
  tg.build()
  tg.save()
Example #42
0
def test_Cast_pickle():
  tg = TensorGraph()
  feature = Feature(shape=(tg.batch_size, 1))
  layer = Cast(in_layers=feature, dtype=tf.int32)
  tg.add_output(layer)
  tg.set_loss(layer)
  tg.build()
  tg.save()
Example #43
0
def test_SigmoidCrossEntropy_pickle():
  tg = TensorGraph()
  feature = Feature(shape=(tg.batch_size, 1))
  layer = SigmoidCrossEntropy(in_layers=[feature, feature])
  tg.add_output(layer)
  tg.set_loss(layer)
  tg.build()
  tg.save()
Example #44
0
def test_DTNNExtract_pickle():
  tg = TensorGraph()
  atom_features = Feature(shape=(None, 30))
  Ext = DTNNExtract(0, in_layers=[atom_features])
  tg.add_output(Ext)
  tg.set_loss(Ext)
  tg.build()
  tg.save()
Example #45
0
def test_Dense_pickle():
  tg = TensorGraph()
  feature = Feature(shape=(tg.batch_size, 1))
  dense = Dense(out_channels=1, in_layers=feature)
  tg.add_output(dense)
  tg.set_loss(dense)
  tg.build()
  tg.save()
Example #46
0
def test_DTNNEmbedding_pickle():
  tg = TensorGraph()
  atom_numbers = Feature(shape=(None, 23), dtype=tf.int32)
  Embedding = DTNNEmbedding(in_layers=[atom_numbers])
  tg.add_output(Embedding)
  tg.set_loss(Embedding)
  tg.build()
  tg.save()
Example #47
0
def test_StopGradient_pickle():
  tg = TensorGraph()
  feature = Feature(shape=(tg.batch_size, 1))
  output = StopGradient(feature)
  tg.add_output(output)
  tg.set_loss(output)
  tg.build()
  tg.save()
Example #48
0
def test_ToFloat_pickle():
  tg = TensorGraph()
  feature = Feature(shape=(tg.batch_size, 1))
  layer = ToFloat(in_layers=[feature])
  tg.add_output(layer)
  tg.set_loss(layer)
  tg.build()
  tg.save()
Example #49
0
def test_Transpose_pickle():
  tg = TensorGraph()
  feature = Feature(shape=(tg.batch_size, 1))
  layer = Transpose(perm=(1, 0), in_layers=feature)
  tg.add_output(layer)
  tg.set_loss(layer)
  tg.build()
  tg.save()
Example #50
0
def test_Gather_pickle():
  tg = TensorGraph()
  feature = Feature(shape=(tg.batch_size, 1))
  layer = Gather(indices=[[0], [2], [3]], in_layers=feature)
  tg.add_output(layer)
  tg.set_loss(layer)
  tg.build()
  tg.save()
Example #51
0
def test_LSTM_pickle():
  tg = TensorGraph()
  feature = Feature(shape=(tg.batch_size, 10, 10))
  layer = LSTM(n_hidden=10, batch_size=tg.batch_size, in_layers=feature)
  tg.add_output(layer)
  tg.set_loss(layer)
  tg.build()
  tg.save()
Example #52
0
def test_Conv1D_pickle():
  tg = TensorGraph()
  feature = Feature(shape=(tg.batch_size, 1, 1))
  conv = Conv1D(2, 1, in_layers=feature)
  tg.add_output(conv)
  tg.set_loss(conv)
  tg.build()
  tg.save()
Example #53
0
def test_SetGather_pickle():
  tg = TensorGraph()
  atom_feature = Feature(shape=(None, 100))
  atom_split = Feature(shape=(None,), dtype=tf.int32)
  Gather = SetGather(5, 16, in_layers=[atom_feature, atom_split])
  tg.add_output(Gather)
  tg.set_loss(Gather)
  tg.build()
  tg.save()
Example #54
0
def testGraphCNNPoolLayer_pickle():
  V = Feature(shape=(None, 200, 50))
  A = Feature(shape=(None, 200, 1, 200))
  gcnnpool = GraphEmbedPoolLayer(32, in_layers=[V, A])
  tg = TensorGraph()
  tg.add_output(gcnnpool)
  tg.set_loss(gcnnpool)
  tg.build()
  tg.save()
Example #55
0
def test_DAGGather_pickle():
  tg = TensorGraph()
  atom_features = Feature(shape=(None, 30))
  membership = Feature(shape=(None,), dtype=tf.int32)
  Gather = DAGGather(in_layers=[atom_features, membership])
  tg.add_output(Gather)
  tg.set_loss(Gather)
  tg.build()
  tg.save()
Example #56
0
def testGraphCNN_pickle():
  V = Feature(shape=(None, 200, 50))
  A = Feature(shape=(None, 200, 1, 200))
  gcnn = GraphCNN(32, in_layers=[V, A])
  tg = TensorGraph()
  tg.add_output(gcnn)
  tg.set_loss(gcnn)
  tg.build()
  tg.save()
Example #57
0
def test_SparseSoftmaxCrossEntropy_pickle():
  tg = TensorGraph()
  logits = Feature(shape=(tg.batch_size, 5))
  labels = Feature(shape=(tg.batch_size,), dtype=tf.int32)
  layer = SparseSoftMaxCrossEntropy(in_layers=[labels, logits])
  tg.add_output(layer)
  tg.set_loss(layer)
  tg.build()
  tg.save()
Example #58
0
def test_Variable_pickle():
  tg = TensorGraph()
  feature = Feature(shape=(tg.batch_size, 1))
  layer = Variable(np.array([15.0]))
  output = Multiply(in_layers=[feature, layer])
  tg.add_output(output)
  tg.set_loss(output)
  tg.build()
  tg.save()
Example #59
0
def test_Constant_pickle():
  tg = TensorGraph()
  feature = Feature(shape=(tg.batch_size, 1))
  layer = Constant(np.array([15.0]))
  output = Add(in_layers=[feature, layer])
  tg.add_output(output)
  tg.set_loss(output)
  tg.build()
  tg.save()
Example #60
0
def test_MP_pickle():
  tg = TensorGraph()
  atom_feature = Feature(shape=(None, 75))
  pair_feature = Feature(shape=(None, 14))
  atom_to_pair = Feature(shape=(None, 2), dtype=tf.int32)
  MP = MessagePassing(5, in_layers=[atom_feature, pair_feature, atom_to_pair])
  tg.add_output(MP)
  tg.set_loss(MP)
  tg.build()
  tg.save()