Example #1
0
def test_simple_recurrent_node_serialization():
    nodes.check_serialization(
        nodes.recurrent.SimpleRecurrentNode("a", nodes.IdentityNode("b")))
    nodes.check_serialization(
        nodes.recurrent.SimpleRecurrentNode("a",
                                            nodes.IdentityNode("b"),
                                            num_units=32,
                                            batch_size=2**7))
Example #2
0
def test_add_bias_node_serialization():
    tn.check_serialization(tn.AddBiasNode("a"))
    tn.check_serialization(tn.AddBiasNode(
        "a",
        inits=[],
        # need to make broadcastable a list because json (de)serialization
        # converts tuples to lists
        broadcastable=[True, False, True]))
Example #3
0
def test_add_bias_node_serialization():
    tn.check_serialization(tn.AddBiasNode("a"))
    tn.check_serialization(
        tn.AddBiasNode(
            "a",
            inits=[],
            # need to make broadcastable a list because json (de)serialization
            # converts tuples to lists
            broadcastable=[True, False, True]))
Example #4
0
def test_hyperparameter_node_serialization():
    tn.check_serialization(
        tn.HyperparameterNode("a",
                              tn.ReferenceNode("b")))
Example #5
0
def test_graph_node_serialization():
    tn.check_serialization(tn.GraphNode("a", [[tn.IdentityNode("b")],
                                              [{"from": "b", "to": "a"}]]))
Example #6
0
def test_aggregator_node_serialization():
    tn.check_serialization(tn.AggregatorNode("a"))
Example #7
0
def test_inverse_node_serialization():
    tn.check_serialization(inverse.InverseNode("a"))
Example #8
0
def test_dense_combine_node_serialization():
    tn.check_serialization(tn.DenseCombineNode("a", []))
    tn.check_serialization(tn.DenseCombineNode("a", [], num_units=100))
Example #9
0
def test_elementwise_cost_node_serialization():
    tn.check_serialization(
        tn.ElementwiseCostNode("foo", {
            "pred": tn.IdentityNode("foo"),
            "target": tn.IdentityNode("bar")
        }))
def test_elementwise_contraction_penalty_node_serialization():
    tn.check_serialization(cp.ElementwiseContractionPenaltyNode("a"))
Example #11
0
def test_to_one_hot_node_serialization():
    tn.check_serialization(tn.ToOneHotNode("a"))
Example #12
0
def test_softmax_node_serialization():
    tn.check_serialization(tn.SoftmaxNode("a"))
Example #13
0
def test_resqrt_node_serialization():
    tn.check_serialization(tn.ReSQRTNode("a"))
Example #14
0
def test_relu_node_serialization():
    tn.check_serialization(tn.ReLUNode("a"))
Example #15
0
def test_split_probabilities_to_leaf_probabilities_node_serialization():
    for node in [dNDF.TheanoSplitProbabilitiesToLeafProbabilitiesNode,
                 dNDF.NumpySplitProbabilitiesToLeafProbabilitiesNode]:
        tn.check_serialization(node("a"))
Example #16
0
def test_sequential_node_serialization():
    tn.check_serialization(tn.SequentialNode("a", []))
    tn.check_serialization(tn.SequentialNode(
        "a",
        [tn.SequentialNode("b", []),
         tn.SequentialNode("c", [])]))
Example #17
0
def test_variable_hyperparameter_node_serialization():
    tn.check_serialization(tn.VariableHyperparameterNode("a",
                                                         tn.IdentityNode("b")))
def test_auxiliary_contraction_penalty_node_serialization():
    tn.check_serialization(cp.AuxiliaryContractionPenaltyNode(
        "a", tn.IdentityNode("b")))
Example #19
0
def test_paired_conv_2d_with_bias_node_serialization():
    tn.check_serialization(paired_conv.PairedConvNode("a", {}))
Example #20
0
def test_spatial_pyramid_pooling_node_serialization():
    tn.check_serialization(spp_net.SpatialPyramidPoolingNode("a"))
def test_dropout_max_pool_2d_node_serialization():
    tn.check_serialization(dmp.DropoutMaxPool2DNode("a"))
Example #22
0
def test_add_axis_node_serialization():
    tn.check_serialization(bf.AddAxisNode("a"))
def test_stochastic_pool_2d_node_serialization():
    tn.check_serialization(stochastic_pooling.StochasticPool2DNode("a"))
Example #24
0
def test_remove_axis_node_serialization():
    tn.check_serialization(bf.RemoveAxisNode("b"))
Example #25
0
def test_auxilliary_cost_node_serialization():
    tn.check_serialization(
        tn.AuxiliaryCostNode("foo", {"target": tn.IdentityNode("bar")}))
Example #26
0
def test_mixed_pool_node_serialization():
    tn.check_serialization(mixed_pooling.MixedPoolNode("a"))
Example #27
0
def test_total_cost_node_serialization():
    tn.check_serialization(tn.TotalCostNode(
        "foo",
        {"pred": tn.IdentityNode("foo"),
         "target": tn.IdentityNode("bar")}))
