Exemplo n.º 1
0
    def run(self):
        # Instantiate driver classes
        mir = Mirror(self.distribution, self.log)
        nv = Nvidia(self.distribution, self.log)
        ati = ATI(self.distribution, self.log)
        bc = Broadcom(self.distribution, self.log)
        pae = PAE(self.distribution, self.log)

        # First check for mirror
        for code in self.hwCodesWithStatusList:
            if code[0] == hwCodes[4]:
                if code[1] != packageStatus[2]:
                    mir.installMirror()

        # Now install the hardware drivers
        for code in self.hwCodesWithStatusList:
            # First check for mirror
            if code[0] != hwCodes[4]:
                if code[0] == hwCodes[0]:
                    if code[1] != packageStatus[2]:
                        nv.installNvidia()
                elif code[0] == hwCodes[1]:
                    if code[1] != packageStatus[2]:
                        ati.installATI()
                elif code[0] == hwCodes[2]:
                    if code[1] != packageStatus[2]:
                        bc.installBroadcom()
                elif code[0] == hwCodes[3]:
                    if code[1] != packageStatus[2]:
                        pae.installPAE()
Exemplo n.º 2
0
    def run(self):
        hwList = []

        nv = Nvidia(self.distribution, self.log)
        ati = ATI(self.distribution, self.log)
        bc = Broadcom(self.distribution, self.log)
        pae = PAE(self.distribution, self.log)

        # Collect supported hardware
        hwNvidia = nv.getNvidia()
        hwATI = ati.getATI()
        hwBroadcom = bc.getBroadcom()
        hwPae = pae.getPae()

        # Combine all found hardware in a single list
        for line in hwNvidia:
            hwList.append(line)
        for line in hwATI:
            hwList.append(line)
        for line in hwBroadcom:
            hwList.append(line)
        for line in hwPae:
            hwList.append(line)

        return hwList
Exemplo n.º 3
0
    def run(self):
        hwList = []

        #mir = Mirror(self.distribution, self.log)
        nv = Nvidia(self.distribution, self.log)
        ati = ATI(self.distribution, self.log)
        bc = Broadcom(self.distribution, self.log)
        pae = PAE(self.distribution, self.log)

        # Collect supported hardware
        #mirror = mir.getFastestMirror()
        hwNvidia = nv.getNvidia()
        hwATI = ati.getATI()
        hwBroadcom = bc.getBroadcom()
        hwPae = pae.getPae()

        # Combine all found hardware in a single list
        #for line in mirror:
        #    hwList.append(line)
        for line in hwPae:
            hwList.append(line)
        for line in hwNvidia:
            hwList.append(line)
        for line in hwATI:
            hwList.append(line)
        for line in hwBroadcom:
            hwList.append(line)

        return hwList
Exemplo n.º 4
0
Arquivo: main.py Projeto: romaad/msae
def train(configPath, name):
    useGpu = os.environ.get('GNUMPY_USE_GPU', 'auto')
    if useGpu == "no":
        mode = "cpu"
    else:
        mode = "gpu"

    print '========================================================'
    print 'train %s' % name
    print "the program is on %s" % mode
    print '======================================================='

    config = configparser.ConfigParser(
        interpolation=configparser.ExtendedInterpolation())
    config.read(configPath)
    model_name = config.get(name, 'model')
    if model_name == "ae":
        from ae import AE
        model = AE(config, name)
    elif model_name == "lae":
        from lae import LAE
        model = LAE(config, name)
    elif model_name == "pae":
        from pae import PAE
        model = PAE(config, name)
    elif model_name == "sae":
        from sae import SAE
        model = SAE(config, name)
    elif model_name == "msae":
        from msae import MSAE
        model = MSAE(config, name)

    model.train()
Exemplo n.º 5
0
    def run(self):
        # Instantiate driver classes
        nv = Nvidia(self.distribution, self.log)
        ati = ATI(self.distribution, self.log)
        bc = Broadcom(self.distribution, self.log)
        pae = PAE(self.distribution, self.log)

        for code in self.hwCodesWithStatusList:
            if code[0] == hwCodes[0]:
                if code[1] == packageStatus[0]:
                    nv.removeNvidia()
            elif code[0] == hwCodes[1]:
                if code[1] == packageStatus[0]:
                    ati.removeATI()
            elif code[0] == hwCodes[2]:
                if code[1] == packageStatus[0]:
                    bc.removeBroadcom()
            elif code[0] == hwCodes[3]:
                if code[1] == packageStatus[0]:
                    pae.removePAE()
Exemplo n.º 6
0
    def run(self):
        # Instantiate driver classes
        nv = Nvidia(self.distribution, self.log)
        ati = ATI(self.distribution, self.log)
        bc = Broadcom(self.distribution, self.log)
        pae = PAE(self.distribution, self.log)

        for code in self.hwCodesWithStatusList:
            if code[0] == hwCodes[0]:
                if code[1] == packageStatus[0]:
                    nv.removeNvidia()
            elif code[0] == hwCodes[1]:
                if code[1] == packageStatus[0]:
                    ati.removeATI()
            elif code[0] == hwCodes[2]:
                if code[1] == packageStatus[0]:
                    bc.removeBroadcom()
            elif code[0] == hwCodes[3]:
                if code[1] == packageStatus[0]:
                    pae.removePAE()
Exemplo n.º 7
0
 def loadModel(self, config, name):
     """
     name: path to model file or section name for the model
     """
     if os.path.exists(name):
         from ae import AE
         model = AE.load(name)
     else:
         modelname = self.readField(config, name, "model")
         if modelname == "lae":
             from lae import LAE
             model = LAE(config, name)
         elif modelname == "pae":
             from pae import PAE
             model = PAE(config, name)
         elif modelname == 'ae':
             from ae import AE
             model = AE(config, name)
     return model
Exemplo n.º 8
0
    flags = SETUP(DATASET)
    noise_dist = UniformNoise(flags.NOISE_DIM)
    NOISE_PERTURB = 0.01

    if DATASET == 'grid':
        data_dist = Grid()
    elif DATASET == 'low_dim_embed':
        data_dist = LowDimEmbed()
    elif DATASET == 'color_mnist':
        data_dist = CMNIST(os.path.join('data', 'mnist'))
    elif DATASET == 'cifar_100':
        data_dist = CIFAR100(os.path.join('data', 'cifar-100'))
        NOISE_PERTURB = 0.005
    if METHOD == 'pae':
        from pae import PAE
        model = PAE(data_dist, noise_dist, flags, args)
    elif METHOD == 'wae':
        from wae import WAE
        model = WAE(data_dist, noise_dist, flags, args)
    elif METHOD == 'cougan':
        noise_dist = NormalNoise(flags.NOISE_DIM)
        from cougan import CoulombGAN
        model = CoulombGAN(data_dist, noise_dist, flags, args)
    elif METHOD == 'bigan':
        from bigan import BiGAN
        model = BiGAN(data_dist, noise_dist, flags, args)
    elif METHOD == 'veegan':
        if DATASET == 'grid':
            flags.NOISE_DIM = 254  # refer to author's implementation
            flags.GEN_ARCH[0] = flags.NOISE_DIM
            flags.ENC_ARCH[-1] = flags.NOISE_DIM