SYMBOL INDEX (289 symbols across 29 files) FILE: criterions.py function hinge_d_loss (line 9) | def hinge_d_loss(real, fake): function hinge_g_loss (line 13) | def hinge_g_loss(real, fake): FILE: datasets/__init__.py function get_ma_dataset (line 15) | def get_ma_dataset(*args, language=None, **kwargs): function get_ma_val_dataset (line 24) | def get_ma_val_dataset(*args, language=None, **kwargs): FILE: datasets/data_utils.py function cyclize (line 9) | def cyclize(loader): function rev_dict (line 16) | def rev_dict(l): function uniform_indices (line 21) | def uniform_indices(end, n_sample, st=None): function sample (line 33) | def sample(population, n_sample, exception=None): function uniform_sample (line 48) | def uniform_sample(population, n_sample, st=None): function get_fonts (line 64) | def get_fonts(avails): function get_union_chars (line 68) | def get_union_chars(avails): function get_fonts_unionchars (line 72) | def get_fonts_unionchars(avails): function get_intersection_chars (line 76) | def get_intersection_chars(avails): FILE: datasets/fcdata.py class FCData (line 12) | class FCData: method get (line 16) | def get(self, font_name, char): class HDF5Data (line 20) | class HDF5Data(FCData): method __init__ (line 21) | def __init__(self, hdf5_paths, transform=None, language='kor'): method make_char2idx (line 53) | def make_char2idx(self, chars): method is_avail (line 77) | def is_avail(self, font_name, char): method get (line 83) | def get(self, font_name, char, default=None, transform=None): method get_from_reffont (line 103) | def get_from_reffont(self, char): method get_avail_chars (line 112) | def get_avail_chars(self, font_name): FILE: datasets/kor_dataset.py class MAStyleFirstDataset (line 18) | class MAStyleFirstDataset(Dataset): method __init__ (line 22) | def __init__(self, data, style_sampler, n_sample_min=1, n_sample_max=999, method get_avail_chars (line 51) | def get_avail_chars(self, font_name, style_chars): method get_component_combinations (line 57) | def get_component_combinations(self, components, avail_chars, style_co... method check_and_sample (line 79) | def check_and_sample(self, trg_comp_ids): method __getitem__ (line 88) | def __getitem__(self, index): method __len__ (line 151) | def __len__(self): method collate_fn (line 155) | def collate_fn(batch): class MATargetFirstDataset (line 180) | class MATargetFirstDataset(Dataset): method __init__ (line 186) | def __init__(self, target_fc, style_avails, style_data, n_max_match=3,... method sample_style_char (line 224) | def sample_style_char(self, font_name, trg_char): method __getitem__ (line 256) | def __getitem__(self, index): method __len__ (line 291) | def __len__(self): method collate_fn (line 295) | def collate_fn(batch): function filter_complete_chars (line 316) | def filter_complete_chars(chars): function get_ma_dataset (line 320) | def get_ma_dataset(hdf5_data, avail_fonts, avail_chars=None, transform=N... function get_ma_val_dataset (line 338) | def get_ma_val_dataset(hdf5_data, fonts, chars, style_avails, n_max_matc... FILE: datasets/kor_decompose.py function compose (line 23) | def compose(cho, jung, jong): function decompose (line 29) | def decompose(char): FILE: datasets/nonpaired_dataset.py class EncodeDataset (line 13) | class EncodeDataset(Dataset): method __init__ (line 14) | def __init__(self, font_name, chars, data, language, style_id=0, trans... method __getitem__ (line 29) | def __getitem__(self, index): method __len__ (line 40) | def __len__(self): class DecodeDataset (line 44) | class DecodeDataset(Dataset): method __init__ (line 45) | def __init__(self, chars, language, style_id=0): method __getitem__ (line 63) | def __getitem__(self, index): method __len__ (line 72) | def __len__(self): FILE: datasets/samplers.py class Sampler (line 10) | class Sampler: method __init__ (line 11) | def __init__(self, R, avails, data): method get_item (line 16) | def get_item(self, key, value): method get (line 19) | def get(self, key, ex_values=None, ret_values=False): method get_uniform (line 30) | def get_uniform(self, key, indices=None, st=None): class StyleSampler (line 45) | class StyleSampler(Sampler): method get_item (line 47) | def get_item(self, font_name, char): class ContentSampler (line 51) | class ContentSampler(Sampler): method get_item (line 53) | def get_item(self, char, font_name): FILE: datasets/thai_dataset.py function product4_no_dup (line 15) | def product4_no_dup(consonants, uppers, highests, lowers): class MAStyleFirstDataset (line 29) | class MAStyleFirstDataset(Dataset): method __init__ (line 30) | def __init__(self, data, fonts, chars, n_sample_min, n_sample_max, method sample_style_chars (line 53) | def sample_style_chars(self, n_styles): method sample_trg_chars (line 78) | def sample_trg_chars(self, components, style_chars): method __getitem__ (line 97) | def __getitem__(self, index): method __len__ (line 141) | def __len__(self): method collate_fn (line 145) | def collate_fn(batch): class MATargetFirstDataset (line 170) | class MATargetFirstDataset(Dataset): method __init__ (line 171) | def __init__(self, target_fc, style_avails, style_data, n_max_match=4,... method sample_style_char (line 209) | def sample_style_char(self, font_name, trg_char): method __getitem__ (line 241) | def __getitem__(self, index): method __len__ (line 277) | def __len__(self): method collate_fn (line 281) | def collate_fn(batch): function get_ma_dataset (line 302) | def get_ma_dataset(hdf5_data, avail_fonts, avail_chars=None, transform=N... function get_ma_val_dataset (line 310) | def get_ma_val_dataset(hdf5_data, fonts, chars, style_avails, n_max_matc... FILE: datasets/thai_decompose.py function _ord2idx (line 19) | def _ord2idx(ords): function compose (line 31) | def compose(consonant, upper, highest, lower): function compose_ids (line 41) | def compose_ids(consonant, upper, highest, lower): function complete_chars (line 51) | def complete_chars(): function ord2idx_2d (line 64) | def ord2idx_2d(ords): function decompose_ords (line 83) | def decompose_ords(char): function decompose_ids (line 104) | def decompose_ids(char): function decompose_index (line 110) | def decompose_index(index): FILE: evaluator.py function torch_eval (line 33) | def torch_eval(val_fn): class Evaluator (line 45) | class Evaluator: method __init__ (line 50) | def __init__(self, data, trn_avails, logger, writer, batch_size, trans... method validation (line 96) | def validation(self, gen, step, extra_tag=''): method comparable_validset_validation (line 113) | def comparable_validset_validation(self, gen, step, compare_inputs=Fal... method comparable_validation (line 123) | def comparable_validation(self, gen, style_avails, target_fonts, targe... method cross_validation (line 147) | def cross_validation(self, gen, step, loader, tag, n_batches, n_log=64... method get_pixel_losses (line 222) | def get_pixel_losses(self, out, trg_imgs, unify): method handwritten_validation_2stage (line 256) | def handwritten_validation_2stage(self, gen, step, fonts, style_chars,... method get_inputimages (line 299) | def get_inputimages(self, val_loader): method get_charimages (line 313) | def get_charimages(self, fonts, chars, empty_header=False, as_tensor=T... method merge_and_log_image (line 339) | def merge_and_log_image(self, name, out, target, step): function eval_ckpt (line 345) | def eval_ckpt(): FILE: inference.py function infer (line 12) | def infer(gen, loader): function get_val_loader (line 30) | def get_val_loader(data, fonts, chars, style_avails, transform, content_... function infer_2stage (line 42) | def infer_2stage(gen, encode_loader, decode_loader, reset_memory=True): function get_val_encode_loader (line 68) | def get_val_encode_loader(data, font_name, encode_chars, language, trans... function get_val_decode_loader (line 78) | def get_val_decode_loader(chars, language, B=32, num_workers=2, style_id... FILE: logger.py class ColorFormatter (line 19) | class ColorFormatter(logging.Formatter): method format (line 28) | def format(self, record): class Logger (line 34) | class Logger(logging.Logger): method get (line 38) | def get(cls, file_path=None, level='info', colorize=True): method nofmt (line 76) | def nofmt(self, msg, *args, level='info', **kwargs): method remove_formats (line 82) | def remove_formats(self): method set_formats (line 91) | def set_formats(self, formatters): method set_file_handler (line 96) | def set_file_handler(self, file_path): FILE: models/aux_classifier.py class AuxClassifier (line 11) | class AuxClassifier(nn.Module): method __init__ (line 12) | def __init__(self, C, C_out, norm='BN', activ='relu', pad_type='reflect', method forward (line 25) | def forward(self, x): FILE: models/comp_encoder.py class ComponentEncoder (line 12) | class ComponentEncoder(nn.Module): method __init__ (line 16) | def __init__(self, C_in, C, norm='none', activ='relu', pad_type='refle... method forward (line 51) | def forward(self, x): method filter_skips (line 70) | def filter_skips(self, feats): FILE: models/decoder.py class Integrator (line 12) | class Integrator(nn.Module): method __init__ (line 14) | def __init__(self, C, n_comps=3, norm='none', activ='none', C_in=None): method forward (line 19) | def forward(self, comps): class Decoder (line 30) | class Decoder(nn.Module): method __init__ (line 31) | def __init__(self, C, C_out, size, norm='IN', activ='relu', pad_type='... method forward (line 62) | def forward(self, comps, skips=None): FILE: models/discriminator.py class MultitaskDiscriminator (line 12) | class MultitaskDiscriminator(nn.Module): method __init__ (line 13) | def __init__(self, C, n_fonts, n_chars, use_rx=True, w_norm='spectral'... method forward (line 23) | def forward(self, x, font_indices, char_indices): class Discriminator (line 51) | class Discriminator(nn.Module): method __init__ (line 52) | def __init__(self, C, n_fonts, n_chars, activ='relu', gap_activ='relu'... method forward (line 75) | def forward(self, x, font_indices, char_indices, out_feats=False): method use_rx (line 89) | def use_rx(self): FILE: models/ma_core.py class MACore (line 12) | class MACore(nn.Module): method __init__ (line 14) | def __init__(self, C_in, C, C_out, comp_enc, dec, n_comps, n_comp_type... method reset_dynamic_memory (line 46) | def reset_dynamic_memory(self): method encode_write (line 51) | def encode_write(self, style_ids, comp_ids, style_imgs, reset_dynamic_... method read_decode (line 73) | def read_decode(self, target_style_ids, target_comp_ids): FILE: models/memory.py function comp_id_to_addr (line 14) | def comp_id_to_addr(ids, language): class DynamicMemory (line 34) | class DynamicMemory(nn.Module): method __init__ (line 36) | def __init__(self): method write (line 41) | def write(self, style_ids, comp_addrs, comp_feats): method read (line 59) | def read(self, style_ids, comp_addrs, reduction='mean'): method write_point (line 81) | def write_point(self, style_id, comp_addr, data): method read_point (line 86) | def read_point(self, style_id, comp_addr, reduction='mean'): method reduce_features (line 91) | def reduce_features(self, feats, reduction='mean'): method reset (line 106) | def reset(self): method reset_batch (line 109) | def reset_batch(self, style_ids, comp_addrs): method reset_point (line 114) | def reset_point(self, style_id, comp_addr): class PersistentMemory (line 118) | class PersistentMemory(nn.Module): method __init__ (line 119) | def __init__(self, n_comps, mem_shape): method read (line 135) | def read(self, comp_addrs): method forward (line 140) | def forward(self, x, comp_addrs): class Memory (line 156) | class Memory(nn.Module): method __init__ (line 160) | def __init__(self, mem_shape, n_comps, persistent, language): method write (line 175) | def write(self, style_ids, comp_ids, comp_feats): method read (line 180) | def read(self, style_ids, comp_ids): method reset_style (line 194) | def reset_style(self, style_ids): method write_style (line 198) | def write_style(self, style_ids, style_codes): method read_style (line 202) | def read_style(self, style_ids): method get_style_addr (line 206) | def get_style_addr(self, N): method reset_dynamic (line 209) | def reset_dynamic(self): FILE: models/modules/blocks.py class Flatten (line 13) | class Flatten(nn.Module): method __init__ (line 14) | def __init__(self, start_dim=1, end_dim=-1): method forward (line 19) | def forward(self, input): function dispatcher (line 23) | def dispatcher(dispatch_fn): function norm_dispatch (line 36) | def norm_dispatch(norm): function w_norm_dispatch (line 45) | def w_norm_dispatch(w_norm): function activ_dispatch (line 54) | def activ_dispatch(activ): function pad_dispatch (line 63) | def pad_dispatch(pad_type): class LinearBlock (line 71) | class LinearBlock(nn.Module): method __init__ (line 73) | def __init__(self, C_in, C_out, norm='none', activ='relu', bias=True, ... method forward (line 90) | def forward(self, x): class ConvBlock (line 98) | class ConvBlock(nn.Module): method __init__ (line 100) | def __init__(self, C_in, C_out, kernel_size=3, stride=1, padding=1, no... method forward (line 123) | def forward(self, x): class ResBlock (line 136) | class ResBlock(nn.Module): method __init__ (line 138) | def __init__(self, C_in, C_out, kernel_size=3, padding=1, upsample=Fal... method forward (line 157) | def forward(self, x): class Upsample1x1 (line 177) | class Upsample1x1(nn.Module): method __init__ (line 179) | def __init__(self, C_in, C_out, norm='none', activ='relu', w_norm='non... method forward (line 188) | def forward(self, x): class HourGlass (line 195) | class HourGlass(nn.Module): method __init__ (line 197) | def __init__(self, C_in, C_max, size, n_downs, n_mids=1, norm='none', ... method forward (line 235) | def forward(self, x): FILE: models/modules/modules.py function split_dim (line 8) | def split_dim(x, dim, n_chunks): function weights_init (line 14) | def weights_init(init_type='default'): function spectral_norm (line 43) | def spectral_norm(module): FILE: models/modules/self_attention.py class Attention (line 13) | class Attention(nn.Module): method __init__ (line 14) | def __init__(self, C_in_q, C_in_kv, C_qk, C_v, w_norm='none', scale=Fa... method forward (line 47) | def forward(self, x, y): class AttentionFFNBlock (line 84) | class AttentionFFNBlock(nn.Module): method __init__ (line 86) | def __init__(self, C_in_q, C_in_kv, C_qk, C_v, size, scale=True, norm=... method forward (line 108) | def forward(self, x, y): class SAFFNBlock (line 120) | class SAFFNBlock(AttentionFFNBlock): method __init__ (line 121) | def __init__(self, C, size, C_qk_ratio=0.25, scale=True, norm='ln', dr... method forward (line 135) | def forward(self, x): class GlobalContext (line 139) | class GlobalContext(nn.Module): method __init__ (line 141) | def __init__(self, C, bottleneck_ratio=0.25, w_norm='none'): method forward (line 153) | def forward(self, x): class GCBlock (line 163) | class GCBlock(nn.Module): method __init__ (line 165) | def __init__(self, C, bottleneck_ratio=0.25, w_norm='none'): method forward (line 169) | def forward(self, x): class RelativePositionalEmbedding2d (line 174) | class RelativePositionalEmbedding2d(nn.Module): method __init__ (line 178) | def __init__(self, emb_dim, H, W, down_kv=False): method rel_grid (line 191) | def rel_grid(self): method forward (line 216) | def forward(self, query): FILE: scripts/prepare_dataset.py function get_code_points (line 29) | def get_code_points(language): function dump_to_hdf5 (line 39) | def dump_to_hdf5(dump_path, font_name, images, chars, compression=None): class FontProcessor (line 51) | class FontProcessor(object): method __init__ (line 52) | def __init__(self, language, resize_method="bilinear", font_size_facto... method ord (line 67) | def ord(self, char): method is_renderable_char (line 75) | def is_renderable_char(self, font, ch): method avail_chars (line 90) | def avail_chars(self, targetfontpath, pilfont): method get_charsize (line 97) | def get_charsize(self, char, font): method render_center_no_offset (line 104) | def render_center_no_offset(self, char, font, fontmaxsize, size=128, m... method dump_fonts (line 145) | def dump_fonts(self, fonts, dump_dir, compression=None): method fix_char_order_if_thai (line 211) | def fix_char_order_if_thai(self, char): function main (line 222) | def main(language, fonts_dir, meta_path, dump_dir): FILE: ssim.py function gaussian (line 11) | def gaussian(window_size, sigma): function create_window (line 18) | def create_window(window_size, channel=1): function ssim (line 25) | def ssim(img1, img2, window_size=11, window=None, size_average=True, ful... function msssim (line 77) | def msssim(img1, img2, weights=None, window_size=11, window=None, size_a... class SSIM (line 111) | class SSIM(torch.nn.Module): method __init__ (line 112) | def __init__(self, window_size=11, size_average=True, val_range=None, ... method forward (line 122) | def forward(self, img1, img2): class MSSSIM (line 131) | class MSSSIM(torch.nn.Module): method __init__ (line 132) | def __init__(self, weights=None, window_size=11, size_average=True, va... method forward (line 147) | def forward(self, img1, img2): FILE: train.py function get_dset_loader (line 30) | def get_dset_loader(data, avail_fonts, avail_chars, transform, shuffle, ... function get_val_dset_loader (line 46) | def get_val_dset_loader(data, avail_fonts, avail_chars, trn_avail_chars,... function setup_args_and_config (line 69) | def setup_args_and_config(): function setup_language_dependent (line 105) | def setup_language_dependent(cfg): function setup_data (line 120) | def setup_data(cfg, val_transform): function setup_cv_dset_loader (line 136) | def setup_cv_dset_loader(hdf5_data, meta, val_transform, n_comp_types, c... function main (line 166) | def main(): FILE: trainer.py function has_bn (line 19) | def has_bn(model): function load_checkpoint (line 27) | def load_checkpoint(path, gen, disc, aux_clf, g_optim, d_optim, ac_optim): class Trainer (line 47) | class Trainer: method __init__ (line 48) | def __init__(self, gen, disc, g_optim, d_optim, aux_clf, ac_optim, method clear_losses (line 69) | def clear_losses(self): method accum_g (line 85) | def accum_g(self, decay=0.999): method sync_g_ema (line 92) | def sync_g_ema(self, style_ids, style_comp_ids, style_imgs, trg_ids, t... method train (line 101) | def train(self, loader, st_step=1, val=None): method add_pixel_loss (line 240) | def add_pixel_loss(self, out, target): method add_gan_g_loss (line 246) | def add_gan_g_loss(self, real, real_font, real_char, fake, fake_font, ... method add_gan_d_loss (line 260) | def add_gan_d_loss(self, real, real_font, real_char, fake, fake_font, ... method add_fm_loss (line 274) | def add_fm_loss(self, real_feats, fake_feats): method add_ac_losses_and_update_stats (line 287) | def add_ac_losses_and_update_stats(self, comp_feats, style_comp_ids, g... method infer_ac (line 305) | def infer_ac(self, comp_feats, comp_ids): method d_backward (line 319) | def d_backward(self): method g_backward (line 324) | def g_backward(self): method ac_backward (line 329) | def ac_backward(self, retain_graph): method save (line 344) | def save(self, cur_loss, method, save_freq=None): method plot (line 401) | def plot(self, losses, discs, stats): method log (line 439) | def log(self, losses, discs, stats): FILE: utils/utils.py class AverageMeter (line 13) | class AverageMeter(): method __init__ (line 15) | def __init__(self): method reset (line 18) | def reset(self): method update (line 25) | def update(self, val, n=1): method __repr__ (line 32) | def __repr__(self): class AverageMeters (line 36) | class AverageMeters(): method __init__ (line 37) | def __init__(self, *keys): method resets (line 42) | def resets(self): method updates (line 46) | def updates(self, dic, n=1): method __repr__ (line 50) | def __repr__(self): function accuracy (line 54) | def accuracy(out, target): function temporary_freeze (line 64) | def temporary_freeze(module): function freeze (line 70) | def freeze(module): function unfreeze (line 83) | def unfreeze(module, org=None): function makedirs (line 95) | def makedirs(path): function rm (line 104) | def rm(path): function cp (line 112) | def cp(src, dst): function timestamp (line 116) | def timestamp(fmt="%y%m%d_%H-%M-%S"): FILE: utils/visualize.py function make_merged_grid (line 11) | def make_merged_grid(batchs, merge_dim, **kwargs): function make_comparable_grid (line 30) | def make_comparable_grid(*batches, nrow): function normalize (line 48) | def normalize(tensor, eps=1e-5): function to_grid (line 57) | def to_grid(tensor, to, **kwargs): function save_tensor_to_image (line 82) | def save_tensor_to_image(tensor, filepath, scale=None): function textboxes (line 97) | def textboxes(chars, data): FILE: utils/writer.py class Writer (line 11) | class Writer: method add_scalars (line 12) | def add_scalars(self, tag_scalar_dic, global_step): method add_image (line 15) | def add_image(self, tag, img_tensor, global_step): class DiskWriter (line 19) | class DiskWriter(Writer): method __init__ (line 20) | def __init__(self, img_path, scale=None): method add_scalars (line 25) | def add_scalars(self, tag_scalar_dic, global_step): method add_image (line 28) | def add_image(self, tag, img_tensor, global_step): class TBWriter (line 33) | class TBWriter(Writer): method __init__ (line 34) | def __init__(self, dir_path, scale=None): method add_scalars (line 39) | def add_scalars(self, tag_scalar_dic, global_step): method add_image (line 43) | def add_image(self, tag, img_tensor, global_step): class TBDiskWriter (line 52) | class TBDiskWriter(TBWriter): method __init__ (line 53) | def __init__(self, dir_path, img_path, scale=None): method add_image (line 58) | def add_image(self, tag, img_tensor, global_step):