def __init__(self, *args, **kwargs): """ Constructor. """ super(NNConstraintCheckerTestCase, self).__init__(*args, **kwargs) self.nns = generate_cnn_architectures() + generate_mlp_architectures() self.cnn_constraint_checker = nn_constraint_checkers.CNNConstraintChecker( 25, 5, 500000, 0, 5, 2, 15, 512, 16, 4) self.mlp_constraint_checker = nn_constraint_checkers.MLPConstraintChecker( 25, 5, 500000, 900, 5, 2, 15, 30, 8)
def __init__(self, *args, **kwargs): """ Constructor. """ super(NNVisualiseTestCase, self).__init__(*args, **kwargs) self.cnns = generate_cnn_architectures() self.mlps_reg = generate_mlp_architectures('reg') self.mlps_class = generate_mlp_architectures('class') self.save_dir = '../scratch/unittest_visualisations/' self.save_dir_for_pres = '../scratch/unittest_visualisations_for_pres/'
def __init__(self, *args, **kwargs): """ Constructor. """ super(NNModifierTestCase, self).__init__(*args, **kwargs) self.cnns = generate_cnn_architectures() self.mlps = generate_mlp_architectures() self.save_dir = '../scratch/unittest_modifier_class/' self.cnn_constraint_checker = nn_constraint_checkers.CNNConstraintChecker( 50, 4, np.inf, 4.0, 5, 5, 100, 8000, 8) self.mlp_constraint_checker = nn_constraint_checkers.MLPConstraintChecker( 50, 4, np.inf, 4.0, 5, 5, 100, 8000, 8) self.cnn_modifier = nn_modifiers.NNModifier( self.cnn_constraint_checker) self.mlp_modifier = nn_modifiers.NNModifier( self.mlp_constraint_checker) self.modifier_wo_cc = nn_modifiers.NNModifier(None)
def __init__(self, *args, **kwargs): """ Constructor. """ super(TransportNNDistanceComputerTestCase, self).__init__(*args, **kwargs) self.non_assignment_penalty = 1 cnn_layer_labels, label_mismatch_penalty = \ nn_comparators.get_cnn_layer_label_mismatch_penalties(self.non_assignment_penalty) self.tp_comp = nn_comparators.OTMANNDistanceComputer( cnn_layer_labels, label_mismatch_penalty, self.non_assignment_penalty, nn_comparators.CNN_STRUCTURAL_PENALTY_GROUPS, nn_comparators.PATH_LENGTH_TYPES, dflt_mislabel_coeffs=1.0, dflt_struct_coeffs=1.0) self.cnns = generate_cnn_architectures()
def __init__(self, *args, **kwargs): """ Constructor. """ super(DistProdNNKernelTestCase, self).__init__(*args, **kwargs) self.non_assignment_penalty = 1 cnn_layer_labels, label_mismatch_penalty = \ nn_comparators.get_cnn_layer_label_mismatch_penalties(self.non_assignment_penalty) self.all_layer_labels = cnn_layer_labels self.label_mismatch_penalty = label_mismatch_penalty self.tp_comp = nn_comparators.OTMANNDistanceComputer( cnn_layer_labels, label_mismatch_penalty, self.non_assignment_penalty, nn_comparators.CNN_STRUCTURAL_PENALTY_GROUPS, nn_comparators.PATH_LENGTH_TYPES) self.mislabel_coeffs = [2.0, 2.0, 1.0, 1.0, 1.0] self.struct_coeffs = [0.25, 0.5, 1.0, 2.0, 4.0] self.lp_betas = [1e-6] * len(self.struct_coeffs) self.emd_betas = [1] * len(self.struct_coeffs) self.scale = 1 self.cnns = generate_cnn_architectures()