示例#1
0
            simple_net(important_vars,
                       important_features,
                       'bpsk\\lstm_simple_net.gv',
                       var_list=var_list,
                       mode_list=mode_list)

    # BPSK
    if 'mt' in system:
        data_path = parentdir + '\\tank_systems\\data\\train\\'
        mana = mt_data_manager()
        mana.load_data(data_path)
        mana.add_noise(20)
        var_list = mana.cfg.variables
        mode_list = ['normal'] + mana.cfg.faults
        inputs, _ = mana.random_h_batch(batch=test_batch,
                                        step_num=64,
                                        prop=0.2,
                                        sample_rate=1.0)
        # CNN
        if 'cnn' in network:
            ann = 'mt_cnn_distill_(8, 16, 32, 64).cnn'
            ann = parentdir + '\\ann_diagnoser\\mt\\train\\20db\\{}\\'.format(
                args.index) + ann
            important_vars = heat_map_feature_input(
                ann,
                inputs,
                figname=
                'mt\\importance_heat_map_between_varialbe_feature_of_CNN',
                isCNN=True)
            important_features = heat_map_fault_feature(
                ann,
                inputs,
示例#2
0
                                                 two_fault=0)
        labels = torch.sum(labels * torch.Tensor([1, 2, 3, 4, 5, 6]), 1).long()
        labels = labels.detach().numpy()
        if args.model is None:
            inputs = inputs.detach().numpy()
            numpy2arff(inputs, labels, args.output, var_list, mode_list)
        elif 'encoder' in args.model:
            encoder2arff(inputs, labels, args.model, args.output, mode_list)
        else:
            feature2arff(inputs, labels, args.model, args.output, mode_list)

    if args.system == 'mt':
        step_len = 64
        data_path = parentdir + '\\tank_systems\\data\\{}\\'.format(
            args.purpose)
        mana = mt_data_manager()
        mana.load_data(data_path)
        mana.add_noise(snr)
        var_list = mana.cfg.variables[0:11]
        mode_list = ['normal'] + mana.cfg.faults
        inputs, labels = mana.random_h_batch(batch=batch,
                                             step_num=64,
                                             prop=0.2,
                                             sample_rate=1.0)
        if args.model is None:
            numpy2arff(inputs, labels, args.output, var_list, mode_list)
        elif 'encoder' in args.model:
            encoder2arff(inputs, labels, args.model, args.output, mode_list)
        else:
            feature2arff(inputs, labels, args.model, args.output, mode_list)