Example #28
0
def test_linear_mapping_node_serialization():
    tn.check_serialization(tn.LinearMappingNode("a"))
    tn.check_serialization(tn.LinearMappingNode("a", output_dim=3))
Example #29
0
def test_send_to_node_serialization():
    tn.check_serialization(tn.SendToNode("a"))
    tn.check_serialization(tn.SendToNode("a", reference="bar"))
Example #30
0
def test_gaussian_dropout_node_serialization():
    tn.check_serialization(tn.GaussianDropoutNode("a"))
    tn.check_serialization(tn.GaussianDropoutNode("a", p=0))
Example #31
0
def test_gated_pool_2d_node_serialization():
    tn.check_serialization(mixed_pooling.GatedPool2DNode("a"))
Example #32
0
def test_auxiliary_node_serialization():
    tn.check_serialization(tn.AuxiliaryNode("a", tn.IdentityNode("b")))
Example #33
0
def test_apply_node_serialization():
    tn.check_serialization(tn.ApplyNode("a"))
Example #34
0
def test_smorms3_node_serialization():
    tn.check_serialization(smorms3.SMORMS3Node("a"))
Example #35
0
def test_spatial_dropout_node_serialization():
    tn.check_serialization(tn.SpatialDropoutNode("a"))
    tn.check_serialization(tn.SpatialDropoutNode("a", p=0.5))
Example #36
0
def test_wta_sparsity_node_serialization():
    tn.check_serialization(wta.WTASparsityNode("a"))
Example #37
0
def test_output_hyperparameter_node_serialization():
    tn.check_serialization(tn.OutputHyperparameterNode("a"))
Example #38
0
def test_print_node_serialization():
    tn.check_serialization(tn.PrintNode("a"))
Example #39
0
def test_tile_node_serialization():
    tn.check_serialization(tn.TileNode("a"))
    tn.check_serialization(tn.TileNode("a", reps=[1, 2, 3]))
Example #40
0
def test_partition_axis_node_serialization():
    tn.check_serialization(partition_axis.PartitionAxisNode("a"))
Example #41
0
def test_auxiliary_dense_softmax_cce_node_serialization():
    tn.check_serialization(
        auxiliary_costs.AuxiliaryDenseSoftmaxCCENode("a", {}))
    tn.check_serialization(
        auxiliary_costs.AuxiliaryDenseSoftmaxCCENode("a", {}, num_units=100))
Example #42
0
def test_prelu_node_serialization():
    tn.check_serialization(prelu.PReLUNode("a"))
Example #43
0
def test_dense_node_serialization():
    tn.check_serialization(tn.DenseNode("a"))
    tn.check_serialization(tn.DenseNode("a", num_units=100))
Example #44
0
def test_auxiliary_dense_softmax_cce_node_serialization():
    tn.check_serialization(tn.AuxiliaryDenseSoftmaxCCENode("a", {}))
    tn.check_serialization(tn.AuxiliaryDenseSoftmaxCCENode(
        "a", {}, num_units=100))
def test_equilibrated_sgd_node_serialization():
    tn.check_serialization(equilibrated_sgd.EquilibratedSGDNode("a"))
Example #46
0
def test_dense_node_serialization():
    tn.check_serialization(tn.DenseNode("a"))
    tn.check_serialization(tn.DenseNode("a", num_units=100))
Example #47
0
def test_aggregator_node_serialization():
    tn.check_serialization(tn.AggregatorNode("a"))
Example #48
0
def test_dense_combine_node_serialization():
    tn.check_serialization(tn.DenseCombineNode("a", []))
    tn.check_serialization(tn.DenseCombineNode("a", [], num_units=100))
Example #49
0
def test_total_cost_node_serialization():
    tn.check_serialization(
        tn.TotalCostNode("foo", {
            "pred": tn.IdentityNode("foo"),
            "target": tn.IdentityNode("bar")
        }))
Example #50
0
def test_prelu_node_serialization():
    tn.check_serialization(prelu.PReLUNode("a"))
Example #51
0
def test_default_recurrent_conv_2d_node_serialization():
    tn.check_serialization(rcl.DefaultRecurrentConv2DNode("a"))
Example #52
0
def test_interval_relu_node_serialization():
    tn.check_serialization(irelu.IntervalReLUNode("a"))
Example #53
0
def test_elementwise_cost_node_serialization():
    tn.check_serialization(tn.ElementwiseCostNode(
        "foo",
        {"pred": tn.IdentityNode("foo"),
         "target": tn.IdentityNode("bar")}))
Example #54
0
def test_clip_scaling_node_serialization():
    tn.check_serialization(input_scaling.ClipScalingNode("a"))
Example #55
0
def test_auxilliary_cost_node_serialization():
    tn.check_serialization(tn.AuxiliaryCostNode(
        "foo",
        {"target": tn.IdentityNode("bar")}))
Example #56
0
def test_reference_node_serialization():
    tn.check_serialization(tn.ReferenceNode("a"))
    tn.check_serialization(tn.ReferenceNode("a", reference="bar"))