val_gt3D_embed = pca.transform(
        val_gt3D.reshape((val_gt3D.shape[0], val_gt3D.shape[1] * 3)))

    ############################################################################
    print("create network")
    batchSize = 128
    poseNetParams = PoseRegNetParams(type=0,
                                     nChan=nChannels,
                                     wIn=imgSizeW,
                                     hIn=imgSizeH,
                                     batchSize=batchSize,
                                     numJoints=1,
                                     nDims=train_gt3D_embed.shape[1])
    poseNet = PoseRegNet(rng, cfgParams=poseNetParams)

    poseNetTrainerParams = PoseRegNetTrainerParams()
    poseNetTrainerParams.batch_size = batchSize
    poseNetTrainerParams.learning_rate = 0.01

    print("setup trainer")
    poseNetTrainer = PoseRegNetTrainer(poseNet, poseNetTrainerParams, rng)
    poseNetTrainer.setData(train_data, train_gt3D_embed, val_data,
                           val_gt3D_embed)
    poseNetTrainer.compileFunctions(compileDebugFcts=False)

    ###################################################################
    #
    # TRAIN
    nEpochs = 100
    train_res = poseNetTrainer.train(n_epochs=nEpochs, storeFilters=True)
    train_costs = train_res[0]
Beispiel #2
0
    val_gt3D_embed = pca.transform(
        val_gt3D.reshape((val_gt3D.shape[0], val_gt3D.shape[1] * 3)))

    ############################################################################
    print("create network")
    batchSize = 128
    poseNetParams = PoseRegNetParams(type=0,
                                     nChan=nChannels,
                                     wIn=imgSizeW,
                                     hIn=imgSizeH,
                                     batchSize=batchSize,
                                     numJoints=1,
                                     nDims=train_gt3D_embed.shape[1])
    poseNet = PoseRegNet(rng, cfgParams=poseNetParams)

    poseNetTrainerParams = PoseRegNetTrainerParams()
    poseNetTrainerParams.batch_size = batchSize
    poseNetTrainerParams.learning_rate = 0.001
    poseNetTrainerParams.weightreg_factor = 0.0
    poseNetTrainerParams.force_macrobatch_reload = True
    poseNetTrainerParams.para_augment = True
    poseNetTrainerParams.augment_fun_params = {
        'fun': 'augment_poses',
        'args': {
            'normZeroOne':
            False,
            'di':
            di,
            'aug_modes':
            aug_modes,
            'hd':