851a5832065cb2988c23023b429137e1f54b5335,neural_style/neural_style.py,,train,#Any#,19

Before Change


                gram_y = utils.gram_matrix(features_y[m])
                style_loss += args.style_weight * mse_loss(gram_y, gram_s[:n_batch,:,:])

            tv_loss = args.tv_weight * ((torch.sum(torch.abs(y[:,:,1:,:] - y[:,:,:-1,:])) + torch.sum(torch.abs(y[:,:,:,1:] - y[:,:,:,:-1]))) / float(n_batch))

            total_loss = content_loss + style_loss + tv_loss
            total_loss.backward()
            optimizer.step()

            agg_content_loss += content_loss.data[0]
            agg_style_loss += style_loss.data[0]
            agg_tv_loss += tv_loss.data[0]

            if (batch_id + 1) % args.log_interval == 0:
                mesg = "Epoch {}:\t[{}/{}]\tcontent:{:.2f}\tstyle:{:.2f}\ttv:{:.2f}".format(
                    e + 1, count, len(train_dataset),

After Change


        kwargs = {}

    print("=====================")
    print("CURRENT TIME:", time.ctime())
    print("PYTHON VERSION:", sys.version)
    print("PYTORCH VERSION:", torch.__version__)
    print("BATCH SIZE:", args.batch_size)
    print("EPOCHS:", args.epochs)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: abhiskk/fast-neural-style
Commit Name: 851a5832065cb2988c23023b429137e1f54b5335
Time: 2017-04-03
Author: abhishekkadiyan@gmail.com
File Name: neural_style/neural_style.py
Class Name:
Method Name: train


Project Name: deepchem/deepchem
Commit Name: d62d3a866dcb8f937d6aa5e869c309cee8a784ce
Time: 2016-07-11
Author: bharath.ramsundar@gmail.com
File Name: deepchem/models/multitask.py
Class Name: SingletaskToMultitask
Method Name: fit


Project Name: biotite-dev/biotite
Commit Name: 1127d4afd74c2f154943529c98d4001bd2633e21
Time: 2018-08-22
Author: bauer@cbs.tu-darmstadt.de
File Name: src/biotite/structure/hbond.py
Class Name:
Method Name: _hbond