SYMBOL INDEX (689 symbols across 50 files) FILE: accelerate/accelerate_inception.py function info (line 14) | def info(x): function sample_data (line 18) | def sample_data(loader): class VGG19 (line 24) | class VGG19(th.nn.Module): method __init__ (line 30) | def __init__(self, requires_grad=False): method forward (line 52) | def forward(self, X): class VGGLoss (line 62) | class VGGLoss(th.nn.Module): method __init__ (line 68) | def __init__(self): method forward (line 74) | def forward(self, x, y): function train (line 82) | def train(latent_dim, num_repeats, learning_rate, lambda_vgg, lambda_mse): FILE: accelerate/accelerate_logcosh.py function data_sampler (line 14) | def data_sampler(dataset, shuffle, distributed): function sample_data (line 23) | def sample_data(loader): class VGG19 (line 29) | class VGG19(th.nn.Module): method __init__ (line 35) | def __init__(self, requires_grad=False): method forward (line 57) | def forward(self, X): class VGGLoss (line 67) | class VGGLoss(th.nn.Module): method __init__ (line 73) | def __init__(self): method forward (line 79) | def forward(self, x, y): function train (line 93) | def train(latent_dim, learning_rate, number_filters, vae_alpha, vae_beta... FILE: accelerate/accelerate_segnet.py function info (line 13) | def info(x): function sample_data (line 17) | def sample_data(loader): class VGG19 (line 23) | class VGG19(th.nn.Module): method __init__ (line 29) | def __init__(self, requires_grad=False): method forward (line 51) | def forward(self, X): class VGGLoss (line 61) | class VGGLoss(th.nn.Module): method __init__ (line 67) | def __init__(self): method forward (line 73) | def forward(self, x, y): function align (line 81) | def align(x, y, alpha=2): function uniform (line 85) | def uniform(x, t=2): function train (line 89) | def train(learning_rate, lambda_mse): FILE: audioreactive/bend.py class NetworkBend (line 12) | class NetworkBend(th.nn.Module): method __init__ (line 20) | def __init__(self, sequential_fn, modulation): method forward (line 24) | def forward(self, x): class AddNoise (line 28) | class AddNoise(th.nn.Module): method __init__ (line 35) | def __init__(self, noise): method forward (line 39) | def forward(self, x): class Print (line 43) | class Print(th.nn.Module): method forward (line 46) | def forward(self, x): class Translate (line 51) | class Translate(NetworkBend): method __init__ (line 61) | def __init__(self, modulation, h, w, noise): class Zoom (line 73) | class Zoom(NetworkBend): method __init__ (line 82) | def __init__(self, modulation, h, w): class Rotate (line 88) | class Rotate(NetworkBend): method __init__ (line 97) | def __init__(self, modulation, h, w): FILE: audioreactive/examples/default.py function initialize (line 6) | def initialize(args): function get_latents (line 12) | def get_latents(selection, args): function get_noise (line 28) | def get_noise(height, width, scale, num_scales, args): FILE: audioreactive/examples/kelp.py function initialize (line 18) | def initialize(args): function get_latents (line 38) | def get_latents(selection, args): function get_noise (line 90) | def get_noise(height, width, scale, num_scales, args): function get_bends (line 113) | def get_bends(args): FILE: audioreactive/examples/tauceti.py function initialize (line 23) | def initialize(args): function get_latents (line 29) | def get_latents(selection, args): function get_noise (line 75) | def get_noise(height, width, scale, num_scales, args): function get_bends (line 94) | def get_bends(args): FILE: audioreactive/examples/temper.py function initialize (line 14) | def initialize(args): function get_latents (line 22) | def get_latents(selection, args): function circular_mask (line 41) | def circular_mask(h, w, center=None, radius=None, soft=0): function get_noise (line 57) | def get_noise(height, width, scale, num_scales, args): FILE: audioreactive/latent.py function chroma_weight_latents (line 15) | def chroma_weight_latents(chroma, latents): function slerp (line 29) | def slerp(val, low, high): function slerp_loops (line 48) | def slerp_loops(latent_selection, n_frames, n_loops, smoothing=1, loop=T... function spline_loops (line 85) | def spline_loops(latent_selection, n_frames, n_loops, loop=True): function wrapping_slice (line 113) | def wrapping_slice(tensor, start, length, return_indices=False): function generate_latents (line 136) | def generate_latents(n_latents, ckpt, G_res, noconst=False, latent_dim=5... function save_latents (line 162) | def save_latents(latents, filename): function load_latents (line 172) | def load_latents(filename): function _perlinterpolant (line 184) | def _perlinterpolant(t): function perlin_noise (line 188) | def perlin_noise(shape, res, tileable=(True, False, False), interpolant=... FILE: audioreactive/signal.py function set_SMF (line 21) | def set_SMF(smf): function onsets (line 31) | def onsets(audio, sr, n_frames, margin=8, fmin=20, fmax=8000, smooth=1, ... function rms (line 76) | def rms(y, sr, n_frames, fmin=20, fmax=8000, smooth=180, clip=50, power=6): function raw_chroma (line 102) | def raw_chroma(audio, sr, type="cens", nearest_neighbor=True): function chroma (line 136) | def chroma(audio, sr, n_frames, margin=16, type="cens", notes=12): function laplacian_segmentation (line 159) | def laplacian_segmentation(signal, sr, k=5, plot=False): function normalize (line 243) | def normalize(signal): function percentile (line 257) | def percentile(signal, p): function percentile_clip (line 271) | def percentile_clip(signal, p): function compress (line 295) | def compress(signal, threshold, ratio, invert=False): function expand (line 314) | def expand(signal, threshold, ratio, invert=False): function gaussian_filter (line 319) | def gaussian_filter(x, sigma, causal=None): function load_audio (line 371) | def load_audio(audio_file, offset=0, duration=-1, cache=True): FILE: audioreactive/util.py function info (line 11) | def info(arr): function plot_signals (line 23) | def plot_signals(signals): function plot_spectra (line 41) | def plot_spectra(spectra, chroma=False): function plot_audio (line 61) | def plot_audio(audio, sr): function plot_chroma_comparison (line 77) | def plot_chroma_comparison(audio, sr): FILE: augment.py function translate_mat (line 25) | def translate_mat(t_x, t_y): function rotate_mat (line 35) | def rotate_mat(theta): function scale_mat (line 47) | def scale_mat(s_x, s_y): function translate3d_mat (line 57) | def translate3d_mat(t_x, t_y, t_z): function rotate3d_mat (line 67) | def rotate3d_mat(axis, theta): function scale3d_mat (line 88) | def scale3d_mat(s_x, s_y, s_z): function luma_flip_mat (line 99) | def luma_flip_mat(axis, i): function saturation_mat (line 109) | def saturation_mat(axis, i): function lognormal_sample (line 120) | def lognormal_sample(size, mean=0, std=1): function category_sample (line 124) | def category_sample(size, categories): function uniform_sample (line 131) | def uniform_sample(size, low, high): function normal_sample (line 135) | def normal_sample(size, mean=0, std=1): function bernoulli_sample (line 139) | def bernoulli_sample(size, p): function random_mat_apply (line 143) | def random_mat_apply(p, transform, prev, eye): function sample_affine (line 151) | def sample_affine(p, size, height, width): function sample_color (line 210) | def sample_color(p, size): function make_grid (line 244) | def make_grid(shape, x0, x1, y0, y1, device): function affine_grid (line 254) | def affine_grid(grid, mat): function get_padding (line 259) | def get_padding(G, height, width): function try_sample_affine_and_pad (line 270) | def try_sample_affine_and_pad(img, p, pad_k, G=None): function random_apply_affine (line 292) | def random_apply_affine(img, p, G=None, antialiasing_kernel=SYM6): function apply_color (line 344) | def apply_color(img, mat): function random_apply_color (line 355) | def random_apply_color(img, p, C=None): function augment (line 364) | def augment(img, p, transform_matrix=(None, None)): FILE: contrastive_learner.py function identity (line 10) | def identity(x): function default (line 14) | def default(val, def_val): function flatten (line 18) | def flatten(t): function safe_concat (line 22) | def safe_concat(arr, el, dim=0): function singleton (line 28) | def singleton(cache_key): function contrastive_loss (line 48) | def contrastive_loss(queries, keys, temperature=0.1): function nt_xent_loss (line 56) | def nt_xent_loss(queries, keys, temperature=0.1): class RandomApply (line 76) | class RandomApply(nn.Module): method __init__ (line 77) | def __init__(self, fn, p): method forward (line 82) | def forward(self, x): class EMA (line 95) | class EMA: method __init__ (line 96) | def __init__(self, beta): method update_average (line 100) | def update_average(self, old, new): function update_moving_average (line 106) | def update_moving_average(ema_updater, ma_model, current_model): class OutputHiddenLayer (line 115) | class OutputHiddenLayer(nn.Module): method __init__ (line 116) | def __init__(self, net, layer=-2): method _find_layer (line 124) | def _find_layer(self): method _register_hook (line 137) | def _register_hook(self): method forward (line 145) | def forward(self, x): class ContrastiveLearner (line 156) | class ContrastiveLearner(nn.Module): method __init__ (line 157) | def __init__( method _get_key_encoder (line 197) | def _get_key_encoder(self): method _get_bilinear (line 203) | def _get_bilinear(self, hidden): method _get_projection_fn (line 208) | def _get_projection_fn(self, hidden): method reset_moving_average (line 214) | def reset_moving_average(self): method update_moving_average (line 219) | def update_moving_average(self): method calculate_loss (line 223) | def calculate_loss(self): method forward (line 230) | def forward(self, x, aug_x, accumulate=False): FILE: convert_weight.py function convert_modconv (line 14) | def convert_modconv(vars, source_name, target_name, flip=False): function convert_conv (line 40) | def convert_conv(vars, source_name, target_name, bias=True, start=0): function convert_torgb (line 58) | def convert_torgb(vars, source_name, target_name): function convert_dense (line 79) | def convert_dense(vars, source_name, target_name): function update (line 93) | def update(state_dict, new): function discriminator_fill_statedict (line 104) | def discriminator_fill_statedict(statedict, vars, size): function fill_statedict (line 131) | def fill_statedict(state_dict, vars, size): FILE: dataset.py class MultiResolutionDataset (line 10) | class MultiResolutionDataset(Dataset): method __init__ (line 11) | def __init__(self, path, transform, resolution=256): method __len__ (line 23) | def __len__(self): method __getitem__ (line 26) | def __getitem__(self, index): FILE: distributed.py function get_rank (line 7) | def get_rank(): function synchronize (line 17) | def synchronize(): function get_world_size (line 32) | def get_world_size(): function reduce_sum (line 42) | def reduce_sum(tensor): function gather_grad (line 55) | def gather_grad(params): function all_gather (line 67) | def all_gather(data): function reduce_loss_dict (line 102) | def reduce_loss_dict(loss_dict): FILE: generate.py function generate (line 8) | def generate(args, g_ema, device, mean_latent): FILE: generate_audiovisual.py function get_noise_range (line 22) | def get_noise_range(out_size, generator_resolution, is_stylegan1): function load_generator (line 37) | def load_generator( function generate (line 59) | def generate( FILE: generate_video.py function gaussian_filter (line 14) | def gaussian_filter(x, sigma): function slerp (line 42) | def slerp(val, low, high): function lerp (line 50) | def lerp(val, low, high): function interpolant (line 54) | def interpolant(t): function perlin_noise (line 58) | def perlin_noise(shape, res, tileable=(True, False, False), interpolant=... function spline_loops (line 126) | def spline_loops(base_latent_selection, loop_starting_latents, n_frames,... function get_latent_loops (line 145) | def get_latent_loops(base_latent_selection, loop_starting_latents, n_fra... function create_circular_mask (line 277) | def create_circular_mask(h, w, center=None, radius=None): class addNoise (line 462) | class addNoise(th.nn.Module): method __init__ (line 463) | def __init__(self, noise): method forward (line 467) | def forward(self, x): FILE: gpu_profile.py function gpu_profile (line 28) | def gpu_profile(frame, event, arg): function get_tensors (line 95) | def get_tensors(gpu_only=True): FILE: gpumon.py function enqueue_output (line 26) | def enqueue_output(out, queue): FILE: lightning.py function requires_grad (line 20) | def requires_grad(model, flag=True): function get_spectral_norms (line 25) | def get_spectral_norms(model): class StyleGAN2 (line 33) | class StyleGAN2(pl.LightningModule): method __init__ (line 34) | def __init__(self, hparams): method forward (line 50) | def forward(self, z): method accumulate_g (line 53) | def accumulate_g(self, decay=0.5 ** (32.0 / (10_000))): method configure_optimizers (line 59) | def configure_optimizers(self): method configure_apex (line 72) | def configure_apex(self, amp, model, optimizers, amp_level): method train_dataloader (line 83) | def train_dataloader(self): method d_logistic_loss (line 96) | def d_logistic_loss(self, real_pred, fake_pred): method d_r1_loss (line 101) | def d_r1_loss(self, real_pred, real_img): method g_nonsaturating_loss (line 106) | def g_nonsaturating_loss(self, fake_pred): method g_path_regularize (line 110) | def g_path_regularize(self, fake_img, latents, mean_path_length, decay... method make_noise (line 119) | def make_noise(self, batch, batch_size=None): method training_step (line 127) | def training_step(self, real_img, batch_idx, optimizer_idx): method backward (line 202) | def backward(self, trainer, loss, optimizer, optimizer_idx): method optimizer_step (line 212) | def optimizer_step(self, cur_epoch, batch_idx, optimizer, optimizer_id... method prepare_data (line 224) | def prepare_data(self): method val_dataloader (line 227) | def val_dataloader(self): method validation_step (line 230) | def validation_step(self, batch, batch_idx): method validation_epoch_end (line 250) | def validation_epoch_end(self, outputs): FILE: lookahead_minimax.py class LookaheadMinimax (line 7) | class LookaheadMinimax(Optimizer): method __init__ (line 19) | def __init__(self, G_optimizer, D_optimizer, la_steps=5, la_alpha=0.5,... method __getstate__ (line 59) | def __getstate__(self): method zero_grad (line 70) | def zero_grad(self): method get_la_step (line 73) | def get_la_step(self): method state_dict (line 76) | def state_dict(self): method load_state_dict (line 79) | def load_state_dict(self, G_state_dict, D_state_dict): method _backup_and_load_cache (line 100) | def _backup_and_load_cache(self): method _clear_and_load_backup (line 118) | def _clear_and_load_backup(self): method param_groups (line 132) | def param_groups(self): method step (line 135) | def step(self, closure=None): FILE: lucidrains.py class NanException (line 59) | class NanException(Exception): class EMA (line 63) | class EMA: method __init__ (line 64) | def __init__(self, beta): method update_average (line 68) | def update_average(self, old, new): class Flatten (line 74) | class Flatten(nn.Module): method forward (line 75) | def forward(self, x): class Residual (line 79) | class Residual(nn.Module): method __init__ (line 80) | def __init__(self, fn): method forward (line 84) | def forward(self, x): class Rezero (line 88) | class Rezero(nn.Module): method __init__ (line 89) | def __init__(self, fn): method forward (line 94) | def forward(self, x): class PermuteToFrom (line 98) | class PermuteToFrom(nn.Module): method __init__ (line 99) | def __init__(self, fn): method forward (line 103) | def forward(self, x): function default (line 113) | def default(value, d): function cycle (line 117) | def cycle(iterable): function cast_list (line 123) | def cast_list(el): function is_empty (line 127) | def is_empty(t): function raise_if_nan (line 133) | def raise_if_nan(t): function loss_backwards (line 138) | def loss_backwards(fp16, loss, optimizer, **kwargs): function gradient_penalty (line 146) | def gradient_penalty(images, output, weight=10): function noise (line 161) | def noise(n, latent_dim): function noise_list (line 165) | def noise_list(n, layers, latent_dim): function mixed_list (line 169) | def mixed_list(n, layers, latent_dim): function latent_to_w (line 174) | def latent_to_w(style_vectorizer, latent_descr): function image_noise (line 178) | def image_noise(n, im_size): function leaky_relu (line 182) | def leaky_relu(p=0.2): function evaluate_in_chunks (line 186) | def evaluate_in_chunks(max_batch_size, model, *args): function styles_def_to_tensor (line 194) | def styles_def_to_tensor(styles_def): function set_requires_grad (line 198) | def set_requires_grad(model, bool): function convert_rgb_to_transparent (line 206) | def convert_rgb_to_transparent(image): function convert_transparent_to_rgb (line 212) | def convert_transparent_to_rgb(image): class expand_greyscale (line 218) | class expand_greyscale(object): method __init__ (line 219) | def __init__(self, num_channels): method __call__ (line 222) | def __call__(self, tensor): function resize_to_minimum_size (line 226) | def resize_to_minimum_size(min_size, image): class Dataset (line 232) | class Dataset(data.Dataset): method __init__ (line 233) | def __init__(self, folder, image_size, transparent=False): method __len__ (line 254) | def __len__(self): method __getitem__ (line 257) | def __getitem__(self, index): class StyleVectorizer (line 266) | class StyleVectorizer(nn.Module): method __init__ (line 267) | def __init__(self, emb, depth): method forward (line 276) | def forward(self, x): class RGBBlock (line 280) | class RGBBlock(nn.Module): method __init__ (line 281) | def __init__(self, latent_dim, input_channel, upsample, rgba=False): method forward (line 291) | def forward(self, x, prev_rgb, istyle): class Conv2DMod (line 305) | class Conv2DMod(nn.Module): method __init__ (line 306) | def __init__(self, in_chan, out_chan, kernel, demod=True, stride=1, di... method _get_same_padding (line 316) | def _get_same_padding(self, size, kernel, dilation, stride): method forward (line 319) | def forward(self, x, y): class GeneratorBlock (line 342) | class GeneratorBlock(nn.Module): method __init__ (line 343) | def __init__(self, latent_dim, input_channels, filters, upsample=True,... method forward (line 358) | def forward(self, x, prev_rgb, istyle, inoise): class DiscriminatorBlock (line 378) | class DiscriminatorBlock(nn.Module): method __init__ (line 379) | def __init__(self, input_channels, filters, downsample=True): method forward (line 392) | def forward(self, x): class Generator (line 401) | class Generator(nn.Module): method __init__ (line 402) | def __init__(self, image_size, latent_dim, network_capacity=16, transp... method forward (line 434) | def forward(self, styles, input_noise): class Discriminator (line 449) | class Discriminator(nn.Module): method __init__ (line 450) | def __init__( method forward (line 492) | def forward(self, x): class StyleGAN2 (line 512) | class StyleGAN2(nn.Module): method __init__ (line 513) | def __init__( method _init_weights (line 597) | def _init_weights(self): method EMA (line 608) | def EMA(self): method reset_parameter_averaging (line 617) | def reset_parameter_averaging(self): method forward (line 621) | def forward(self, x): class Trainer (line 625) | class Trainer: method __init__ (line 626) | def __init__( method init_GAN (line 702) | def init_GAN(self): method write_config (line 718) | def write_config(self): method load_config (line 721) | def load_config(self): method config (line 732) | def config(self): method set_data_src (line 742) | def set_data_src(self, folder): method train (line 756) | def train(self): method evaluate (line 947) | def evaluate(self, num=0, num_image_tiles=8): method calculate_fid (line 993) | def calculate_fid(self): method calculate_ppl (line 1045) | def calculate_ppl(self): method generate_truncated (line 1099) | def generate_truncated(self, S, G, style, noi, trunc_psi=0.75, num_ima... method print_log (line 1119) | def print_log(self): method model_name (line 1124) | def model_name(self, num): method init_folders (line 1127) | def init_folders(self): method clear (line 1131) | def clear(self): method save (line 1137) | def save(self, num): method load (line 1141) | def load(self, num=-1): FILE: models/autoencoder.py function info (line 13) | def info(x): class PrintShape (line 17) | class PrintShape(th.nn.Module): method __init__ (line 18) | def __init__(self): method forward (line 21) | def forward(self, x): class Flatten (line 26) | class Flatten(th.nn.Module): method forward (line 27) | def forward(self, x): class UnFlatten (line 31) | class UnFlatten(th.nn.Module): method __init__ (line 32) | def __init__(self, channels, size): method forward (line 37) | def forward(self, x): class LogCoshVAE (line 41) | class LogCoshVAE(th.nn.Module): method __init__ (line 47) | def __init__(self, in_channels, latent_dim, hidden_dims=None, alpha=10... method encode (line 104) | def encode(self, input): method decode (line 113) | def decode(self, z): method reparameterize (line 120) | def reparameterize(self, mu, logvar): method forward (line 125) | def forward(self, input): method loss (line 130) | def loss(self, real, fake, mu, log_var): class conv2DBatchNormRelu (line 143) | class conv2DBatchNormRelu(th.nn.Module): method __init__ (line 144) | def __init__( method forward (line 166) | def forward(self, inputs): class segnetDown2 (line 171) | class segnetDown2(th.nn.Module): method __init__ (line 172) | def __init__(self, in_size, out_size): method forward (line 178) | def forward(self, inputs): class segnetDown3 (line 186) | class segnetDown3(th.nn.Module): method __init__ (line 187) | def __init__(self, in_size, out_size): method forward (line 194) | def forward(self, inputs): class segnetUp2 (line 203) | class segnetUp2(th.nn.Module): method __init__ (line 204) | def __init__(self, in_size, out_size): method forward (line 210) | def forward(self, inputs, indices, output_shape): class segnetUp3 (line 217) | class segnetUp3(th.nn.Module): method __init__ (line 218) | def __init__(self, in_size, out_size): method forward (line 225) | def forward(self, inputs, indices, output_shape): class SegNet (line 233) | class SegNet(th.nn.Module): method __init__ (line 239) | def __init__(self, in_channels=3): method random_indices (line 254) | def random_indices(self, shape): method encode (line 261) | def encode(self, inputs): method decode (line 269) | def decode(self, inp): method forward (line 286) | def forward(self, inputs): method init_vgg16_params (line 301) | def init_vgg16_params(self, vgg16): class ConvSegNet (line 337) | class ConvSegNet(th.nn.Module): method __init__ (line 343) | def __init__(self, in_channels=3): method encode (line 389) | def encode(self, inputs): method decode (line 392) | def decode(self, inputs): method forward (line 395) | def forward(self, inputs): class VariationalConvSegNet (line 401) | class VariationalConvSegNet(th.nn.Module): method __init__ (line 407) | def __init__(self, in_channels=3): method reparameterize (line 459) | def reparameterize(self, mu, log_var): method encode (line 464) | def encode(self, inputs): method decode (line 472) | def decode(self, inputs): method forward (line 475) | def forward(self, inputs): function create_encoder_single_conv (line 481) | def create_encoder_single_conv(in_chs, out_chs, kernel): class EncoderInceptionModuleSignle (line 490) | class EncoderInceptionModuleSignle(th.nn.Module): method __init__ (line 491) | def __init__(self, channels): method forward (line 506) | def forward(self, x): class EncoderModule (line 513) | class EncoderModule(th.nn.Module): method __init__ (line 514) | def __init__(self, chs, repeat_num, use_inception): method forward (line 522) | def forward(self, x): class Encoder (line 526) | class Encoder(th.nn.Module): method __init__ (line 527) | def __init__(self, use_inception, repeat_per_module): method _create_downsampling_module (line 539) | def _create_downsampling_module(self, input_channels, pooling_kenel): method forward (line 547) | def forward(self, x): function create_decoder_single_conv (line 563) | def create_decoder_single_conv(in_chs, out_chs, kernel): class DecoderInceptionModuleSingle (line 572) | class DecoderInceptionModuleSingle(th.nn.Module): method __init__ (line 573) | def __init__(self, channels): method forward (line 588) | def forward(self, x): class DecoderModule (line 595) | class DecoderModule(th.nn.Module): method __init__ (line 596) | def __init__(self, chs, repeat_num, use_inception): method forward (line 604) | def forward(self, x): class Decoder (line 608) | class Decoder(th.nn.Module): method __init__ (line 609) | def __init__(self, use_inception, repeat_per_module): method _create_upsampling_module (line 622) | def _create_upsampling_module(self, input_channels, pooling_kenel): method forward (line 629) | def forward(self, x): class InceptionVAE (line 639) | class InceptionVAE(th.nn.Module): method __init__ (line 644) | def __init__(self, latent_dim=512, repeat_per_block=1, use_inception=T... method _reparameterize (line 659) | def _reparameterize(self, mu, logvar): method _bottleneck (line 665) | def _bottleneck(self, h): method sampling (line 670) | def sampling(self): method forward (line 677) | def forward(self, x): FILE: models/stylegan1.py class MyLinear (line 12) | class MyLinear(nn.Module): method __init__ (line 15) | def __init__( method forward (line 34) | def forward(self, x): class MyConv2d (line 41) | class MyConv2d(nn.Module): method __init__ (line 44) | def __init__( method forward (line 77) | def forward(self, x): class NoiseLayer (line 108) | class NoiseLayer(nn.Module): method __init__ (line 111) | def __init__(self, channels): method forward (line 116) | def forward(self, x): class StyleMod (line 126) | class StyleMod(nn.Module): method __init__ (line 127) | def __init__(self, latent_size, channels, use_wscale): method forward (line 131) | def forward(self, x, latent): class PixelNormLayer (line 139) | class PixelNormLayer(nn.Module): method __init__ (line 140) | def __init__(self, epsilon=1e-8): method forward (line 144) | def forward(self, x): class BlurLayer (line 148) | class BlurLayer(nn.Module): method __init__ (line 149) | def __init__(self, kernel=[1, 2, 1], normalize=True, flip=False, strid... method forward (line 162) | def forward(self, x): function upscale2d (line 169) | def upscale2d(x, factor=2, gain=1): class Upscale2d (line 180) | class Upscale2d(nn.Module): method __init__ (line 181) | def __init__(self, factor=2, gain=1): method forward (line 187) | def forward(self, x): class G_mapping (line 191) | class G_mapping(nn.Sequential): method __init__ (line 192) | def __init__(self, nonlinearity="lrelu", use_wscale=True): method forward (line 217) | def forward(self, x): class Truncation (line 224) | class Truncation(nn.Module): method __init__ (line 225) | def __init__(self, avg_latent, max_layer=8, threshold=0.7): method forward (line 231) | def forward(self, x): class LayerEpilogue (line 238) | class LayerEpilogue(nn.Module): method __init__ (line 241) | def __init__( method forward (line 290) | def forward(self, x, dlatents_in_slice, noise): class InputBlock (line 318) | class InputBlock(nn.Module): method __init__ (line 319) | def __init__( method forward (line 351) | def forward(self, dlatents_in_range, noise): class GSynthesisBlock (line 364) | class GSynthesisBlock(nn.Module): method __init__ (line 365) | def __init__( method forward (line 410) | def forward(self, x, dlatents_in_range, noise): class G_synthesis (line 418) | class G_synthesis(nn.Module): method __init__ (line 419) | def __init__( method forward (line 497) | def forward(self, dlatents_in, noise): class G_style (line 509) | class G_style(nn.Sequential): method __init__ (line 510) | def __init__(self, output_size=1920, checkpoint=None): method mean_latent (line 576) | def mean_latent(self, n_latent): method forward (line 581) | def forward( FILE: models/stylegan2.py class PixelNorm (line 15) | class PixelNorm(nn.Module): method __init__ (line 16) | def __init__(self): method forward (line 19) | def forward(self, inputs): function make_kernel (line 23) | def make_kernel(k): class Upsample (line 34) | class Upsample(nn.Module): method __init__ (line 35) | def __init__(self, kernel, factor=2): method forward (line 49) | def forward(self, inputs): class Downsample (line 55) | class Downsample(nn.Module): method __init__ (line 56) | def __init__(self, kernel, factor=2): method forward (line 70) | def forward(self, inputs): class Blur (line 76) | class Blur(nn.Module): method __init__ (line 77) | def __init__(self, kernel, pad, upsample_factor=1): method forward (line 89) | def forward(self, inputs): class EqualConv2d (line 95) | class EqualConv2d(nn.Module): method __init__ (line 96) | def __init__(self, in_channel, out_channel, kernel_size, stride=1, pad... method forward (line 111) | def forward(self, inputs): method __repr__ (line 116) | def __repr__(self): class EqualLinear (line 123) | class EqualLinear(nn.Module): method __init__ (line 124) | def __init__(self, in_dim, out_dim, bias=True, bias_init=0, lr_mul=1, ... method forward (line 140) | def forward(self, inputs): method __repr__ (line 148) | def __repr__(self): class ScaledLeakyReLU (line 152) | class ScaledLeakyReLU(nn.Module): method __init__ (line 153) | def __init__(self, negative_slope=0.2): method forward (line 158) | def forward(self, inputs): class ModulatedConv2d (line 164) | class ModulatedConv2d(nn.Module): method __init__ (line 165) | def __init__( method __repr__ (line 211) | def __repr__(self): method forward (line 217) | def forward(self, inputs, style): class NoiseInjection (line 257) | class NoiseInjection(nn.Module): method __init__ (line 258) | def __init__(self): method forward (line 262) | def forward(self, image, noise=None): class ConstantInput (line 269) | class ConstantInput(nn.Module): method __init__ (line 270) | def __init__(self, channel, size=4): method forward (line 275) | def forward(self, inputs): class LatentInput (line 281) | class LatentInput(nn.Module): method __init__ (line 282) | def __init__(self, latent_dim, channel, size=4): method forward (line 290) | def forward(self, inputs): class ManipulationLayer (line 297) | class ManipulationLayer(th.nn.Module): method __init__ (line 298) | def __init__(self, layer): method forward (line 302) | def forward(self, input, tranforms_dict_list): class StyledConv (line 310) | class StyledConv(nn.Module): method __init__ (line 311) | def __init__( method forward (line 338) | def forward(self, inputs, style, noise=None, transform_dict_list=[]): class ToRGB (line 346) | class ToRGB(nn.Module): method __init__ (line 347) | def __init__(self, in_channel, style_dim, upsample=True, blur_kernel=[... method forward (line 356) | def forward(self, inputs, style, skip=None): class Generator (line 368) | class Generator(nn.Module): method __init__ (line 369) | def __init__( method make_noise (line 472) | def make_noise(self): method mean_latent (line 483) | def mean_latent(self, n_latent): method get_latent (line 489) | def get_latent(self, inputs): method forward (line 492) | def forward( class ConvLayer (line 579) | class ConvLayer(nn.Sequential): method __init__ (line 580) | def __init__( class ResBlock (line 623) | class ResBlock(nn.Module): method __init__ (line 624) | def __init__(self, in_channel, out_channel, blur_kernel=[1, 3, 3, 1], ... method forward (line 635) | def forward(self, inputs): class Discriminator (line 646) | class Discriminator(nn.Module): method __init__ (line 647) | def __init__(self, size, channel_multiplier=2, blur_kernel=[1, 3, 3, 1... method forward (line 685) | def forward(self, inputs): FILE: op/fused_act.py class FusedLeakyReLUFunctionBackward (line 20) | class FusedLeakyReLUFunctionBackward(Function): method forward (line 22) | def forward(ctx, grad_output, out, negative_slope, scale): method backward (line 43) | def backward(ctx, gradgrad_input, gradgrad_bias): class FusedLeakyReLUFunction (line 52) | class FusedLeakyReLUFunction(Function): method forward (line 54) | def forward(ctx, input, bias, negative_slope, scale): method backward (line 64) | def backward(ctx, grad_output): class FusedLeakyReLU (line 74) | class FusedLeakyReLU(nn.Module): method __init__ (line 75) | def __init__(self, channel, negative_slope=0.2, scale=2 ** 0.5): method forward (line 82) | def forward(self, input): function fused_leaky_relu (line 86) | def fused_leaky_relu(input, bias, negative_slope=0.2, scale=2 ** 0.5): FILE: op/fused_bias_act.cpp function fused_bias_act (line 11) | torch::Tensor fused_bias_act(const torch::Tensor& input, const torch::Te... function PYBIND11_MODULE (line 19) | PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) { FILE: op/upfirdn2d.cpp function upfirdn2d (line 12) | torch::Tensor upfirdn2d(const torch::Tensor& input, const torch::Tensor&... function PYBIND11_MODULE (line 21) | PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) { FILE: op/upfirdn2d.py class UpFirDn2dBackward (line 19) | class UpFirDn2dBackward(Function): method forward (line 21) | def forward( method backward (line 63) | def backward(ctx, gradgrad_input): class UpFirDn2d (line 88) | class UpFirDn2d(Function): method forward (line 90) | def forward(ctx, input, kernel, up, down, pad): method backward (line 127) | def backward(ctx, grad_output): function upfirdn2d (line 145) | def upfirdn2d(input, kernel, up=1, down=1, pad=(0, 0)): function upfirdn2d_native (line 159) | def upfirdn2d_native( FILE: prepare_data.py function resize_and_convert (line 16) | def resize_and_convert(img, size, resample, quality=100): function resize_multiple (line 26) | def resize_multiple(img, sizes=(128, 256, 512, 1024), resample=Image.LAN... function resize_worker (line 35) | def resize_worker(img_file, sizes, resample): function prepare (line 47) | def prepare(env, dataset, n_worker, sizes=(128, 256, 512, 1024), resampl... FILE: prepare_vae_codes.py function lmdmb_write_worker (line 15) | def lmdmb_write_worker(i_code, env, size): function prepare (line 22) | def prepare(env, vae, loader, total, batch_size, n_worker, size=1024): FILE: projector.py function noise_regularize (line 16) | def noise_regularize(noises): function noise_normalize_ (line 39) | def noise_normalize_(noises): function get_lr (line 47) | def get_lr(t, initial_lr, rampdown=0.25, rampup=0.05): function latent_noise (line 55) | def latent_noise(latent, strength): function make_image (line 61) | def make_image(tensor): FILE: render.py function render (line 14) | def render( function write_video (line 195) | def write_video(arr, output_file, fps): FILE: select_latents.py class HoverButton (line 29) | class HoverButton(tk.Button): method __init__ (line 30) | def __init__(self, master, **kw): method on_enter (line 36) | def on_enter(self, e): method on_leave (line 39) | def on_leave(self, e): class InvisibleScrollbar (line 43) | class InvisibleScrollbar(Scrollbar): method set (line 44) | def set(self, lo, hi): class Mousewheel_Support (line 49) | class Mousewheel_Support(object): method __new__ (line 53) | def __new__(cls, *args, **kwargs): method __init__ (line 58) | def __init__(self, root, horizontal_factor=1, vertical_factor=1): method _on_mousewheel (line 75) | def _on_mousewheel(self, event): method _mousewheel_bind (line 79) | def _mousewheel_bind(self, widget): method _mousewheel_unbind (line 82) | def _mousewheel_unbind(self): method add_support_to (line 85) | def add_support_to( method _make_mouse_wheel_handler (line 114) | def _make_mouse_wheel_handler(widget, orient, factor=1 / 120, what="un... class Scrolling_Area (line 137) | class Scrolling_Area(Frame, object): method __init__ (line 138) | def __init__( method width (line 189) | def width(self): method width (line 193) | def width(self, width): method height (line 197) | def height(self): method height (line 201) | def height(self, height): method set_size (line 204) | def set_size(self, width, height): method _on_canvas_configure (line 207) | def _on_canvas_configure(self, event): method update_viewport (line 213) | def update_viewport(self): function generate_images (line 262) | def generate_images(n): function render_latents (line 299) | def render_latents(latents): function save (line 318) | def save(): function add_intro (line 374) | def add_intro(label): function remove_intro (line 390) | def remove_intro(label): function add_drop (line 403) | def add_drop(label): function remove_drop (line 419) | def remove_drop(label): function add_images (line 432) | def add_images(n): FILE: train.py function data_sampler (line 31) | def data_sampler(dataset, shuffle, distributed): function requires_grad (line 40) | def requires_grad(model, flag=True): function accumulate (line 45) | def accumulate(model1, model2, decay=0.5 ** (32.0 / 10_000)): function sample_data (line 52) | def sample_data(loader): function make_noise (line 58) | def make_noise(batch_size, latent_dim, prob): function d_logistic_loss (line 65) | def d_logistic_loss(real_pred, fake_pred): function d_r1_penalty (line 71) | def d_r1_penalty(real_img, real_pred, args): function g_non_saturating_loss (line 78) | def g_non_saturating_loss(fake_pred): function g_path_length_regularization (line 82) | def g_path_length_regularization(generator, mean_path_length, args): function train (line 105) | def train(args, loader, generator, discriminator, contrast_learner, g_op... FILE: train_profile.py function data_sampler (line 32) | def data_sampler(dataset, shuffle, distributed): function requires_grad (line 41) | def requires_grad(model, flag=True): function accumulate (line 46) | def accumulate(model1, model2, decay=0.5 ** (32.0 / 10_000)): function sample_data (line 53) | def sample_data(loader): function make_noise (line 59) | def make_noise(batch_size, latent_dim, prob): function d_logistic_loss (line 66) | def d_logistic_loss(real_pred, fake_pred): function d_r1_penalty (line 72) | def d_r1_penalty(real_img, real_pred, args): function g_non_saturating_loss (line 79) | def g_non_saturating_loss(fake_pred): function g_path_length_regularization (line 83) | def g_path_length_regularization(generator, mean_path_length, args): function train (line 110) | def train(args, loader, generator, discriminator, contrast_learner, g_op... FILE: validation/calc_fid.py function extract_feature_from_samples (line 15) | def extract_feature_from_samples(generator, inception, truncation, trunc... function calc_fid (line 32) | def calc_fid(sample_mean, sample_cov, real_mean, real_cov, eps=1e-6): FILE: validation/calc_inception.py class Inception3Feature (line 18) | class Inception3Feature(Inception3): method forward (line 19) | def forward(self, x): function load_patched_inception_v3 (line 51) | def load_patched_inception_v3(): function extract_features (line 61) | def extract_features(loader, inception, device): FILE: validation/calc_ppl.py function normalize (line 12) | def normalize(x): function slerp (line 16) | def slerp(a, b, t): function lerp (line 27) | def lerp(a, b, t): FILE: validation/inception.py class InceptionV3 (line 18) | class InceptionV3(nn.Module): method __init__ (line 33) | def __init__( method forward (line 129) | def forward(self, inp): function fid_inception_v3 (line 163) | def fid_inception_v3(): class FIDInceptionA (line 188) | class FIDInceptionA(models.inception.InceptionA): method __init__ (line 191) | def __init__(self, in_channels, pool_features): method forward (line 194) | def forward(self, x): class FIDInceptionC (line 213) | class FIDInceptionC(models.inception.InceptionC): method __init__ (line 216) | def __init__(self, in_channels, channels_7x7): method forward (line 219) | def forward(self, x): class FIDInceptionE_1 (line 241) | class FIDInceptionE_1(models.inception.InceptionE): method __init__ (line 244) | def __init__(self, in_channels): method forward (line 247) | def forward(self, x): class FIDInceptionE_2 (line 274) | class FIDInceptionE_2(models.inception.InceptionE): method __init__ (line 277) | def __init__(self, in_channels): method forward (line 280) | def forward(self, x): FILE: validation/lpips/__init__.py class PerceptualLoss (line 13) | class PerceptualLoss(torch.nn.Module): method __init__ (line 14) | def __init__( method forward (line 30) | def forward(self, pred, target, normalize=False): FILE: validation/lpips/base_model.py class BaseModel (line 5) | class BaseModel: method __init__ (line 6) | def __init__(self): method name (line 9) | def name(self): method initialize (line 12) | def initialize(self, use_gpu=True, gpu_ids=[0]): method forward (line 16) | def forward(self): method get_image_paths (line 19) | def get_image_paths(self): method optimize_parameters (line 22) | def optimize_parameters(self): method get_current_visuals (line 25) | def get_current_visuals(self): method get_current_errors (line 28) | def get_current_errors(self): method save (line 31) | def save(self, label): method save_network (line 35) | def save_network(self, network, path, network_label, epoch_label): method load_network (line 41) | def load_network(self, network, network_label, epoch_label): method update_learning_rate (line 47) | def update_learning_rate(): method get_image_paths (line 50) | def get_image_paths(self): method save_done (line 53) | def save_done(self, flag=False): FILE: validation/lpips/dist_model.py class DistModel (line 15) | class DistModel(BaseModel): method name (line 16) | def name(self): method initialize (line 19) | def initialize( method forward (line 124) | def forward(self, in0, in1, retPerLayer=False): method optimize_parameters (line 135) | def optimize_parameters(self): method clamp_weights (line 142) | def clamp_weights(self): method set_input (line 147) | def set_input(self, data): method forward_train (line 163) | def forward_train(self): # run forward pass method backward_train (line 177) | def backward_train(self): method compute_accuracy (line 180) | def compute_accuracy(self, d0, d1, judge): method get_current_errors (line 186) | def get_current_errors(self): method get_current_visuals (line 194) | def get_current_visuals(self): method save (line 207) | def save(self, path, label): method update_learning_rate (line 214) | def update_learning_rate(self, nepoch_decay): function score_2afc_dataset (line 225) | def score_2afc_dataset(data_loader, func, name=""): function score_jnd_dataset (line 261) | def score_jnd_dataset(data_loader, func, name=""): FILE: validation/lpips/networks_basic.py function spatial_average (line 9) | def spatial_average(in_tens, keepdim=True): function upsample (line 13) | def upsample(in_tens, out_H=64): # assumes scale factor is same for H a... class PNetLin (line 21) | class PNetLin(nn.Module): method __init__ (line 22) | def __init__( method forward (line 67) | def forward(self, in0, in1, retPerLayer=False): class ScalingLayer (line 100) | class ScalingLayer(nn.Module): method __init__ (line 101) | def __init__(self): method forward (line 106) | def forward(self, inp): class NetLinLayer (line 110) | class NetLinLayer(nn.Module): method __init__ (line 113) | def __init__(self, chn_in, chn_out=1, use_dropout=False): class Dist2LogitLayer (line 123) | class Dist2LogitLayer(nn.Module): method __init__ (line 126) | def __init__(self, chn_mid=32, use_sigmoid=True): method forward (line 150) | def forward(self, d0, d1, eps=0.1): class BCERankingLoss (line 154) | class BCERankingLoss(nn.Module): method __init__ (line 155) | def __init__(self, chn_mid=32): method forward (line 161) | def forward(self, d0, d1, judge): class FakeNet (line 168) | class FakeNet(nn.Module): method __init__ (line 169) | def __init__(self, use_gpu=True, colorspace="Lab"): class L2 (line 175) | class L2(FakeNet): method forward (line 176) | def forward(self, in0, in1, retPerLayer=None): class DSSIM (line 197) | class DSSIM(FakeNet): method forward (line 198) | def forward(self, in0, in1, retPerLayer=None): function print_network (line 217) | def print_network(net): FILE: validation/lpips/pretrained_networks.py class squeezenet (line 6) | class squeezenet(torch.nn.Module): method __init__ (line 7) | def __init__(self, requires_grad=False, pretrained=True): method forward (line 36) | def forward(self, X): class alexnet (line 57) | class alexnet(torch.nn.Module): method __init__ (line 58) | def __init__(self, requires_grad=False, pretrained=True): method forward (line 81) | def forward(self, X): class vgg16 (line 98) | class vgg16(torch.nn.Module): method __init__ (line 99) | def __init__(self, requires_grad=False, pretrained=True): method forward (line 122) | def forward(self, X): class resnet (line 139) | class resnet(torch.nn.Module): method __init__ (line 140) | def __init__(self, requires_grad=False, pretrained=True, num=18): method forward (line 163) | def forward(self, X): FILE: validation/lpips/util.py function normalize_tensor (line 10) | def normalize_tensor(in_feat, eps=1e-10): function l2 (line 15) | def l2(p0, p1, range=255.0): function psnr (line 19) | def psnr(p0, p1, peak=255.0): function dssim (line 23) | def dssim(p0, p1, range=255.0): function rgb2lab (line 27) | def rgb2lab(in_img, mean_cent=False): function tensor2np (line 36) | def tensor2np(tensor_obj): function np2tensor (line 41) | def np2tensor(np_obj): function tensor2tensorlab (line 46) | def tensor2tensorlab(image_tensor, to_norm=True, mc_only=False): function tensorlab2tensor (line 61) | def tensorlab2tensor(lab_tensor, return_inbnd=False): function rgb2lab (line 81) | def rgb2lab(input): function tensor2im (line 87) | def tensor2im(image_tensor, imtype=np.uint8, cent=1.0, factor=255.0 / 2.0): function im2tensor (line 93) | def im2tensor(image, imtype=np.uint8, cent=1.0, factor=255.0 / 2.0): function tensor2vec (line 97) | def tensor2vec(vector_tensor): function voc_ap (line 101) | def voc_ap(rec, prec, use_07_metric=False): function tensor2im (line 135) | def tensor2im(image_tensor, imtype=np.uint8, cent=1.0, factor=255.0 / 2.0): function im2tensor (line 142) | def im2tensor(image, imtype=np.uint8, cent=1.0, factor=255.0 / 2.0): FILE: validation/metrics.py function vae_fid (line 17) | def vae_fid(vae, batch_size, latent_dim, n_sample, inception_name, calcu... function fid (line 84) | def fid(generator, batch_size, n_sample, truncation, inception_name, cal... function get_dataset_inception_features (line 155) | def get_dataset_inception_features(loader, inception_name, size): function compute_pairwise_distance (line 179) | def compute_pairwise_distance(data_x, data_y=None, metric="l2"): function get_kth_value (line 188) | def get_kth_value(unsorted, k, axis=-1): function compute_nearest_neighbour_distances (line 195) | def compute_nearest_neighbour_distances(input_features, nearest_k, metric): function prdc (line 201) | def prdc(real_features, fake_features, nearest_k=10, metric="l2"): function lerp (line 217) | def lerp(a, b, t): function ppl (line 222) | def ppl(generator, batch_size, n_sample, space, crop, latent_dim, eps=1e... FILE: validation/spectral_norm.py class SpectralNorm (line 4) | class SpectralNorm(object): method __init__ (line 5) | def __init__(self, name="weight", n_power_iterations=1, dim=0, eps=1e-... method reshape_weight_to_matrix (line 16) | def reshape_weight_to_matrix(self, weight): method compute_sigma (line 24) | def compute_sigma(self, module): method remove (line 40) | def remove(self, module): method __call__ (line 46) | def __call__(self, module, inputs): method _solve_v_and_rescale (line 49) | def _solve_v_and_rescale(self, weight_mat, u, target_sigma): method apply (line 54) | def apply(module, name, n_power_iterations, dim, eps, normalize=True): function track_spectral_norm (line 76) | def track_spectral_norm(module, name="weight", n_power_iterations=1, eps... function remove_spectral_norm (line 106) | def remove_spectral_norm(module, name="weight"):