rfho/examples/data_hypercleaner.py
def quick_demo(lmd=None):
    """
    Just to show that it works...
    
    :return: 
    """
    saver = rf.Saver(['Data Hyper-cleaner', 'Quick Demo'])
    np.random.seed(0)

    data = load_std_data()
    x = tf.placeholder(tf.float32, name='x')
    y = tf.placeholder(tf.float32, name='y')
    model = rf.LinearModel(x, 28 * 28, 10)

    if lmd is None:
        # the behaviour in this particular setting is quite stable, we can reduce the times by setting small R,
        # higher hyper-learning rates and a small number of training iterations (T) and hyper-iterations
        lmd = data_hyper_cleaner(saver, model, data=data, y=y, T=500, lr=.1, R=1000.,
                                 toy_problem=True,
                                 hyper_iterations=30, hyper_optimizer_kwargs={'lr': 0.01})

    lmd_optimized = np.ones(data.train.num_examples + data.validation.num_examples)
    lmd_optimized *= np.max(lmd)  # there's no reason to overweight the validation examples...
    lmd_optimized[:data.train.num_examples] = lmd
    baseline(saver, model, y, data, 4000, lr=.1 / np.max(lmd), lmd=lmd_optimized, name='Final Round')

    Just to show that it works...
    
    :return: 
    
Just to show that it works
Just to show that it works
def quick_demo(lmd=None):
    saver = rf.Saver(['Data Hyper-cleaner', 'Quick Demo'])
    np.random.seed(0)
    data = load_std_data()
    x = tf.placeholder(tf.float32, name='x')
    y = tf.placeholder(tf.float32, name='y')
    model = rf.LinearModel(x, 28 * 28, 10)
    if lmd is None:
        lmd = data_hyper_cleaner(saver, model, data=data, y=y, T=500, lr=.1, R=1000.,
                                 toy_problem=True,
                                 hyper_iterations=30, hyper_optimizer_kwargs={'lr': 0.01})
    lmd_optimized = np.ones(data.train.num_examples + data.validation.num_examples)
    lmd_optimized *= np.max(lmd)  
    lmd_optimized[:data.train.num_examples] = lmd
    baseline(saver, model, y, data, 4000, lr=.1 / np.max(lmd), lmd=lmd_optimized, name='Final Round')
def quick_demo ( lmd = None ) : saver = rf . Saver ( [ 'Data Hyper-cleaner' , 'Quick Demo' ] ) np . random . seed ( 0 ) data = load_std_data ( ) x = tf . placeholder ( tf . float32 , name = 'x' ) y = tf . placeholder ( tf . float32 , name = 'y' ) model = rf . LinearModel ( x , 28 * 28 , 10 ) if lmd is None : lmd = data_hyper_cleaner ( saver , model , data = data , y = y , T = 500 , lr = .1 , R = 1000. , toy_problem = True , hyper_iterations = 30 , hyper_optimizer_kwargs = { 'lr' : 0.01 } ) lmd_optimized = np . ones ( data . train . num_examples + data . validation . num_examples ) lmd_optimized *= np . max ( lmd ) lmd_optimized [ : data . train . num_examples ] = lmd baseline ( saver , model , y , data , 4000 , lr = .1 / np . max ( lmd ) , lmd = lmd_optimized , name = 'Final Round' )
Just to show that it works...
Just to show that it works ...
"""
    Just to show that it works...
    
    :return: 
    """ # the behaviour in this particular setting is quite stable, we can reduce the times by setting small R, # higher hyper-learning rates and a small number of training iterations (T) and hyper-iterations # there's no reason to overweight the validation examples...
None
lmd