This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Fontconfig warning: "/etc/fonts/fonts.conf", line 102: unknown element "blank" | |
Fontconfig warning: "/etc/fonts/conf.avail/66-wqy-zenhei-sharp-no13px.conf", line 11: Having multiple values in <test> isn't supported and may not work as expected | |
Fontconfig warning: "/etc/fonts/conf.avail/66-wqy-zenhei-sharp.conf", line 10: Having multiple values in <test> isn't supported and may not work as expected | |
state: update-not-available |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
import torch.nn as nn | |
import torch.optim as optim | |
from torch.autograd import Variable | |
class MyLoss(torch.nn.Module): | |
def __init__(self): | |
super(MyLoss, self).__init__() | |
def forward(self, output, target): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Define options | |
import argparse | |
parser = argparse.ArgumentParser(description="WGAN") | |
# Dataset options | |
parser.add_argument('-d', '--dataset', default="parent_of_n02510455", help="dataset directory (for ImageFolder)") | |
# Training options | |
parser.add_argument('--bad', action="store_true", help="use \"bad\" normalization values") | |
parser.add_argument('-b', '--batch-size', default=16, type=int, help="batch size") | |
# Backend options | |
parser.add_argument('--no-cuda', help="disable CUDA", action="store_true") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Initialize thread pool: will be global to avoid serialization issues (https://github.com/torch/threads/issues/43) | |
threads = require "threads" | |
threads.Threads.serialization('threads.sharedserialize') | |
pool = threads.Threads(5, | |
function() | |
threads_t = require "threads" | |
require "sys" | |
end | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Create table with metatable | |
tab = {} | |
idx = {a = 1} | |
setmetatable(tab, {__index = idx}) | |
-- Setup threads | |
threads = require 'threads' | |
threads.Threads.serialization('threads.sharedserialize') -- Commenting this does not affect the outcome | |
pool = threads.Threads(2) | |
-- Prepare job | |
do |