コード例 #1
0
                                      download=True,
                                      transform=transform_svhn)
        dataset_test = datasets.SVHN('../data/svhn',
                                     split='test',
                                     download=True,
                                     transform=transform_svhn_test)
    else:
        exit('Error: unrecognized dataset')

    dataset_valid = dataset_test

    if args.iid == 'noniid_ssl' and args.dataset == 'cifar':
        dict_users, dict_users_labeled, pseudo_label = noniid_ssl(
            dataset_train, args.num_users, args.label_rate)
    else:
        dict_users, dict_users_labeled, pseudo_label = sample(
            dataset_train, args.num_users, args.label_rate, args.iid)

    if args.dataset == 'cifar':
        net_glob = CNNCifar(args=args).to(args.device)
    elif args.dataset == 'mnist':
        net_glob = CNNMnist(args=args).to(args.device)
    elif args.dataset == 'svhn':
        net_glob = CNNCifar(args=args).to(args.device)
    else:
        exit('Error: unrecognized model')

    print("\n Begin Train")

    net_glob.train()
    w_glob = net_glob.state_dict()
コード例 #2
0
ファイル: sepsis.py プロジェクト: wwcodesg/Datathon
"""
-- ------------------------------------------------------------------
-- Title: Explore data on sepsis patients
-- Description: 
--     Start off on comparing mortality rates
--      Followed by comparing teaching hospitals
-- ------------------------------------------------------------------
"""

import data.sampling as sampling
import pandas as pd
import csv

#get sample population
sample_eicu = sampling.sample(path="../data/raw/")
sample_sepsis = sampling.sample(db="sepsis", path="../data/interim/")

df_eicu = pd.Series.to_frame(sample_eicu)
df_sepsis = pd.Series.to_frame(sample_sepsis)