1ef3ad90a3423ed15ca41e0ea4e81012ebe84a9f,catalyst/data/scripts/project_embeddings.py,,main,#Any#Any#,88

Before Change


        df = df.sample(n=args.num_rows)

    if args.img_col is not None:
        image_names = [
            path.join(args.img_rootpath, name)
            for name in df[args.img_col].values
        ]
        img_data = np.stack(
            [load_image(name, args.img_size) for name in image_names], axis=0
        )
        img_data = (
            img_data.transpose((0, 3, 1, 2)) / 255.0  // noqa: WPS432
        ).astype(np.float32)
        img_data = torch.from_numpy(img_data)
    else:
        img_data = None

    summary_writer = SummaryWriter(args.out_dir)

After Change


    assert len(df) == len(features)

    if args.num_rows is not None:
        indices = np.random.choice(len(df), args.num_rows)
        features = features[indices, :]
        df = df.iloc[indices]

    if args.img_col is not None:
        img_data = _load_image_data(
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 9

Instances


Project Name: catalyst-team/catalyst
Commit Name: 1ef3ad90a3423ed15ca41e0ea4e81012ebe84a9f
Time: 2020-08-11
Author: scitator@gmail.com
File Name: catalyst/data/scripts/project_embeddings.py
Class Name:
Method Name: main


Project Name: OpenNMT/OpenNMT-py
Commit Name: 7fb5e9256e0e9ddab8ec7854fdf11fcdb5717a45
Time: 2018-09-05
Author: pltrdy@gmail.com
File Name: onmt/inputters/dataset_base.py
Class Name: DatasetBase
Method Name: extract_text_features


Project Name: dmlc/gluon-nlp
Commit Name: f19ace982075ea009af81f5e9f687cc2276f50ea
Time: 2020-01-20
Author: 50716238+MoisesHer@users.noreply.github.com
File Name: scripts/bert/fp16_utils.py
Class Name:
Method Name: grad_global_norm