Esempio n. 1
0
parser.add_argument('--trunc',type=int,default=7)
parser.add_argument('--limit',type=int,default=100)
parser.add_argument('--adv',type=str,default=None)
parser.add_argument('--train_baseline',action='store_true')
args = parser.parse_args()

import extra_vars
from subtlenet.models import particles as train
from os import path

train.NEPOCH = args.nepoch
train.VERSION = str(args.version) + '_Adam'
#train.OPTIMIZER = 'RMSprop'
data, dims = train.instantiate(args.trunc, args.limit)

clf_gen = train.setup_data(data)
adv_gen = train.setup_adv_data(data)


if args.adv == 'emd':
    opts = {
            'loss' : train.emd,
            'scale' : 0.1,
            'w_clf' : 0.001,
            'w_adv' : 100,
            }
elif args.adv == 'mse':
    opts = {
            'loss' : args.adv,
            'scale' : 0.03,
            'w_clf' : 0.001,
Esempio n. 2
0
import extra_vars
from subtlenet.models import particles as train
from os import path

from subtlenet import config
from subtlenet.backend import obj
# config.DEBUG = True
# obj._RANDOMIZE = False

train.NEPOCH = args.nepoch
train.VERSION = str(args.version) + '_Adam'
#train.OPTIMIZER = 'RMSprop'
data, dims = train.instantiate(args.trunc, args.limit)

clf_gen = train.setup_data(data)
adv_gen = train.setup_data(data, decorr_mass=True)

if args.adv == 'emd':
    opts = {
        'loss': train.emd,
        'scale': 0.1,
        'w_clf': 0.001,
        'w_adv': 100,
    }
elif args.adv == 'mse':
    opts = {
        'loss': args.adv,
        'scale': 0.03,
        'w_clf': 0.001,
        'w_adv': 0.1,