コード例 #1
0
ファイル: fsm_process.py プロジェクト: wwxFromTju/mmn
 def generate_train_data(self, no_batches, batch_size,
                         trajectories_data_path, generate_train_data,
                         gru_dir):
     tl.set_log(gru_dir, 'generate_train_data')
     train_data = tl.generate_trajectories(self.env, no_batches, batch_size,
                                           trajectories_data_path)
     return train_data
コード例 #2
0
def main():
    default_server_ip = "127.0.0.1"

    args = mgArg.mg_arg(default_server_ip)
    tools.set_log(args.logName, args.notverbose)

    while True:
        secure_communication = tools.SecureCommunication(
            args.RHOST, args.RPORT)
        secure_communication.secure_connect()
        tools.echo_service(secure_communication, args.RHOST, args.logName)
        secure_communication.clean_socket()
コード例 #3
0
    try:
        fsm_object = fsm_process.ProcessFSM(env)
        # ***********************************************************************************
        # Generating training data                                                          *
        # ***********************************************************************************
        no_batches = 10000
        if args.generate_train_data:
            train_data = fsm_object.generate_train_data(
                no_batches, args.batch_size, trajectories_data_path,
                args.generate_train_data, gru_dir)
        # ***********************************************************************************
        # GRU Network                                                                       *
        # ***********************************************************************************
        if args.gru_train or args.gru_test:
            tl.set_log(gru_dir, 'train' if args.gru_train else 'test')
            gru_net = GRUNet(len(obs), args.gru_size, int(env.action_space.n))

            if args.cuda:
                gru_net = gru_net.cuda()
            if args.gru_train:
                logging.info(['No Training Performed!!'])
                logging.warning(
                    'We assume that we already have a pre-trained model @ {}'.
                    format(gru_net_path))
                tl.write_net_readme(gru_net, gru_dir, info={})
            if args.gru_test:
                test_performance = fsm_object.test_gru(gru_net, gru_net_path,
                                                       args.cuda)
        # ***********************************************************************************
        # Generating BottleNeck training data                                               *
コード例 #4
0
    # acc_data = dict with dates as keys and array with jobs as value
    # Get passed args
    script.collect_args()

    # Process args
    if script.is_arg('h') or script.is_arg('help'):
        print_help()
        sys.exit(0)

    if script.is_arg('o'):
        PATH_OUTPUT = script.get_arg('o')[0]
    if script.is_arg('output'):
        PATH_OUTPUT = script.get_arg('output')[0]

    if script.is_arg('l'):
        tools.set_log(script.get_arg('l')[0])
    if script.is_arg('logfile'):
        tools.set_log(script.get_arg('logfile')[0])

    #Get torque accounting files
    files = script.get_arg(None)

    if files == None:
        tools.error('please pass at least one Torque accounting file!')
        print_help()
        sys.exit(1)

    acc_data = torque.parse_accounting(files)

    #Create Object User and Job