Exemple #1
0
train_net = 10
out_cls = 10 * f
train_pr_net = 5000 * f
test_pr_net = 1000 * f
print_freq = 5
val_freq = 100
a = 10e1
b = 10e1
c = 10e2
lr_func = 1
# para_ls = [(7e-2, -0.55), (7e-2, -0.54), (7e-2, -0.56), (7e-2, -0.525), (7e-2, -0.5), (7e-2, -0.575), (7e-2, -0.6), (6e-2, -0.55), (6e-2, -0.525), (6e-2, -0.5), (6e-2, -0.575), (6e-2, -0.6)]
# para_ls = [(7e-2, -0.54), (7e-2, -0.56), (7e-2, -0.525), (7e-2, -0.5), (7e-2, -0.575), (7e-2, -0.6)]
# para_ls = [(1.5e-2, 0.1), (1.25e-2, 0.1), (1.75e-2, 0.1), (2e-2, 0.1)]
para_ls = [(1e-3, 0.1), (1.25e-3, 0.1), (1.5e-3, 0.1), (1.75e-2, 0.1), (2e-2, 0.1)]
# para_ls = [(1e-2, -0.4), (1e-2, -0.6), (1e-2, -0.7), (7e-2, -0.8), (5e-2, -0.55), (4e-2, -0.55), (4e-2, -0.45)]
model_pth = parentdir + '/runs/test-150/model_best_class_9.pth.tar'
tp1 = 50
net_ls = [8, 9, 3, 7]
train = Train(name=name, data_pth=data_pth, batch_size=batch_size, epochs=epochs, num_net=num_net, train_net=train_net,
              test_pr_net=test_pr_net, train_pr_net=train_pr_net, out_cls=out_cls, print_freq=print_freq,
              para_ls=para_ls, a=a, b=b, c=c, lr_func = lr_func, tp1=tp1)
try:
    # train.train(val_freq=val_freq, dir_txt=currentdir+'/')
    train.resume(pth=model_pth, net_ls=net_ls, dir_txt=currentdir + '/', val_freq=val_freq)
except:
    e = traceback.format_exc()
    traceback.print_exc()
    info = 'ERROR in your code!!!\n\n %s'%e
    mail(subject=name + ' Exception', info=info)

name = os.path.basename(__file__).split('.')[0]
data_pth = '/home/hxianglong' + '/Data/cifar-100-python-cnn-features-transform-order-no-neg'
batch_size = 256 * factor
epochs = 100
num_net = 10 / f
# train_net = 10 / f
train_net = 10
out_cls = 10 * f
train_pr_net = 5000 * f
test_pr_net = 1000 * f
print_freq = 5
val_freq = 20
a = 10e1
b = 10e1
c = 10e2
lr = 7e-2
decay = -0.5
para_ls = [(7e-2, -0.5), (7e-2, -0.4), (7e-2, -0.6), (7e-2, -0.7), (7e-2, -0.8), (5e-2, -0.55), (4e-2, -0.55), (4e-2, -0.45)]
# para_ls = [(1e-2, -0.4), (1e-2, -0.6), (1e-2, -0.7), (7e-2, -0.8), (5e-2, -0.55), (4e-2, -0.55), (4e-2, -0.45)]
train = Train(name=name, data_pth=data_pth, batch_size=batch_size, epochs=epochs, num_net=num_net, train_net=train_net,
              test_pr_net=test_pr_net, train_pr_net=train_pr_net, out_cls=out_cls, print_freq=print_freq,
              para_ls=para_ls, a=a, b=b, c=c, learning_rate=lr, decay=decay)
try:
    train.train(val_freq=val_freq, dir_txt=currentdir+'/')
except:
    e = traceback.format_exc()
    traceback.print_exc()
    info = 'ERROR in your code!!!\n\n %s'%e
    mail(subject=name, info=info)

logo_print = print(colored.fg(1) + logo.read() + colored.fg(15))
logo_title_print = print(
    colored.attr("bold") + colored.fg(10) + logo_title.read() +
    colored.fg(15) + colored.attr(0))

print("\nWelcome And Start Spamming. USE VPN AND TOR TO AVOID DETECTION.")

print("Give The Following Information Of Victim To Start.\n")
mail_data = [
    input("Name: "),
    input("To: "),
    input("Subject: "),
    input("Message: ")
]

mail(mail_data[0], mail_data[1], mail_data[2], mail_data[3])

if re.match(r"[^@]+@[^@]+\.[^@]+", mail_data[1]):
    print(
        colored.attr("bold") + colored.fg(10) +
        "\nThe Address Is Valid. Starting Spamming" + colored.fg(15) +
        colored.attr(0))
else:
    print(
        colored.attr("bold") + colored.fg(1) +
        "\nWTF! Address Is Not Valid. Closing The Program." + colored.fg(15) +
        colored.attr(0))
    sleep(2)
    exit()

print("\nInitiating The Spamming...")