76 lines
2.7 KiB
Python
76 lines
2.7 KiB
Python
import time
|
|
import pickle
|
|
import argparse
|
|
import numpy as np
|
|
|
|
|
|
def parse_args():
|
|
parser = argparse.ArgumentParser()
|
|
|
|
# Some arguments from https://github.com/brannondorsey/PassGAN/blob/master/train.py
|
|
parser.add_argument('--train-path',
|
|
type=str,
|
|
default='dataset/train.txt',
|
|
dest='train_path',
|
|
help='Path to train dataset')
|
|
parser.add_argument('--print-freq',
|
|
type=int,
|
|
default=1000,
|
|
dest='print_freq',
|
|
help='The number of iterations between logging (default: 1000)')
|
|
|
|
parser.add_argument('--batch-size', '-b',
|
|
type=int,
|
|
default=512,
|
|
dest='batch_size',
|
|
help='Batch size (default: 512).')
|
|
|
|
parser.add_argument('--password-length', '-l',
|
|
type=int,
|
|
default=10,
|
|
dest='password_length',
|
|
help='The maximum password length (default: 10)')
|
|
|
|
parser.add_argument('--hidden-dim', '-d',
|
|
type=int,
|
|
default=1024,
|
|
dest='hidden_dim',
|
|
help='The hidden layer dimensionality for the generator and discriminator (default: 512)')
|
|
|
|
parser.add_argument('--embedding-dim',
|
|
type=int,
|
|
default=512,
|
|
dest='embedding_dim',
|
|
help='The embedding layer dimensionality for the generator and discriminator (default: 256)')
|
|
|
|
parser.add_argument('--lr',
|
|
type=float,
|
|
default=0.0001,
|
|
dest='lr',
|
|
help='Learning rate (deafult: 0.0001)')
|
|
|
|
parser.add_argument('--device',
|
|
type=str,
|
|
default="cpu",
|
|
)
|
|
|
|
parser.add_argument('--num-generate',
|
|
type=int,
|
|
default=1000000000,
|
|
dest='num_generate',
|
|
help='Number of passwords to generate after training (default: 50000)')
|
|
|
|
parser.add_argument('--option',
|
|
type=int,
|
|
default=1,
|
|
dest='option',
|
|
)
|
|
|
|
parser.add_argument('--report-path',
|
|
type=str,
|
|
default="tmp",
|
|
dest='report_path',
|
|
help='Path to the experiment report csv file.')
|
|
|
|
return parser.parse_args()
|