repo_full_name stringlengths 6 93 | repo_url stringlengths 25 112 | repo_api_url stringclasses 28
values | owner stringclasses 28
values | repo_name stringclasses 28
values | description stringclasses 28
values | stars int64 617 98.8k | forks int64 31 355 ⌀ | watchers int64 990 999 ⌀ | license stringclasses 2
values | default_branch stringclasses 2
values | repo_created_at timestamp[s]date 2012-07-24 23:12:50 2025-06-16 08:07:28 ⌀ | repo_updated_at timestamp[s]date 2026-02-23 15:23:15 2026-05-03 18:52:12 ⌀ | repo_topics listlengths 0 13 ⌀ | repo_languages unknown | is_fork bool 1
class | open_issues int64 3 104 ⌀ | file_path stringlengths 3 208 | file_name stringclasses 509
values | file_extension stringclasses 1
value | file_size_bytes int64 101 84k ⌀ | file_url stringclasses 627
values | file_raw_url stringclasses 627
values | file_sha stringclasses 624
values | language stringclasses 8
values | parsed_at stringdate 2026-05-04 01:12:36 2026-05-04 19:41:55 | text stringlengths 100 102k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
haitongli/knowledge-distillation-pytorch | https://github.com/haitongli/knowledge-distillation-pytorch | null | null | null | null | 1,985 | null | null | mit | null | null | null | null | null | null | null | mnist/student_mnist.py | null | null | null | null | null | null | Python | 2026-05-04T01:41:56.104306 | from __future__ import print_function
import argparse
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import datasets, transforms
from torch.autograd import Variable
import os
import time
start_time = time.time()
# Training settings
parser = argparse.Argu... |
haitongli/knowledge-distillation-pytorch | https://github.com/haitongli/knowledge-distillation-pytorch | null | null | null | null | 1,985 | null | null | mit | null | null | null | null | null | null | null | evaluate.py | null | null | null | null | null | null | Python | 2026-05-04T01:41:56.147379 | """Evaluates the model"""
import argparse
import logging
import os
import numpy as np
import torch
from torch.autograd import Variable
import utils
import model.net as net
import model.resnet as resnet
import model.data_loader as data_loader
parser = argparse.ArgumentParser()
parser.add_argument('--model_dir', defau... |
haitongli/knowledge-distillation-pytorch | https://github.com/haitongli/knowledge-distillation-pytorch | null | null | null | null | 1,985 | null | null | mit | null | null | null | null | null | null | null | mnist/teacher_mnist.py | null | null | null | null | null | null | Python | 2026-05-04T01:41:56.171538 | from __future__ import print_function
import argparse
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import datasets, transforms
from torch.autograd import Variable
import os
import time
start_time = time.time()
# Training settings
parser = argparse.Argu... |
haitongli/knowledge-distillation-pytorch | https://github.com/haitongli/knowledge-distillation-pytorch | null | null | null | null | 1,985 | null | null | mit | null | null | null | null | null | null | null | model/resnext.py | null | null | null | null | null | null | Python | 2026-05-04T01:41:56.671998 | from __future__ import division
"""
Creates a ResNeXt Model as defined in:
Xie, S., Girshick, R., Dollar, P., Tu, Z., & He, K. (2016).
Aggregated residual transformations for deep neural networks.
arXiv preprint arXiv:1611.05431.
import from https://github.com/prlz77/ResNeXt.pytorch/blob/master/models/model.py
"""
i... |
haitongli/knowledge-distillation-pytorch | https://github.com/haitongli/knowledge-distillation-pytorch | null | null | null | null | 1,985 | null | null | mit | null | null | null | null | null | null | null | model/net.py | null | null | null | null | null | null | Python | 2026-05-04T01:41:56.674519 | """
Baseline CNN, losss function and metrics
Also customizes knowledge distillation (KD) loss function here
"""
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
class Net(nn.Module):
"""
This is the standard way to define your own network in PyTorch. You typically ch... |
haitongli/knowledge-distillation-pytorch | https://github.com/haitongli/knowledge-distillation-pytorch | null | null | null | null | 1,985 | null | null | mit | null | null | null | null | null | null | null | model/resnet.py | null | null | null | null | null | null | Python | 2026-05-04T01:41:56.682486 | '''ResNet in PyTorch.
For Pre-activation ResNet, see 'preact_resnet.py'.
Reference:
[1] Kaiming He, Xiangyu Zhang, Shaoqing Ren, Jian Sun
Deep Residual Learning for Image Recognition. arXiv:1512.03385
'''
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd im... |
haitongli/knowledge-distillation-pytorch | https://github.com/haitongli/knowledge-distillation-pytorch | null | null | null | null | 1,985 | null | null | mit | null | null | null | null | null | null | null | model/preresnet.py | null | null | null | null | null | null | Python | 2026-05-04T01:41:56.683006 | from __future__ import absolute_import
'''Resnet for cifar dataset.
Ported form
https://github.com/facebook/fb.resnet.torch
and
https://github.com/pytorch/vision/blob/master/torchvision/models/resnet.py
(c) YANG, Wei
'''
import torch.nn as nn
import math
import numpy as np
# __all__ = ['preresnet']
def conv3x3(in_p... |
haitongli/knowledge-distillation-pytorch | https://github.com/haitongli/knowledge-distillation-pytorch | null | null | null | null | 1,985 | null | null | mit | null | null | null | null | null | null | null | synthesize_results.py | null | null | null | null | null | null | Python | 2026-05-04T01:41:56.764179 | """Aggregates results from the metrics_eval_best_weights.json in a parent folder"""
import argparse
import json
import os
from tabulate import tabulate
parser = argparse.ArgumentParser()
parser.add_argument('--parent_dir', default='experiments',
help='Directory containing results of experiments'... |
haitongli/knowledge-distillation-pytorch | https://github.com/haitongli/knowledge-distillation-pytorch | null | null | null | null | 1,985 | null | null | mit | null | null | null | null | null | null | null | model/wrn.py | null | null | null | null | null | null | Python | 2026-05-04T01:41:56.764831 | import numpy as np
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
# __all__ = ['wrn']
class BasicBlock(nn.Module):
def __init__(self, in_planes, out_planes, stride, dropRate=0.0):
super(BasicBlock, self).__init__()
self.bn1 = nn.BatchNorm2d(in_planes)
self.r... |
haitongli/knowledge-distillation-pytorch | https://github.com/haitongli/knowledge-distillation-pytorch | null | null | null | null | 1,985 | null | null | mit | null | null | null | null | null | null | null | search_hyperparams.py | null | null | null | null | null | null | Python | 2026-05-04T01:41:56.794340 | """
Peform hyperparemeters search
A brief definition/clarification of 'params.json' files:
"model_version": "resnet18", # "base" models or "modelname"_distill models
"subset_percent": 1.0, # use full (1.0) train set or partial (<1.0) train set
"augmentation": "yes", # whether to use data au... |
haitongli/knowledge-distillation-pytorch | https://github.com/haitongli/knowledge-distillation-pytorch | null | null | null | null | 1,985 | null | null | mit | null | null | null | null | null | null | null | train.py | null | null | null | null | null | null | Python | 2026-05-04T01:41:56.992233 | """Main entrance for train/eval with/without KD on CIFAR-10"""
import argparse
import logging
import os
import time
import math
import random
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.optim.lr_scheduler import StepLR
from torch.autograd... |
haitongli/knowledge-distillation-pytorch | https://github.com/haitongli/knowledge-distillation-pytorch | null | null | null | null | 1,985 | null | null | mit | null | null | null | null | null | null | null | utils.py | null | null | null | null | null | null | Python | 2026-05-04T01:41:57.024106 | """
Tensorboard logger code referenced from:
https://github.com/yunjey/pytorch-tutorial/blob/master/tutorials/04-utils/
Other helper functions:
https://github.com/cs230-stanford/cs230-stanford.github.io
"""
import json
import logging
import os
import shutil
import torch
from collections import OrderedDict
import tens... |
eosphoros-ai/DB-GPT-Hub | https://github.com/eosphoros-ai/DB-GPT-Hub | null | null | null | null | 1,980 | null | null | mit | null | null | null | null | null | null | null | src/dbgpt-hub-gql/dbgpt_hub_gql/configs/data_args.py | null | null | null | null | null | null | Python | 2026-05-04T01:41:59.451283 | import json
import os
from dataclasses import dataclass, field
from typing import TYPE_CHECKING, Dict, List, Literal, Optional, Tuple, Union
import tiktoken
if TYPE_CHECKING:
from transformers import PreTrainedTokenizer
DEFAULT_PROMPT_DICT = {
"prompt_input": ("{instruction}\n\n{input}\n\n"),
"prompt_no... |
eosphoros-ai/DB-GPT-Hub | https://github.com/eosphoros-ai/DB-GPT-Hub | null | null | null | null | 1,980 | null | null | mit | null | null | null | null | null | null | null | src/dbgpt-hub-gql/dbgpt_hub_gql/configs/model_args.py | null | null | null | null | null | null | Python | 2026-05-04T01:41:59.465859 | import json
from dataclasses import asdict, dataclass, field
from typing import Any, Dict, Literal, Optional
import torch
from transformers import Seq2SeqTrainingArguments
from .config import ADAPTER_PATH
@dataclass
class ModelArguments:
r"""
Arguments pertaining to which model/config/tokenizer we are going... |
eosphoros-ai/DB-GPT-Hub | https://github.com/eosphoros-ai/DB-GPT-Hub | null | null | null | null | 1,980 | null | null | mit | null | null | null | null | null | null | null | release_scripts/release_note.py | null | null | null | null | null | null | Python | 2026-05-04T01:41:59.472608 | """ReleaseNote
Usage:
release-note <hash>
"""
import re
from binascii import hexlify
from collections import defaultdict
from typing import Dict, List, Optional, Tuple
from docopt import docopt
from git import Commit
from git.repo import Repo
from jinja2 import Template
VERSION_REG = re.compile(r"^v(\d+)\.(\d+)\... |
eosphoros-ai/DB-GPT-Hub | https://github.com/eosphoros-ai/DB-GPT-Hub | null | null | null | null | 1,980 | null | null | mit | null | null | null | null | null | null | null | src/dbgpt-hub-gql/dbgpt_hub_gql/configs/config.py | null | null | null | null | null | null | Python | 2026-05-04T01:41:59.473895 | import os
### path config
ROOT_PATH = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
# ROOT_PATH = "/root/autodl-tmp"
# MODELS_PARENT_PATH = "/home/model_files/codellama/"
# DEFAULT_FT_MODEL_NAME = "CodeLlama-7b-Instruct-hf"
MODELS_PARENT_PATH = "/home/model/"
DEFAULT_FT_MODEL_NAME = "Ba... |
eosphoros-ai/DB-GPT-Hub | https://github.com/eosphoros-ai/DB-GPT-Hub | null | null | null | null | 1,980 | null | null | mit | null | null | null | null | null | null | null | src/dbgpt-hub-gql/dbgpt_hub_gql/eval/evaluation.py | null | null | null | null | null | null | Python | 2026-05-04T01:41:59.478548 | import os
import sys
import argparse
import importlib
import json
import prettytable as pt
from evaluator.evaluator import Evaluator
from evaluator.similarity_evaluator import SimilarityEvaluator
# print(f"{os.path.dirname(os.path.abspath(__file__))}/evaluator/impl/tugraph-db")
# sys.path.append(f"{os.path.dirname(os.... |
eosphoros-ai/DB-GPT-Hub | https://github.com/eosphoros-ai/DB-GPT-Hub | null | null | null | null | 1,980 | null | null | mit | null | null | null | null | null | null | null | src/dbgpt-hub-gql/dbgpt_hub_gql/configs/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:41:59.479549 | from .data_args import DataArguments, Llama2Template
from .model_args import ModelArguments, TrainingArguments
__all__ = [
"DataArguments",
"Llama2Template",
"ModelArguments",
"TrainingArguments",
]
|
eosphoros-ai/DB-GPT-Hub | https://github.com/eosphoros-ai/DB-GPT-Hub | null | null | null | null | 1,980 | null | null | mit | null | null | null | null | null | null | null | src/dbgpt-hub-gql/dbgpt_hub_gql/data_process/data_utils.py | null | null | null | null | null | null | Python | 2026-05-04T01:41:59.489183 | import hashlib
import os
from itertools import chain
from typing import (
TYPE_CHECKING,
Any,
Dict,
Generator,
List,
Literal,
Optional,
Tuple,
Union,
)
import numpy as np
import pandas as pd
import tiktoken
from datasets import (
Dataset,
DatasetDict,
concatenate_dataset... |
eosphoros-ai/DB-GPT-Hub | https://github.com/eosphoros-ai/DB-GPT-Hub | null | null | null | null | 1,980 | null | null | mit | null | null | null | null | null | null | null | src/dbgpt-hub-gql/dbgpt_hub_gql/eval/evaluator/similarity_evaluator.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:00.120249 | import jaro
class SimilarityEvaluator:
def evaluate(self, query_predict, query_gold, db_id):
return jaro.jaro_winkler_metric(query_predict, query_gold)
|
eosphoros-ai/DB-GPT-Hub | https://github.com/eosphoros-ai/DB-GPT-Hub | null | null | null | null | 1,980 | null | null | mit | null | null | null | null | null | null | null | src/dbgpt-hub-gql/dbgpt_hub_gql/eval/evaluator/impl/tugraph-analytics/grammar_evaluator.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:00.149058 | import jpype
import os.path
class GrammarEvaluator:
def __init__(self):
jvmPath = jpype.getDefaultJVMPath()
# gql grammar paerser from tugraph-analytics https://github.com/TuGraph-family/tugraph-analytics/tree/master/geaflow/geaflow-dsl/geaflow-dsl-parser/src/main/java/com/antgroup/geaflow/dsl/pa... |
eosphoros-ai/DB-GPT-Hub | https://github.com/eosphoros-ai/DB-GPT-Hub | null | null | null | null | 1,980 | null | null | mit | null | null | null | null | null | null | null | src/dbgpt-hub-gql/dbgpt_hub_gql/eval/evaluator/impl/tugraph-db/execution_evaluator.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:00.159870 | import sys
import logging
import os.path
import os
import ctypes
import subprocess
import time
import json
import signal
import jaro
from neo4j import GraphDatabase
current_dir = os.path.dirname(__file__)
def handle_timeout(sig, frame):
raise TimeoutError('took too long')
signal.signal(signal.SIGALRM, handle... |
eosphoros-ai/DB-GPT-Hub | https://github.com/eosphoros-ai/DB-GPT-Hub | null | null | null | null | 1,980 | null | null | mit | null | null | null | null | null | null | null | src/dbgpt-hub-gql/dbgpt_hub_gql/eval/evaluator/impl/tugraph-db/LcypherListener.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:00.161012 | # Generated from Lcypher.g4 by ANTLR 4.13.2
from antlr4 import *
if "." in __name__:
from .LcypherParser import LcypherParser
else:
from LcypherParser import LcypherParser
# This class defines a complete listener for a parse tree produced by LcypherParser.
class LcypherListener(ParseTreeListener):
# Ent... |
eosphoros-ai/DB-GPT-Hub | https://github.com/eosphoros-ai/DB-GPT-Hub | null | null | null | null | 1,980 | null | null | mit | null | null | null | null | null | null | null | src/dbgpt-hub-gql/dbgpt_hub_gql/eval/evaluator/impl/tugraph-db/grammar_evaluator.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:00.168724 | import jaro
import sys
import os.path
import antlr4
from antlr4 import *
from antlr4.error.ErrorListener import ErrorListener
sys.path.append(os.path.dirname(__file__))
from LcypherLexer import LcypherLexer
from LcypherParser import LcypherParser
class MyErrorListener(ErrorListener):
def syntaxError(self, recogn... |
eosphoros-ai/DB-GPT-Hub | https://github.com/eosphoros-ai/DB-GPT-Hub | null | null | null | null | 1,980 | null | null | mit | null | null | null | null | null | null | null | src/dbgpt-hub-gql/dbgpt_hub_gql/eval/evaluator/impl/iso-gql/grammar_evaluator.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:00.170112 | import jaro
import sys
import os.path
import antlr4
from antlr4 import *
from antlr4.error.ErrorListener import ErrorListener
sys.path.append(os.path.dirname(__file__))
from GQLLexer import GQLLexer
from GQLParser import GQLParser
class MyErrorListener(ErrorListener):
def syntaxError(self, recognizer, offendingS... |
eosphoros-ai/DB-GPT-Hub | https://github.com/eosphoros-ai/DB-GPT-Hub | null | null | null | null | 1,980 | null | null | mit | null | null | null | null | null | null | null | src/dbgpt-hub-gql/dbgpt_hub_gql/llm_base/adapter.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:00.760657 | import os
from typing import TYPE_CHECKING
import torch
from peft import LoraConfig, PeftModel, TaskType, get_peft_model
from peft.utils import CONFIG_NAME, SAFETENSORS_WEIGHTS_NAME
from .config_parser import load_trainable_params
from .loggings import get_logger
if TYPE_CHECKING:
from transformers.modeling_util... |
eosphoros-ai/DB-GPT-Hub | https://github.com/eosphoros-ai/DB-GPT-Hub | null | null | null | null | 1,980 | null | null | mit | null | null | null | null | null | null | null | src/dbgpt-hub-gql/dbgpt_hub_gql/predict/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:00.780653 | """
dbgpt_hub.predict
==============
"""
from .predict_api import start_predict
__all__ = ["start_predict"]
|
eosphoros-ai/DB-GPT-Hub | https://github.com/eosphoros-ai/DB-GPT-Hub | null | null | null | null | 1,980 | null | null | mit | null | null | null | null | null | null | null | src/dbgpt-hub-gql/dbgpt_hub_gql/llm_base/chat_model.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:00.783324 | from threading import Thread
from typing import Any, Dict, Generator, List, Optional, Tuple
import torch
import gc
from transformers import GenerationConfig, TextIteratorStreamer
from ..data_process.data_utils import get_template_and_fix_tokenizer
from .config_parser import get_infer_args
from .load_tokenizer import ... |
eosphoros-ai/DB-GPT-Hub | https://github.com/eosphoros-ai/DB-GPT-Hub | null | null | null | null | 1,980 | null | null | mit | null | null | null | null | null | null | null | src/dbgpt-hub-gql/dbgpt_hub_gql/llm_base/config_parser.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:00.796180 | import os
import sys
from typing import Any, Dict, Optional, Tuple
import datasets
import torch
import transformers
from transformers import HfArgumentParser, Seq2SeqTrainingArguments
from transformers.modeling_utils import load_sharded_checkpoint
from transformers.trainer import WEIGHTS_INDEX_NAME, WEIGHTS_NAME
from ... |
eosphoros-ai/DB-GPT-Hub | https://github.com/eosphoros-ai/DB-GPT-Hub | null | null | null | null | 1,980 | null | null | mit | null | null | null | null | null | null | null | src/dbgpt-hub-gql/dbgpt_hub_gql/llm_base/model_trainer.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:00.800819 | import json
import math
import os
from dataclasses import dataclass
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Sequence, Tuple, Union
import jieba
import matplotlib.pyplot as plt
import numpy as np
import torch
import torch.nn as nn
from nltk.translate.bleu_score import SmoothingFunction, sentence_bl... |
eosphoros-ai/DB-GPT-Hub | https://github.com/eosphoros-ai/DB-GPT-Hub | null | null | null | null | 1,980 | null | null | mit | null | null | null | null | null | null | null | src/dbgpt-hub-gql/dbgpt_hub_gql/predict/predict_api.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:00.829817 | import os
from typing import Any, Dict, Optional
from dbgpt_hub_gql.predict import predict
def start_predict(
args: Optional[Dict[str, Any]] = None, cuda_visible_devices: Optional[str] = "0"
):
# Setting CUDA Device
os.environ["CUDA_VISIBLE_DEVICES"] = cuda_visible_devices
# Default Arguments
if... |
eosphoros-ai/DB-GPT-Hub | https://github.com/eosphoros-ai/DB-GPT-Hub | null | null | null | null | 1,980 | null | null | mit | null | null | null | null | null | null | null | src/dbgpt-hub-gql/dbgpt_hub_gql/llm_base/loggings.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:00.832102 | import json
import logging
import os
import sys
import time
from datetime import timedelta
from typing import TYPE_CHECKING
from transformers import TrainerCallback
from transformers.trainer_utils import has_length
from ..configs.config import LOG_FILE_NAME
if TYPE_CHECKING:
from transformers import TrainerContr... |
eosphoros-ai/DB-GPT-Hub | https://github.com/eosphoros-ai/DB-GPT-Hub | null | null | null | null | 1,980 | null | null | mit | null | null | null | null | null | null | null | src/dbgpt-hub-gql/dbgpt_hub_gql/predict/predict.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:00.832594 | import json
import os
import sys
import torch
import gc
ROOT_PATH = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(ROOT_PATH)
from typing import Any, Dict, List, Optional
from dbgpt_hub_gql.data_process.data_utils import extract_sql_prompt_dataset
from dbgpt_hub_gql.llm_... |
eosphoros-ai/DB-GPT-Hub | https://github.com/eosphoros-ai/DB-GPT-Hub | null | null | null | null | 1,980 | null | null | mit | null | null | null | null | null | null | null | src/dbgpt-hub-gql/dbgpt_hub_gql/llm_base/load_tokenizer.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:00.834437 | import inspect
import math
import os
from types import MethodType
from typing import TYPE_CHECKING, Dict, List, Literal, Optional, Tuple
import torch
from transformers import (
AutoConfig,
AutoModelForCausalLM,
AutoTokenizer,
BitsAndBytesConfig,
PretrainedConfig,
PreTrainedModel,
PreTrained... |
eosphoros-ai/DB-GPT-Hub | https://github.com/eosphoros-ai/DB-GPT-Hub | null | null | null | null | 1,980 | null | null | mit | null | null | null | null | null | null | null | src/dbgpt-hub-gql/dbgpt_hub_gql/train/export_model.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:01.375166 | import os
import sys
ROOT_PATH = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(ROOT_PATH)
from dbgpt_hub_gql.llm_base.model_trainer import export_model
def main():
export_model()
if __name__ == "__main__":
main()
|
eosphoros-ai/DB-GPT-Hub | https://github.com/eosphoros-ai/DB-GPT-Hub | null | null | null | null | 1,980 | null | null | mit | null | null | null | null | null | null | null | src/dbgpt-hub-gql/dbgpt_hub_gql/train/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:01.420985 | """
dbgpt_hub.train
==============
"""
from .sft_train_api import start_sft
__all__ = ["start_sft"]
|
eosphoros-ai/DB-GPT-Hub | https://github.com/eosphoros-ai/DB-GPT-Hub | null | null | null | null | 1,980 | null | null | mit | null | null | null | null | null | null | null | src/dbgpt-hub-gql/dbgpt_hub_gql/train/rm_train.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:01.423262 | import json
import os
from dataclasses import dataclass
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Sequence, Tuple, Union
import numpy as np
import torch
from dbgpt_hub_gql.data_process.data_utils import (
get_dataset,
preprocess_dataset,
split_dataset,
)
from dbgpt_hub_gql.llm_base.confi... |
eosphoros-ai/DB-GPT-Hub | https://github.com/eosphoros-ai/DB-GPT-Hub | null | null | null | null | 1,980 | null | null | mit | null | null | null | null | null | null | null | src/dbgpt-hub-gql/dbgpt_hub_gql/train/sft_train.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:01.433106 | import os
import sys
ROOT_PATH = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(ROOT_PATH)
from typing import TYPE_CHECKING, Any, Dict, List, Optional
from dbgpt_hub_gql.configs.config import IGNORE_INDEX
from dbgpt_hub_gql.data_process.data_utils import (
get_dataset... |
eosphoros-ai/DB-GPT-Hub | https://github.com/eosphoros-ai/DB-GPT-Hub | null | null | null | null | 1,980 | null | null | mit | null | null | null | null | null | null | null | src/dbgpt-hub-nlu/datasets/financial_report/financial_report.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:01.434415 | import json
import os
import datasets
from datasets.tasks import TextClassification
logger = datasets.logging.get_logger(__name__)
class FinancialReport(datasets.GeneratorBasedBuilder):
VERSION = datasets.Version("1.0.0")
BUILDER_CONFIGS = [
datasets.BuilderConfig(
name="financial_repor... |
eosphoros-ai/DB-GPT-Hub | https://github.com/eosphoros-ai/DB-GPT-Hub | null | null | null | null | 1,980 | null | null | mit | null | null | null | null | null | null | null | src/dbgpt-hub-gql/dbgpt_hub_gql/train/sft_train_api.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:01.444982 | import os
from typing import Any, Dict, Optional
from dbgpt_hub_gql.train import sft_train
def start_sft(
args: Optional[Dict[str, Any]] = None, cuda_visible_devices: Optional[str] = "0"
):
# Setting CUDA Device
os.environ["CUDA_VISIBLE_DEVICES"] = cuda_visible_devices
# Default Arguments
if arg... |
eosphoros-ai/DB-GPT-Hub | https://github.com/eosphoros-ai/DB-GPT-Hub | null | null | null | null | 1,980 | null | null | mit | null | null | null | null | null | null | null | src/dbgpt-hub-gql/setup.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:01.445935 | from typing import List
from setuptools import find_packages, setup
class SetupSpec:
def __init__(self) -> None:
self.extras: dict = {}
self.install_requires: List[str] = []
@property
def unique_extras(self) -> dict[str, list[str]]:
unique_extras = {}
for k, v in self.ext... |
eosphoros-ai/DB-GPT-Hub | https://github.com/eosphoros-ai/DB-GPT-Hub | null | null | null | null | 1,980 | null | null | mit | null | null | null | null | null | null | null | src/dbgpt-hub-nlu/dbgpt_hub_nlu/config/dataset.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:01.488493 | import os
from dataclasses import dataclass, field
from typing import Optional
@dataclass
class DataArguments:
dataset: str = field(
default="financial_report",
metadata={"help": "The name of the dataset to use."},
)
dataset_dir: str = field(
default="./datasets",
metadata=... |
eosphoros-ai/DB-GPT-Hub | https://github.com/eosphoros-ai/DB-GPT-Hub | null | null | null | null | 1,980 | null | null | mit | null | null | null | null | null | null | null | src/dbgpt-hub-nlu/dbgpt_hub_nlu/config/model_args.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:02.019191 | from dataclasses import dataclass, field
from typing import Optional
from transformers import TrainingArguments
@dataclass
class NLUTrainingArguments(TrainingArguments):
output_dir: str = field(
default="output",
metadata={
"help": "The output directory where the model predictions and... |
eosphoros-ai/DB-GPT-Hub | https://github.com/eosphoros-ai/DB-GPT-Hub | null | null | null | null | 1,980 | null | null | mit | null | null | null | null | null | null | null | src/dbgpt-hub-nlu/dbgpt_hub_nlu/model/simple.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:02.033117 | import json
from typing import Dict, List, Tuple
import torch
from torch import nn
class SimpleIntentClassifier(nn.Module):
def __init__(self, input_dim: int, num_classes: int):
super(SimpleIntentClassifier, self).__init__()
self.fc1 = nn.Linear(input_dim, 128)
self.fc2 = nn.Linear(128, n... |
eosphoros-ai/DB-GPT-Hub | https://github.com/eosphoros-ai/DB-GPT-Hub | null | null | null | null | 1,980 | null | null | mit | null | null | null | null | null | null | null | src/dbgpt-hub-nlu/dbgpt_hub_nlu/intent.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:02.085041 | import ast
import evaluate
import numpy as np
import pandas as pd
import torch
from .config.dataset import DataArguments, InferArguments
from .config.model_args import ModelArguments, NLUTrainingArguments
from datasets import Dataset
from .model.qwen import Qwen2ForSequenceClassification
from peft import LoraConfig, Pe... |
eosphoros-ai/DB-GPT-Hub | https://github.com/eosphoros-ai/DB-GPT-Hub | null | null | null | null | 1,980 | null | null | mit | null | null | null | null | null | null | null | src/dbgpt-hub-nlu/dbgpt_hub_nlu/model/qwen.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:02.093767 | import logging
import os
from transformers.modeling_attn_mask_utils import (
_prepare_4d_causal_attention_mask,
_prepare_4d_causal_attention_mask_for_sdpa,
)
from transformers.modeling_outputs import TokenClassifierOutput
from transformers.models.qwen2.modeling_qwen2 import *
# set start index, default is 0. ... |
eosphoros-ai/DB-GPT-Hub | https://github.com/eosphoros-ai/DB-GPT-Hub | null | null | null | null | 1,980 | null | null | mit | null | null | null | null | null | null | null | src/dbgpt-hub-nlu/setup.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:02.104453 | from typing import List
from setuptools import find_packages, setup
class SetupSpec:
def __init__(self) -> None:
self.extras: dict = {}
self.install_requires: List[str] = []
@property
def unique_extras(self) -> dict[str, list[str]]:
unique_extras = {}
for k, v in self.ext... |
eosphoros-ai/DB-GPT-Hub | https://github.com/eosphoros-ai/DB-GPT-Hub | null | null | null | null | 1,980 | null | null | mit | null | null | null | null | null | null | null | src/dbgpt-hub-nlu/main.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:02.105663 | import logging
import os
import sys
logging.basicConfig(
format="%(asctime)s - %(levelname)s - %(name)s - %(message)s",
datefmt="%m/%d/%Y %H:%M:%S",
handlers=[logging.StreamHandler(sys.stdout)],
level=logging.INFO,
)
from typing import TYPE_CHECKING, Tuple
import torch
from datasets import DatasetD... |
eosphoros-ai/DB-GPT-Hub | https://github.com/eosphoros-ai/DB-GPT-Hub | null | null | null | null | 1,980 | null | null | mit | null | null | null | null | null | null | null | src/dbgpt-hub-nlu/dbgpt_hub_nlu/trainer.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:02.108624 | import logging
import os
from typing import Optional, Type
import torch
from datasets import DatasetDict
from sklearn.metrics import accuracy_score
from transformers import Trainer
from .config.model_args import ModelArguments, NLUTrainingArguments
logger = logging.getLogger(__name__)
def _load_base_model(model_ar... |
eosphoros-ai/DB-GPT-Hub | https://github.com/eosphoros-ai/DB-GPT-Hub | null | null | null | null | 1,980 | null | null | mit | null | null | null | null | null | null | null | src/dbgpt-hub-nlu/dbgpt_hub_nlu/ner.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:02.109282 | import ast
import evaluate
import numpy as np
import pandas as pd
import torch
from config.dataset import DataArguments, InferArguments
from config.model_args import ModelArguments, NLUTrainingArguments
from datasets import Dataset
from model.qwen import Qwen2ForTokenClassification
from peft import LoraConfig, PeftCon... |
SummitKwan/transparent_latent_gan | https://github.com/SummitKwan/transparent_latent_gan | null | null | null | null | 1,979 | null | null | mit | null | null | null | null | null | null | null | src/misc.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:04.316452 | """ tool functions """
import time
def gen_time_str():
""" tool function to generate time str like 20180927_205959 """
return time.strftime("%Y%m%d_%H%M%S", time.gmtime())
|
SummitKwan/transparent_latent_gan | https://github.com/SummitKwan/transparent_latent_gan | null | null | null | null | 1,979 | null | null | mit | null | null | null | null | null | null | null | src/ingestion/crop_celeba_aligned.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:04.317469 | """
script to crop celebA dataset and save into new folder
"""
import os
import glob
import numpy as np
import pandas as pd
import PIL
import PIL.Image
import h5py
path_celeba_img = './data/raw/celebA'
path_celeba_att = './data/raw/celebA_annotation/list_attr_celeba.txt'
path_celeba_crop = './data/processed/celebA_cr... |
SummitKwan/transparent_latent_gan | https://github.com/SummitKwan/transparent_latent_gan | null | null | null | null | 1,979 | null | null | mit | null | null | null | null | null | null | null | src/ingestion/process_celeba.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:04.332117 | """
Download and extract celebA dataset
Modification of https://github.com/stanfordnlp/treelstm/blob/master/scripts/download.py
Downloads the following:
- Celeb-A dataset
- LSUN dataset
- MNIST dataset
"""
import os
import sys
import gzip
import json
import shutil
import zipfile
import tarfile
import argparse
import ... |
SummitKwan/transparent_latent_gan | https://github.com/SummitKwan/transparent_latent_gan | null | null | null | null | 1,979 | null | null | mit | null | null | null | null | null | null | null | src/ingestion/process_celeba_hd.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:04.349912 | """
Download and extract celebA dataset (original version, un-aligned)
Note: to run this script, first make sure the datafile is manually downloaded and stored at './data/raw/celebA_wild_7z'
celebA, orignial (non-aligned) version of data can be downloaded from:
https://drive.google.com/drive/folders/0B7EVK8r0v71pTUZs... |
SummitKwan/transparent_latent_gan | https://github.com/SummitKwan/transparent_latent_gan | null | null | null | null | 1,979 | null | null | mit | null | null | null | null | null | null | null | src/ingestion/process_transient_attribute_scenes.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:04.350850 | """ process the transient attribute scence dataset """
import os
import warnings
import urllib
import urllib.request
import tarfile
url_dataset = "http://transattr.cs.brown.edu/files/aligned_images.tar"
url_datalabel = "http://transattr.cs.brown.edu/files/annotations.tar"
path_data = './data/raw/transient_attribute_... |
SummitKwan/transparent_latent_gan | https://github.com/SummitKwan/transparent_latent_gan | null | null | null | null | 1,979 | null | null | mit | null | null | null | null | null | null | null | src/model/cnn_face_attr_celeba.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:04.354711 | """ train and test for a convolutional neural network for predicting face attrubute for celebA """
import os
import time
import glob
import numpy as np
import pandas as pd
import PIL
import keras
import keras.applications
import keras.layers as layers
from keras.applications.mobilenet import preprocess_input
path_cel... |
SummitKwan/transparent_latent_gan | https://github.com/SummitKwan/transparent_latent_gan | null | null | null | null | 1,979 | null | null | mit | null | null | null | null | null | null | null | src/ingestion/dataset_tool_modify.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:04.387951 | """
tool functions from Nvidia, with modification only in file path,
from: https://github.com/tkarras/progressive_growing_of_gans/blob/master/dataset_tool.py
"""
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# This work is licensed under the Creative Commons Attribution-NonCommercial
# 4.0 Internati... |
SummitKwan/transparent_latent_gan | https://github.com/SummitKwan/transparent_latent_gan | null | null | null | null | 1,979 | null | null | mit | null | null | null | null | null | null | null | src/model/pggan/dataset.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:05.154398 | # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# This work is licensed under the Creative Commons Attribution-NonCommercial
# 4.0 International License. To view a copy of this license, visit
# http://creativecommons.org/licenses/by-nc/4.0/ or send a letter to
# Creative Commons, PO Box 1866, Mountain ... |
SummitKwan/transparent_latent_gan | https://github.com/SummitKwan/transparent_latent_gan | null | null | null | null | 1,979 | null | null | mit | null | null | null | null | null | null | null | src/model/pggan/metrics/frechet_inception_distance.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:05.155685 | #!/usr/bin/env python3
#
# Copyright 2017 Martin Heusel
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... |
SummitKwan/transparent_latent_gan | https://github.com/SummitKwan/transparent_latent_gan | null | null | null | null | 1,979 | null | null | mit | null | null | null | null | null | null | null | src/model/pggan/dataset_tool.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:05.156841 | # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# This work is licensed under the Creative Commons Attribution-NonCommercial
# 4.0 International License. To view a copy of this license, visit
# http://creativecommons.org/licenses/by-nc/4.0/ or send a letter to
# Creative Commons, PO Box 1866, Mountain ... |
SummitKwan/transparent_latent_gan | https://github.com/SummitKwan/transparent_latent_gan | null | null | null | null | 1,979 | null | null | mit | null | null | null | null | null | null | null | src/model/pggan/metrics/ms_ssim.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:05.351864 | #!/usr/bin/python
#
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... |
SummitKwan/transparent_latent_gan | https://github.com/SummitKwan/transparent_latent_gan | null | null | null | null | 1,979 | null | null | mit | null | null | null | null | null | null | null | src/model/pggan/config.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:06.038552 | # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# This work is licensed under the Creative Commons Attribution-NonCommercial
# 4.0 International License. To view a copy of this license, visit
# http://creativecommons.org/licenses/by-nc/4.0/ or send a letter to
# Creative Commons, PO Box 1866, Mountain ... |
SummitKwan/transparent_latent_gan | https://github.com/SummitKwan/transparent_latent_gan | null | null | null | null | 1,979 | null | null | mit | null | null | null | null | null | null | null | src/model/pggan/legacy.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:06.178206 | # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# This work is licensed under the Creative Commons Attribution-NonCommercial
# 4.0 International License. To view a copy of this license, visit
# http://creativecommons.org/licenses/by-nc/4.0/ or send a letter to
# Creative Commons, PO Box 1866, Mountain ... |
SummitKwan/transparent_latent_gan | https://github.com/SummitKwan/transparent_latent_gan | null | null | null | null | 1,979 | null | null | mit | null | null | null | null | null | null | null | src/model/pggan/loss.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:06.217091 | # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# This work is licensed under the Creative Commons Attribution-NonCommercial
# 4.0 International License. To view a copy of this license, visit
# http://creativecommons.org/licenses/by-nc/4.0/ or send a letter to
# Creative Commons, PO Box 1866, Mountain ... |
SummitKwan/transparent_latent_gan | https://github.com/SummitKwan/transparent_latent_gan | null | null | null | null | 1,979 | null | null | mit | null | null | null | null | null | null | null | src/model/pggan/metrics/inception_score.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:06.246673 | # Copyright 2016 Wojciech Zaremba
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... |
SummitKwan/transparent_latent_gan | https://github.com/SummitKwan/transparent_latent_gan | null | null | null | null | 1,979 | null | null | mit | null | null | null | null | null | null | null | src/model/pggan/train.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:06.325088 | # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# This work is licensed under the Creative Commons Attribution-NonCommercial
# 4.0 International License. To view a copy of this license, visit
# http://creativecommons.org/licenses/by-nc/4.0/ or send a letter to
# Creative Commons, PO Box 1866, Mountain ... |
SummitKwan/transparent_latent_gan | https://github.com/SummitKwan/transparent_latent_gan | null | null | null | null | 1,979 | null | null | mit | null | null | null | null | null | null | null | src/model/pggan/util_scripts.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:07.532164 | # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# This work is licensed under the Creative Commons Attribution-NonCommercial
# 4.0 International License. To view a copy of this license, visit
# http://creativecommons.org/licenses/by-nc/4.0/ or send a letter to
# Creative Commons, PO Box 1866, Mountain ... |
SummitKwan/transparent_latent_gan | https://github.com/SummitKwan/transparent_latent_gan | null | null | null | null | 1,979 | null | null | mit | null | null | null | null | null | null | null | src/tests/test_feature_axis_orthogonalize.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:08.122375 | """ test script """
import importlib
import numpy as np
import src.tl_gan.feature_axis as feature_axis
importlib.reload(feature_axis)
vectors = np.random.rand(10, 4)
print(np.sum(vectors**2, axis=0))
vectors_normalized = feature_axis.normalize_feature_axis(vectors)
print(np.sum(vectors_normalized**2, axis=0))
pr... |
SummitKwan/transparent_latent_gan | https://github.com/SummitKwan/transparent_latent_gan | null | null | null | null | 1,979 | null | null | mit | null | null | null | null | null | null | null | src/tests/test_bokeh_server.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:08.328168 | """ script to test Bokeh server """
from random import random
import bokeh
from bokeh.layouts import column
from bokeh.models import Button
from bokeh.palettes import RdYlBu3
from bokeh.plotting import figure, curdoc
# create a plot and style its properties
p = figure(x_range=(0, 100), y_range=(0, 100), toolbar_loc... |
SummitKwan/transparent_latent_gan | https://github.com/SummitKwan/transparent_latent_gan | null | null | null | null | 1,979 | null | null | mit | null | null | null | null | null | null | null | src/tests/test_cnn_face_attr_celaba.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:08.329388 | import importlib
import src.model.cnn_face_attr_celeba as cnn_face
importlib.reload(cnn_face)
img_name, df_attr = cnn_face.get_data_info()
model = cnn_face.create_cnn_model()
x, y = cnn_face.get_data_sample(yn_interactive_plot=True)
x_all, y_all = cnn_face.load_data_batch(num_images_total=2**16)
cnn_face.train_pro... |
SummitKwan/transparent_latent_gan | https://github.com/SummitKwan/transparent_latent_gan | null | null | null | null | 1,979 | null | null | mit | null | null | null | null | null | null | null | src/tl_gan/bokeh_webgui_server.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:08.531667 | """ web gui using bokeh, not fulling functional yet """
import os
import glob
import sys
import numpy as np
import time
import pickle
import tensorflow as tf
import random
import bokeh
from bokeh.layouts import column
from bokeh.models import Button
from bokeh.palettes import RdYlBu3
from bokeh.plotting import figur... |
SummitKwan/transparent_latent_gan | https://github.com/SummitKwan/transparent_latent_gan | null | null | null | null | 1,979 | null | null | mit | null | null | null | null | null | null | null | src/tl_gan/feature_axis.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:08.789582 | """ module of functions related to discovering feature axis """
import time
import numpy as np
import sklearn.linear_model as linear_model
def find_feature_axis(z, y, method='linear', **kwargs_model):
"""
function to find axis in the latent space that is predictive of feature vectors
:param z: vectors i... |
SummitKwan/transparent_latent_gan | https://github.com/SummitKwan/transparent_latent_gan | null | null | null | null | 1,979 | null | null | mit | null | null | null | null | null | null | null | src/tl_gan/feature_celeba_organize.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:08.962692 | """ module to get the desierble order of features """
import numpy as np
feature_name_celeba_org = [
'5_o_Clock_Shadow', 'Arched_Eyebrows', 'Attractive',
'Bags_Under_Eyes', 'Bald', 'Bangs', 'Big_Lips', 'Big_Nose',
'Black_Hair', 'Blond_Hair', 'Blurry', 'Brown_Hair',
'Bushy_Eyebrows', 'Chubby', 'Double... |
SummitKwan/transparent_latent_gan | https://github.com/SummitKwan/transparent_latent_gan | null | null | null | null | 1,979 | null | null | mit | null | null | null | null | null | null | null | src/tl_gan/generate_image.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:08.992373 | """ module to generate iamges from pg-gan """
import os
import sys
import numpy as np
import tensorflow as tf
import PIL
path_pg_gan_code = './src/model/pggan'
path_model = './asset_model/karras2018iclr-celebahq-1024x1024.pkl'
sys.path.append(path_pg_gan_code)
len_z = 512
len_dummy = 0
def gen_single_img(z=None, G... |
SummitKwan/transparent_latent_gan | https://github.com/SummitKwan/transparent_latent_gan | null | null | null | null | 1,979 | null | null | mit | null | null | null | null | null | null | null | src/tl_gan/script_gen_sample_pggan.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:09.214389 | """
try face tl_gan using pg-gan model, modified from
https://drive.google.com/drive/folders/1A79qKDTFp6pExe4gTSgBsEOkxwa2oes_
"""
"""
prerequsit: before running the code, download pre-trained model to project_root/asset_model/
pretrained model download url: https://drive.google.com/drive/folders/15hvzxt_XxuokSmj0uO4x... |
SummitKwan/transparent_latent_gan | https://github.com/SummitKwan/transparent_latent_gan | null | null | null | null | 1,979 | null | null | mit | null | null | null | null | null | null | null | src/tl_gan/script_generation_grid.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:09.385324 | """ generation of faces from one center image, and move along every feature axis """
import os
import glob
import sys
import numpy as np
import time
import pickle
import datetime
import tensorflow as tf
import PIL
## load feature directions
path_feature_direction = './asset_results/pg_gan_celeba_feature_direction_40... |
SummitKwan/transparent_latent_gan | https://github.com/SummitKwan/transparent_latent_gan | null | null | null | null | 1,979 | null | null | mit | null | null | null | null | null | null | null | src/tl_gan/script_interpolate_pggan.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:09.668510 | """
try face tl_gan using pg-gan model, modified from
https://drive.google.com/drive/folders/1A79qKDTFp6pExe4gTSgBsEOkxwa2oes_
"""
"""
prerequsit: before running the code, download pre-trained model to project_root/asset_model/
pretrained model download url: https://drive.google.com/drive/folders/15hvzxt_XxuokSmj0uO4x... |
SummitKwan/transparent_latent_gan | https://github.com/SummitKwan/transparent_latent_gan | null | null | null | null | 1,979 | null | null | mit | null | null | null | null | null | null | null | src/tl_gan/script_generation_interactive.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:09.669563 | """ generation of images interactively with ui control """
import os
import glob
import sys
import numpy as np
import time
import pickle
import tensorflow as tf
import PIL
import matplotlib
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
import matplotlib.widgets as widgets
plt.ion()
import src.tl_gan.feature... |
SummitKwan/transparent_latent_gan | https://github.com/SummitKwan/transparent_latent_gan | null | null | null | null | 1,979 | null | null | mit | null | null | null | null | null | null | null | src/tl_gan/script_label_regression.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:09.950561 | """ functions to regress y (labels) based on z (latent space) """
import os
import glob
import numpy as np
import pickle
import h5py
import pandas as pd
import src.misc as misc
import src.tl_gan.feature_axis as feature_axis
##
""" get y and z from pre-generated files """
path_gan_sample_img = './asset_results/pggan... |
SummitKwan/transparent_latent_gan | https://github.com/SummitKwan/transparent_latent_gan | null | null | null | null | 1,979 | null | null | mit | null | null | null | null | null | null | null | src/tl_gan/script_old_discover_feature_axis.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:10.201654 | """ script to discover feature axis in the latent space """
"""
pre-requisite: this code needs pre-generated feature-image pairs, stored as pickle files located at:
project_root/asset_results/pggan_celeba_sample_pkl
"""
import os
import sys
import time
import pickle
import numpy as np
import tensorflow as tf
import ... |
SummitKwan/transparent_latent_gan | https://github.com/SummitKwan/transparent_latent_gan | null | null | null | null | 1,979 | null | null | mit | null | null | null | null | null | null | null | src/tl_gan/script_predict_labels.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:10.489564 | """ predict_feature labels of synthetic_images """
import os
import glob
import numpy as np
import PIL.Image
import h5py
import src.model.cnn_face_attr_celeba as cnn_face
# path to model generated results
path_gan_sample_img = './asset_results/pggan_celeba_sample_jpg/'
file_pattern_x = 'sample_*.jpg'
file_pattern_z =... |
SummitKwan/transparent_latent_gan | https://github.com/SummitKwan/transparent_latent_gan | null | null | null | null | 1,979 | null | null | mit | null | null | null | null | null | null | null | src/tl_gan/script_transform_sample_pickle_to_img.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:10.602007 | """ temporary script to transform samples from pkl to images """
import os
import glob
import pickle
import numpy as np
import PIL.Image
import h5py
# path to model generated results
path_gan_sample_pkl = './asset_results/pggan_celeba_sample_pkl/'
path_gan_sample_img = './asset_results/pggan_celeba_sample_jpg/'
if ... |
SummitKwan/transparent_latent_gan | https://github.com/SummitKwan/transparent_latent_gan | null | null | null | null | 1,979 | null | null | mit | null | null | null | null | null | null | null | src/tests/test_tf.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:14.984146 | """ script to test environment """
import tensorflow as tf
mnist = tf.keras.datasets.mnist
(x_train, y_train),(x_test, y_test) = mnist.load_data()
x_train, x_test = x_train / 255.0, x_test / 255.0
model = tf.keras.models.Sequential([
tf.keras.layers.Flatten(),
tf.keras.layers.Dense(512, activation=tf.nn.relu),
... |
SummitKwan/transparent_latent_gan | https://github.com/SummitKwan/transparent_latent_gan | null | null | null | null | 1,979 | null | null | mit | null | null | null | null | null | null | null | src/model/pggan/misc.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:15.803453 | # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# This work is licensed under the Creative Commons Attribution-NonCommercial
# 4.0 International License. To view a copy of this license, visit
# http://creativecommons.org/licenses/by-nc/4.0/ or send a letter to
# Creative Commons, PO Box 1866, Mountain ... |
SummitKwan/transparent_latent_gan | https://github.com/SummitKwan/transparent_latent_gan | null | null | null | null | 1,979 | null | null | mit | null | null | null | null | null | null | null | src/model/pggan/networks.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:15.804804 | # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# This work is licensed under the Creative Commons Attribution-NonCommercial
# 4.0 International License. To view a copy of this license, visit
# http://creativecommons.org/licenses/by-nc/4.0/ or send a letter to
# Creative Commons, PO Box 1866, Mountain ... |
SummitKwan/transparent_latent_gan | https://github.com/SummitKwan/transparent_latent_gan | null | null | null | null | 1,979 | null | null | mit | null | null | null | null | null | null | null | src/model/pggan/metrics/sliced_wasserstein.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:15.806954 | # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# This work is licensed under the Creative Commons Attribution-NonCommercial
# 4.0 International License. To view a copy of this license, visit
# http://creativecommons.org/licenses/by-nc/4.0/ or send a letter to
# Creative Commons, PO Box 1866, Mountain ... |
SummitKwan/transparent_latent_gan | https://github.com/SummitKwan/transparent_latent_gan | null | null | null | null | 1,979 | null | null | mit | null | null | null | null | null | null | null | src/model/pggan/tfutil.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:15.809958 | # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# This work is licensed under the Creative Commons Attribution-NonCommercial
# 4.0 International License. To view a copy of this license, visit
# http://creativecommons.org/licenses/by-nc/4.0/ or send a letter to
# Creative Commons, PO Box 1866, Mountain ... |
brannondorsey/PassGAN | https://github.com/brannondorsey/PassGAN | null | null | null | null | 1,979 | null | null | mit | null | null | null | null | null | null | null | tflib/inception_score.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:19.503366 | # From https://github.com/openai/improved-gan/blob/master/inception_score/model.py
# Code derived from tensorflow/tensorflow/models/image/imagenet/classify_image.py
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os.path
import sys
import tarfile
imp... |
brannondorsey/PassGAN | https://github.com/brannondorsey/PassGAN | null | null | null | null | 1,979 | null | null | mit | null | null | null | null | null | null | null | bin/randomize.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:19.535640 | # https://stackoverflow.com/questions/886237/how-can-i-randomize-the-lines-in-a-file-using-standard-tools-on-red-hat-linux
import random
with open('../data/rockyou-full.txt', 'r') as f:
lines = f.readlines()
random.shuffle(lines)
|
brannondorsey/PassGAN | https://github.com/brannondorsey/PassGAN | null | null | null | null | 1,979 | null | null | mit | null | null | null | null | null | null | null | sample.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:19.536659 | import os
import time
import pickle
import argparse
import tensorflow as tf
import numpy as np
import tflib as lib
import tflib.ops.linear
import tflib.ops.conv1d
import utils
import models
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument('--input-dir', '-i',
r... |
brannondorsey/PassGAN | https://github.com/brannondorsey/PassGAN | null | null | null | null | 1,979 | null | null | mit | null | null | null | null | null | null | null | tflib/cifar10.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:19.539571 | import numpy as np
import os
import urllib
import gzip
import cPickle as pickle
def unpickle(file):
fo = open(file, 'rb')
dict = pickle.load(fo)
fo.close()
return dict['data'], dict['labels']
def cifar_generator(filenames, batch_size, data_dir):
all_data = []
all_labels = []
for filename ... |
brannondorsey/PassGAN | https://github.com/brannondorsey/PassGAN | null | null | null | null | 1,979 | null | null | mit | null | null | null | null | null | null | null | bin/prep-data.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:19.540805 | import sys
import random
random.seed(1337)
# run "python make-rockyou-full.py > data/rockyou-full.txt" to create this file
# if it doesn't already exist
with open('../data/rockyou-full.txt', 'r') as f:
# we can't line buffer because we need everything to randomize
lines = f.readlines()
# filter only pas... |
brannondorsey/PassGAN | https://github.com/brannondorsey/PassGAN | null | null | null | null | 1,979 | null | null | mit | null | null | null | null | null | null | null | tflib/mnist.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:19.541772 | import numpy
import os
import urllib
import gzip
import cPickle as pickle
def mnist_generator(data, batch_size, n_labelled, limit=None):
images, targets = data
rng_state = numpy.random.get_state()
numpy.random.shuffle(images)
numpy.random.set_state(rng_state)
numpy.random.shuffle(targets)
if ... |
brannondorsey/PassGAN | https://github.com/brannondorsey/PassGAN | null | null | null | null | 1,979 | null | null | mit | null | null | null | null | null | null | null | bin/make-rockyou-full.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:19.552628 | # utility script that creates the full rockyou leak using the word count
# redirect this output to a file to save it. Once you do that it is recommended
# to 'sort -R' to randomize it.
with open('../data/rockyou-withcount.txt', 'r') as f:
for line in f:
line = line.strip() # remove leading spaces
tr... |
brannondorsey/PassGAN | https://github.com/brannondorsey/PassGAN | null | null | null | null | 1,979 | null | null | mit | null | null | null | null | null | null | null | tflib/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:19.553518 | import numpy as np
import tensorflow as tf
import locale
locale.setlocale(locale.LC_ALL, '')
_params = {}
_param_aliases = {}
def param(name, *args, **kwargs):
"""
A wrapper for `tf.Variable` which enables parameter sharing in models.
Creates and returns theano shared variables similarly to `tf.Vari... |
brannondorsey/PassGAN | https://github.com/brannondorsey/PassGAN | null | null | null | null | 1,979 | null | null | mit | null | null | null | null | null | null | null | models.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:19.581749 | import tensorflow as tf
import tflib as lib
import tflib.ops.linear
import tflib.ops.conv1d
def ResBlock(name, inputs, dim):
output = inputs
output = tf.nn.relu(output)
output = lib.ops.conv1d.Conv1D(name+'.1', dim, dim, 5, output)
output = tf.nn.relu(output)
output = lib.ops.conv1d.Conv1D(name+'.2... |
brannondorsey/PassGAN | https://github.com/brannondorsey/PassGAN | null | null | null | null | 1,979 | null | null | mit | null | null | null | null | null | null | null | tflib/ops/batchnorm.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:20.136795 | import tflib as lib
import numpy as np
import tensorflow as tf
def Batchnorm(name, axes, inputs, is_training=None, stats_iter=None, update_moving_stats=True, fused=True):
if ((axes == [0,2,3]) or (axes == [0,2])) and fused==True:
if axes==[0,2]:
inputs = tf.expand_dims(inputs, 3)
# Old... |
brannondorsey/PassGAN | https://github.com/brannondorsey/PassGAN | null | null | null | null | 1,979 | null | null | mit | null | null | null | null | null | null | null | tflib/ops/cond_batchnorm.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:20.176523 | import tflib as lib
import numpy as np
import tensorflow as tf
def Batchnorm(name, axes, inputs, is_training=None, stats_iter=None, update_moving_stats=True, fused=True, labels=None, n_labels=None):
"""conditional batchnorm (dumoulin et al 2016) for BCHW conv filtermaps"""
if axes != [0,2,3]:
raise Ex... |
brannondorsey/PassGAN | https://github.com/brannondorsey/PassGAN | null | null | null | null | 1,979 | null | null | mit | null | null | null | null | null | null | null | tflib/ops/conv1d.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:20.177092 | import tflib as lib
import numpy as np
import tensorflow as tf
_default_weightnorm = False
def enable_default_weightnorm():
global _default_weightnorm
_default_weightnorm = True
def Conv1D(name, input_dim, output_dim, filter_size, inputs, he_init=True, mask_type=None, stride=1, weightnorm=None, biases=True, ... |
brannondorsey/PassGAN | https://github.com/brannondorsey/PassGAN | null | null | null | null | 1,979 | null | null | mit | null | null | null | null | null | null | null | tflib/ops/conv2d.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:20.179483 | import tflib as lib
import numpy as np
import tensorflow as tf
_default_weightnorm = False
def enable_default_weightnorm():
global _default_weightnorm
_default_weightnorm = True
_weights_stdev = None
def set_weights_stdev(weights_stdev):
global _weights_stdev
_weights_stdev = weights_stdev
def unset... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.