def main():
    results_dir = "../01_results/CNN2D"
    createfolder(results_dir)

    for input_frames in [10, 9, 8, 7, 6, 5]:
        results_file = os.path.join(
            results_dir, "BMSE_f.{:02d}_x.{:02d}.txt".format(18, input_frames))
        print(results_file)
        run(results_file=results_file,
            input_frames=input_frames,
            output_frames=18,
            loss_function="BMSE",
            max_epochs=100,
            device=device1)
def main():
    results_dir = "../01_results/CNN2D"
    createfolder(results_dir)

    for forecast_t in range(1, 4):
        for x_tsteps in range(3, 10):
            results_file = os.path.join(
                results_dir,
                "BMSE_f.{:02d}_x.{:02d}.txt".format(forecast_t, x_tsteps))

            run(results_file=results_file,
                x_tsteps=x_tsteps,
                forecast_t=forecast_t,
                loss_function="BMSE",
                max_epochs=1,
                device=device)
Beispiel #3
0
def main():
    results_dir = "../01_results/CNN2D_En_De_Fc"
    createfolder(results_dir)

    for forecast_t in range(1, 4):
        for x_tsteps in range(3, 7):
            results_file = os.path.join(
                results_dir,
                "BMSE_x.{:02d}_f.{:02d}.txt".format(x_tsteps, forecast_t))
            print(results_file)
            run(results_file=results_file,
                x_tsteps=x_tsteps,
                forecast_t=forecast_t,
                loss_function="BMSE",
                max_epochs=50,
                device=device1)
Beispiel #4
0
def main():
    output_frames = 18
    channel_factor = 2
    input_frames = 10
    results_dir = "../01_results/ConvGRUv2_c.{:d}".format(channel_factor)
    createfolder(results_dir)
    results_name = os.path.join(
        results_dir,
        "BMSE_f.{:02d}_x.{:02d}.txt".format(output_frames, input_frames))
    print(results_name)
    run(results_name,
        channel_factor=channel_factor,
        input_frames=input_frames,
        output_frames=output_frames,
        loss_function="BMSE",
        max_epochs=100,
        device=args.device)
def main():
    output_frames = 18
    for channel_factor in [1, 2, 4, 8]:
        for input_frames in range(5, 11):
            results_dir = "../01_results/ConvGRU_v1_c.{:d}".format(
                channel_factor)
            createfolder(results_dir)
            results_name = os.path.join(
                results_dir,
                "BMSE_f.{:02d}_x.{:02d}.txt".format(output_frames,
                                                    input_frames))
            print(results_name)
            run(results_name,
                channel_factor,
                input_frames=input_frames,
                output_frames=output_frames,
                loss_function="BMSE",
                max_epochs=50,
                device=args.device)
Beispiel #6
0
def main():
    if args.root_dir == None:
        print("Please set the directory of root data ")
        return
    elif args.ty_list_file == None:
        print("Please set typhoon list file")
        return
    elif args.result_dir == None:
        print("Please set the directory of the result")
        return
    else:
        # set the parameters of the experiment
        output_frames = 18
        channel_factor = 2
        input_frames = 10

        result_dir = os.path.join(args.result_dir,"I{:d}_F{:d}".format(args.I_shape[0],args.F_shape[0]),"convGRU_c.{:d}".format(channel_factor))
        createfolder(result_dir)
        result_name = os.path.join(result_dir,"BMSE_f{:02d}_x{:02d}_w{:.5f}.txt".format(output_frames,input_frames,args.weight_decay))
        print(result_name)
        run(result_name=result_name, channel_factor=channel_factor, input_frames=input_frames, output_frames=output_frames,
            loss_function=BMSE, max_epochs=100, device=args.device)
Beispiel #7
0
    decoder_stride = [1,2,2,2,2,1]
    decoder_padding = [0,1,1,1,1,1]


    Net = model(encoder_input, encoder_hidden, encoder_kernel, encoder_n_layer, encoder_stride, encoder_padding,
                decoder_input, decoder_hidden, decoder_kernel, decoder_n_layer, decoder_stride, decoder_padding,
                batch_norm=batch_norm).to(device)

    # print(Net)
    # Train process
    info = "|CNN2D| Forecast frames: {:02d}, Input frames: {:02d} |".format(output_frames, input_frames)
    print("="*len(info))
    print(info)
    print("="*len(info))
    train(net=Net, trainloader=trainloader, testloader=testloader, result_name=result_name, max_epochs=max_epochs,  loss_function=loss_function, device=device)

if __name__ == "__main__":
    output_frames = args.output_frames
    channel_factor = args.channel_factor
    input_frames = args.input_frames
    result_dir=os.path.join(args.result_dir,
                            'cnn2D_i{:d}_o{:d}_c{:d}'.format(input_frames,output_frames,channel_factor),
                            'I{:d}_F{:d}'.format(args.I_shape[0],args.F_shape[0]))

    print(" [The path of the result folder]:", result_dir)
    createfolder(result_dir)
    result_name = os.path.join(result_dir,"BMSE_f.{:02d}_x.{:02d}.txt".format(output_frames, input_frames))
    print(result_name)
    run(result_name=result_name, channel_factor=channel_factor, input_frames=input_frames, output_frames=output_frames,
        loss_function=BMSE, max_epochs=50, batch_norm=args.batch_norm, device=args.device)