code stringlengths 17 6.64M |
|---|
class Configuration():
def __init__(self, name: str, corpus_from_directory: Callable[([Path], Corpus)], allowed_characters: List[chr]=english_frequent_characters, directories: DataDirectories=default_data_directories, mel_frequency_count: int=128, training_batches_per_epoch: int=100, batch_size: int=64):
... |
class LoggedRun():
def __init__(self, action: Callable[([], None)], name: str, results_directory: Path=default_data_directories.test_results_directory):
self.action = action
self.name = name
self.results_directory = results_directory
self.result_file = (self.results_directory / se... |
class ParsingException(Exception):
pass
|
class Phase(Enum):
training = 'training'
test = 'test'
|
class Corpus():
__metaclass__ = ABCMeta
def __init__(self, training_examples: List[LabeledExample], test_examples: List[LabeledExample], sampled_training_example_count: Optional[int]=None):
self.training_examples = (training_examples if (sampled_training_example_count is None) else random.Random(42).... |
class ComposedCorpus(Corpus):
def __init__(self, corpora: List[Corpus]):
self.corpora = corpora
training_examples = [example for corpus in corpora for example in corpus.training_examples]
super().__init__(training_examples=training_examples, test_examples=[example for corpus in corpora fo... |
class TrainingTestSplit():
training_only = (lambda examples: (examples, []))
test_only = (lambda examples: ([], examples))
@staticmethod
def randomly_grouped_by(key_from_example: Callable[([LabeledExample], Any)], training_share: float=0.9) -> Callable[([List[LabeledExample]], Tuple[(List[LabeledExam... |
def _cache_spectrogram(labeled_spectrogram: CachedLabeledSpectrogram) -> None:
labeled_spectrogram.z_normalized_transposed_spectrogram()
|
def _repair_cached_spectrogram_if_incorrect(labeled_spectrogram: CachedLabeledSpectrogram) -> None:
labeled_spectrogram.repair_cached_file_if_incorrect()
|
class LabeledSpectrogramBatchGenerator():
def __init__(self, corpus: Corpus, spectrogram_cache_directory: Path, batch_size: int=64):
mkdir(spectrogram_cache_directory)
self.batch_size = batch_size
self.spectrogram_cache_directory = spectrogram_cache_directory
self.labeled_training... |
class LibriSpeechCorpus(Corpus):
def __init__(self, base_directory: Path, corpus_name: str, base_source_url_or_directory: str='http://www.openslr.org/resources/12/', tar_gz_extension: str='.tar.gz', mel_frequency_count: int=128, root_compressed_directory_name_to_skip: Optional[str]='LibriSpeech/', subdirectory_d... |
def dev_clean(base_directory: Path) -> LibriSpeechCorpus:
return LibriSpeechCorpus(base_directory=base_directory, corpus_name='dev-clean', training_test_split=TrainingTestSplit.training_only)
|
def english_corpus(base_directory: Path) -> ComposedCorpus:
return ComposedCorpus([dev_clean(base_directory), LibriSpeechCorpus(base_directory=base_directory, corpus_name='dev-other', training_test_split=TrainingTestSplit.training_only), LibriSpeechCorpus(base_directory=base_directory, corpus_name='train-clean-10... |
def minimal_english_corpus(base_directory: Path) -> ComposedCorpus:
return ComposedCorpus([dev_clean(base_directory)])
|
class UmlautDecoder():
none = (lambda text: text)
quote_before_umlaut = (lambda text: text.replace('\\"a', 'ä').replace('\\"o', 'ö').replace('\\"u', 'ü').replace('\\"s', 'ß').replace('"a', 'ä').replace('"o', 'ö').replace('"u', 'ü').replace('"s', 'ß'))
quote_after_umlaut = (lambda text: text.replace('a\\"'... |
class GermanClarinCorpus(LibriSpeechCorpus):
'\n Parses the labeled German speech data downloadable from https://clarin.phonetik.uni-muenchen.de/BASRepository/.\n '
def __init__(self, corpus_name: str, base_directory: Path, base_source_url_or_directory: str='ketos:/projects/korpora/speech/', umlaut_dec... |
def clarin_corpora_sorted_by_size(base_directory: Path) -> List[GermanClarinCorpus]:
return [sc1(base_directory), pd2(base_directory), ziptel(base_directory), sc10(base_directory), GermanClarinCorpus('all.HEMPEL.4.cmdi.11610.1490680796', base_directory), GermanClarinCorpus('all.PD1.3.cmdi.16312.1490681066', base_... |
def sc1(base_directory: Path) -> GermanClarinCorpus:
return GermanClarinCorpus('all.SC1.3.cmdi.15010.1490631864', base_directory, umlaut_decoder=UmlautDecoder.quote_after_umlaut, training_test_split=TrainingTestSplit.test_only)
|
def pd2(base_directory: Path) -> GermanClarinCorpus:
return GermanClarinCorpus('all.PD2.4.cmdi.16693.1490681127', base_directory)
|
def ziptel(base_directory: Path) -> GermanClarinCorpus:
return GermanClarinCorpus('all.ZIPTEL.3.cmdi.63058.1490624016', base_directory)
|
def sc10(base_directory: Path, training_test_split=TrainingTestSplit.test_only) -> GermanClarinCorpus:
return GermanClarinCorpus('all.SC10.4.cmdi.13781.1490631055', base_directory, umlaut_decoder=UmlautDecoder.try_quote_before_umlaut_then_after, training_test_split=training_test_split, id_filter_regex=sc10_broken... |
class GermanVoxforgeCorpus(GermanClarinCorpus):
def __init__(self, base_directory: Path):
super().__init__(corpus_name='german-speechdata-package-v2', base_directory=base_directory, base_source_url_or_directory='http://www.repository.voxforge1.org/downloads/de/', tar_gz_extension='.tar.gz', subdirectory_... |
def german_corpus(base_directory: Path) -> ComposedCorpus:
return ComposedCorpus((clarin_corpora_sorted_by_size(base_directory=base_directory) + [GermanVoxforgeCorpus(base_directory=base_directory)]))
|
class SpectrogramFrequencyScale(Enum):
linear = 'linear'
mel = 'mel'
|
class SpectrogramType(Enum):
power = 'power'
amplitude = 'amplitude'
power_level = 'power level'
|
def z_normalize(array: ndarray) -> ndarray:
return ((array - mean(array)) / std(array))
|
class PositionalLabel():
def __init__(self, labeled_sections: List[Tuple[(str, Tuple[(float, float)])]]):
if (not labeled_sections):
raise ValueError('Sections must be specified.')
if any(((range is None) for (label, range) in labeled_sections)):
raise ValueError('Range mu... |
class LabeledSpectrogram():
__metaclass__ = ABCMeta
def __init__(self, id: str, label: str):
self.label = label
self.id = id
@abstractmethod
def z_normalized_transposed_spectrogram(self) -> ndarray:
raise NotImplementedError
|
class LabeledExample(LabeledSpectrogram):
def __init__(self, get_raw_audio: Callable[([], ndarray)], sample_rate: int=16000, id: Optional[str]=None, label: Optional[str]='nolabel', fourier_window_length: int=512, hop_length: int=128, mel_frequency_count: int=128, label_with_tags: str=None, positional_label: Opti... |
class LabeledExampleFromFile(LabeledExample):
def __init__(self, audio_file: Path, id: Optional[str]=None, sample_rate_to_convert_to: int=16000, label: Optional[str]='nolabel', fourier_window_length: int=512, hop_length: int=128, mel_frequency_count: int=128, label_with_tags: str=None, positional_label: Optional... |
class CachedLabeledSpectrogram(LabeledSpectrogram):
def __init__(self, original: LabeledSpectrogram, spectrogram_cache_directory: Path):
super().__init__(id=original.id, label=original.label)
self.original = original
self.spectrogram_cache_file = (spectrogram_cache_directory / '{}.npy'.fo... |
class LabeledExamplePlotter():
def __init__(self, example: LabeledExample):
self.example = example
def _plot_audio(self, audio: ndarray) -> None:
plt.title(str(self))
plt.xlabel('time / samples (sample rate {}Hz)'.format(self.example.sample_rate))
plt.ylabel('y')
plt.... |
class Recorder():
def __init__(self, silence_threshold_for_unnormalized_audio: float=0.03, chunk_size: int=1024, sample_rate: int=16000, silence_until_terminate_in_s: int=3):
self.silence_threshold_for_not_normalized_sound = silence_threshold_for_unnormalized_audio
self.chunk_size = chunk_size
... |
def record_plot_and_save(recorder: Recorder=Recorder(), recording_directory: Path=configuration.default_data_directories.recording_directory) -> LabeledExample:
from speechless.labeled_example_plotter import LabeledExamplePlotter
mkdir(recording_directory)
name = 'recording-{}'.format(timestamp())
exa... |
class LoggedRunTest(TestCase):
def test(self):
l1 = LoggedRun((lambda : log('1')), 'test1', Path())
l1()
self.assertEqual('1\n', l1.result_file.read_text())
l2 = LoggedRun((lambda : log('2')), 'test2', Path())
l2()
self.assertEqual('1\n', l1.result_file.read_text()... |
class CtcDecodersTest(TestCase):
def test(self):
def decode_greedily(beam_search: bool, merge_repeated: bool):
aa_ctc_blank_aa_logits = tf.constant(np.array([[[1.0, 0.0]], [[1.0, 0.0]], [[0.0, 1.0]], [[1.0, 0.0]], [[1.0, 0.0]]], dtype=np.float32))
sequence_length = tf.constant(np... |
class CtcGraphemeEncodingTests(TestCase):
def test_encode(self):
g = CtcGraphemeEncoding(english_frequent_characters)
label = "she wasn't three abcxyz"
self.assertEqual(label, g.decode_graphemes(g.encode(label), merge_repeated=False))
def test_decode(self):
g = CtcGraphemeEnc... |
class AsgGraphemeEncodingTests(TestCase):
def test_encode_repetitions(self):
g = AsgGraphemeEncoding(english_frequent_characters)
self.assertEqual([g.encode_character('e'), g.asg_twice], g.encode('ee'))
self.assertEqual([g.encode_character('e'), g.asg_thrice], g.encode('eee'))
wit... |
class LabeledExampleTest(TestCase):
def test(self):
example = corpus.examples[0]
mel_power_spectrogram = librosa.feature.melspectrogram(y=example.get_raw_audio(), n_fft=example.fourier_window_length, hop_length=example.hop_length, sr=example.sample_rate)
self.assertTrue(np.array_equal(mel... |
class NetTest(TestCase):
def test_sanity_expectation_vs_prediction(self):
a = ExpectationVsPrediction(expected='A', predicted='A', loss=0.0)
b = ExpectationVsPrediction(expected='B', predicted='A', loss=2.0)
results_batches = [ExpectationsVsPredictions([a, b]), ExpectationsVsPredictions([... |
class ToolsTest(TestCase):
def test_paginate(self):
a = paginate([1, 2, 3], 2)
self.assertEqual(list(a), [[1, 2], [3]])
|
def single(sequence: List[E]) -> E:
first = sequence[0]
assert (len(sequence) == 1)
return first
|
def single_or_none(sequence: List[E]) -> Optional[E]:
assert (len(sequence) <= 1)
return next(iter(sequence), None)
|
def read_text(path: Path, encoding=None) -> str:
'\n Not Path.read_text for compatibility with Python 3.4.\n '
with path.open(encoding=encoding) as f:
return f.read()
|
def write_text(path: Path, text: str, encoding=None):
'\n Not Path.write_text for compatibility with Python 3.4.\n '
with path.open(mode='w', encoding=encoding) as f:
f.write(text)
|
def mkdir(directory: Path) -> None:
'\n Not Path.mkdir() for compatibility with Python 3.4.\n '
makedirs(str(directory), exist_ok=True)
|
def home_directory() -> Path:
'\n Not Path.home() for compatibility with Python 3.4.\n '
return Path(path.expanduser('~'))
|
def name_without_extension(audio_file: Path) -> str:
return path.splitext(audio_file.name)[0]
|
def extension(audio_file: Path) -> str:
return path.splitext(audio_file.name)[1]
|
def distinct(sequence: List[E]) -> List[E]:
return list(OrderedDict.fromkeys(sequence))
|
def count_summary(sequence: List[E]) -> str:
return ', '.join(['{}: {}'.format(tag, count) for (tag, count) in Counter(sequence).most_common()])
|
def group(iterable: Iterable[E], key: Callable[([E], K)], value: Callable[([E], V)]=(lambda x: x)) -> Dict[(K, Tuple[V])]:
return OrderedDict(((k, tuple(map(value, values))) for (k, values) in groupby(sorted(iterable, key=key), key)))
|
def timestamp() -> str:
return strftime('%Y%m%d-%H%M%S')
|
def duplicates(sequence: Iterable[E]) -> List[E]:
return [item for (item, count) in Counter(sequence).items() if (count > 1)]
|
def average_or_nan(numbers: List[float]) -> float:
if (len(numbers) == 0):
return float('nan')
return (sum(numbers) / len(numbers))
|
def paginate(sequence: List[E], page_size: int) -> Iterable[List[E]]:
for start in range(0, len(sequence), page_size):
(yield sequence[start:(start + page_size)])
|
def log(obj: Any):
logger.info(str(obj))
|
class Dataset(torch.utils.data.Dataset):
def __init__(self, data, n_context=None, question_prefix='question:', title_prefix='title:', passage_prefix='context:'):
self.data = data
self.n_context = n_context
self.question_prefix = question_prefix
self.title_prefix = title_prefix
... |
class Collator(object):
def __init__(self, text_maxlength, tokenizer, answer_maxlength=20, for_eval=False):
self.tokenizer = tokenizer
self.text_maxlength = text_maxlength
self.answer_maxlength = answer_maxlength
identifiers = tokenizer.encode('<PM_LEFT> <PM_RIGHT> <QM_LEFT> <QM_R... |
def encode_passages(batch_text_passages, tokenizer, max_length):
(passage_ids, passage_masks) = ([], [])
for (k, text_passages) in enumerate(batch_text_passages):
p = tokenizer(text_passages, max_length=max_length, padding='max_length', return_tensors='pt', truncation=True)
sp = p['input_ids']... |
def split_data(jsonl_path, graph_path, local_rank, world_size, graph_block_size=5000):
train_data = []
data_name = graph_path.split('/')[(- 1)]
graph_path = graph_path[:graph_path.index(data_name)]
prefixed = [filename for filename in os.listdir(graph_path) if filename.startswith(data_name)]
def ... |
def insert_markers_psg(passage_text, gold_link_offsets, gold_link_length):
accumulated_offsets = 0
start_marker = '<QM_LEFT>'
end_marker = '<QM_RIGHT>'
new_gold_link_offsets = []
for (offset, length) in zip(gold_link_offsets, gold_link_length):
current_offset = (offset + accumulated_offset... |
class SimpleTokenizer(object):
ALPHA_NUM = '[\\p{L}\\p{N}\\p{M}]+'
NON_WS = '[^\\p{Z}\\p{C}]'
def __init__(self):
'\n Args:\n annotators: None or empty set (only tokenizes).\n '
self._regexp = regex.compile(('(%s)|(%s)' % (self.ALPHA_NUM, self.NON_WS)), flags=((re... |
def calculate_matches(data: List, workers_num: int):
"\n Evaluates answers presence in the set of documents. This function is supposed to be used with a large collection of\n documents and results. It internally forks multiple sub-processes for evaluation and then merges results\n :param all_docs: dictio... |
def check_answer(example, tokenizer) -> List[bool]:
'Search through all the top docs to see if they have any of the answers.'
answers = example['answers']
ctxs = example['ctxs']
hits = []
for (i, doc) in enumerate(ctxs):
text = doc['text']
if (text is None):
logger.warn... |
def has_answer(answers, text, tokenizer) -> bool:
'Check if a document contains an answer string.'
text = _normalize(text)
text = tokenizer.tokenize(text, uncased=True)
for answer in answers:
answer = _normalize(answer)
answer = tokenizer.tokenize(answer, uncased=True)
for i in... |
def _normalize(text):
return unicodedata.normalize('NFD', text)
|
def normalize_answer(s):
def remove_articles(text):
return regex.sub('\\b(a|an|the)\\b', ' ', text)
def white_space_fix(text):
return ' '.join(text.split())
def remove_punc(text):
exclude = set(string.punctuation)
return ''.join((ch for ch in text if (ch not in exclude))... |
def exact_match_score(prediction, ground_truth):
return (normalize_answer(prediction) == normalize_answer(ground_truth))
|
def ems(prediction, ground_truths):
return max([exact_match_score(prediction, gt) for gt in ground_truths])
|
def eval_batch(scores, inversions, avg_topk, idx_topk):
for (k, s) in enumerate(scores):
s = s.cpu().numpy()
sorted_idx = np.argsort((- s))
score(sorted_idx, inversions, avg_topk, idx_topk)
|
def count_inversions(arr):
inv_count = 0
lenarr = len(arr)
for i in range(lenarr):
for j in range((i + 1), lenarr):
if (arr[i] > arr[j]):
inv_count += 1
return inv_count
|
def score(x, inversions, avg_topk, idx_topk):
x = np.array(x)
inversions.append(count_inversions(x))
for k in avg_topk:
avg_pred_topk = (x[:k] < k).mean()
avg_topk[k].append(avg_pred_topk)
for k in idx_topk:
below_k = (x < k)
idx_gold_topk = (len(x) - np.argmax(below_k[... |
class Indexer(object):
def __init__(self, vector_sz, n_subquantizers=0, n_bits=8):
if (n_subquantizers > 0):
self.index = faiss.IndexPQ(vector_sz, n_subquantizers, n_bits, faiss.METRIC_INNER_PRODUCT)
else:
self.index = faiss.IndexFlatIP(vector_sz)
self.index_id_to_... |
class MPIAdapter():
'\n MPIAdapter automatically detects and analyzes the training environment for distributed training\n and offers methods to set up distributed training jobs.\n\n For example, it determines whether training happens on AML, Philly, or locally.\n It also determines variables such as t... |
class Options():
def __init__(self):
self.parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
self.initialize_parser()
def add_optim_options(self):
self.parser.add_argument('--warmup_steps', type=int, default=1000)
self.parser.add_argument... |
def get_options(use_reader=False, use_retriever=False, use_optim=False, use_eval=False):
options = Options()
if use_reader:
options.add_reader_options()
if use_retriever:
options.add_retriever_options()
if use_optim:
options.add_optim_options()
if use_eval:
options.... |
def select_examples_TQA(data, index, passages, passages_index):
selected_data = []
for (i, k) in enumerate(index):
ex = data[k]
q = ex['Question']
answers = ex['Answer']['Aliases']
target = ex['Answer']['Value']
ctxs = [{'id': idx, 'title': passages[idx][1], 'text': pas... |
def select_examples_NQ(data, index, passages, passages_index):
selected_data = []
for (i, k) in enumerate(index):
ctxs = [{'id': idx, 'title': passages[idx][1], 'text': passages[idx][0]} for idx in passages_index[str(i)]]
dico = {'question': data[k]['question'], 'answers': data[k]['answer'], '... |
def sig_handler(signum, frame):
logger.warning(('Signal handler called with signal ' + str(signum)))
prod_id = int(os.environ['SLURM_PROCID'])
logger.warning(('Host: %s - Global rank: %i' % (socket.gethostname(), prod_id)))
if (prod_id == 0):
logger.warning(('Requeuing job ' + os.environ['SLUR... |
def term_handler(signum, frame):
logger.warning(('Signal handler called with signal ' + str(signum)))
logger.warning('Bypassing SIGTERM.')
|
def init_signal_handler():
'\n Handle signals sent by SLURM for time limit / pre-emption.\n '
signal.signal(signal.SIGUSR1, sig_handler)
signal.signal(signal.SIGTERM, term_handler)
|
def init_distributed_mode(params):
'\n Handle single and multi-GPU / multi-node / SLURM jobs.\n Initialize the following variables:\n - n_nodes\n - node_id\n - local_rank\n - global_rank\n - world_size\n '
params.is_slurm_job = ('SLURM_JOB_ID' in os.environ)
has... |
def init_logger(is_main=True, is_distributed=False, filename=None):
if is_distributed:
torch.distributed.barrier()
handlers = [logging.StreamHandler(sys.stdout)]
if (filename is not None):
handlers.append(logging.FileHandler(filename=filename))
logging.basicConfig(datefmt='%m/%d/%Y %H:... |
def get_checkpoint_path(opt):
checkpoint_path = (Path(opt.checkpoint_dir) / opt.name)
checkpoint_exists = checkpoint_path.exists()
if opt.is_distributed:
torch.distributed.barrier()
checkpoint_path.mkdir(parents=True, exist_ok=True)
return (checkpoint_path, checkpoint_exists)
|
def symlink_force(target, link_name):
try:
os.symlink(target, link_name)
except OSError as e:
if (e.errno == errno.EEXIST):
os.remove(link_name)
os.symlink(target, link_name)
else:
raise e
|
def save(model, optimizer, scheduler, step, best_eval_metric, opt, dir_path, name):
model_to_save = (model.module if hasattr(model, 'module') else model)
path = os.path.join(dir_path, 'checkpoint')
epoch_path = os.path.join(path, name)
os.makedirs(epoch_path, exist_ok=True)
model_to_save.save_pret... |
def load(model_class, dir_path, opt, reset_params=False):
epoch_path = os.path.realpath(dir_path)
optimizer_path = os.path.join(epoch_path, 'optimizer.pth.tar')
logger.info(('Loading %s' % epoch_path))
gnn_config = json.load(open((epoch_path + '/gnn_config.json')))
model = model_class.from_pretrai... |
class WarmupLinearScheduler(torch.optim.lr_scheduler.LambdaLR):
def __init__(self, optimizer, warmup_steps, scheduler_steps, min_ratio, fixed_lr, last_epoch=(- 1)):
self.warmup_steps = warmup_steps
self.scheduler_steps = scheduler_steps
self.min_ratio = min_ratio
self.fixed_lr = f... |
class FixedScheduler(torch.optim.lr_scheduler.LambdaLR):
def __init__(self, optimizer, last_epoch=(- 1)):
super(FixedScheduler, self).__init__(optimizer, self.lr_lambda, last_epoch=last_epoch)
def lr_lambda(self, step):
return 1.0
|
def set_dropout(model, dropout_rate):
for mod in model.modules():
if isinstance(mod, torch.nn.Dropout):
mod.p = dropout_rate
|
def set_optim(opt, model):
if (opt.optim == 'adam'):
optimizer = torch.optim.Adam(model.parameters(), lr=opt.lr)
elif (opt.optim == 'adamw'):
optimizer = torch.optim.AdamW(model.parameters(), lr=opt.lr, weight_decay=opt.weight_decay)
if (opt.scheduler == 'fixed'):
scheduler = Fixed... |
def average_main(x, opt):
if (not opt.is_distributed):
return x
if (opt.world_size > 1):
dist.reduce(x, 0, op=dist.ReduceOp.SUM)
if opt.is_main:
x = (x / opt.world_size)
return x
|
def sum_main(x, opt):
if (not opt.is_distributed):
return x
if (opt.world_size > 1):
dist.reduce(x, 0, op=dist.ReduceOp.SUM)
return x
|
def weighted_average(x, count, opt):
if (not opt.is_distributed):
return (x, count)
t_loss = torch.tensor([(x * count)], device=opt.device)
t_total = torch.tensor([count], device=opt.device)
t_loss = sum_main(t_loss, opt)
t_total = sum_main(t_total, opt)
return ((t_loss / t_total).item... |
def write_output(glob_path, output_path):
files = list(glob_path.glob('*.txt'))
files.sort()
with open(output_path, 'w') as outfile:
for path in files:
with open(path, 'r') as f:
lines = f.readlines()
for line in lines:
outfile.write(... |
def save_distributed_dataset(data, opt):
dir_path = (Path(opt.checkpoint_dir) / opt.name)
write_path = (dir_path / 'tmp_dir')
write_path.mkdir(exist_ok=True)
tmp_path = (write_path / f'{opt.global_rank}.json')
with open(tmp_path, 'w') as fw:
json.dump(data, fw)
if opt.is_distributed:
... |
def load_passages(path):
if (not os.path.exists(path)):
logger.info(f'{path} does not exist')
return
logger.info(f'Loading passages from: {path}')
passages = []
with open(path) as fin:
reader = csv.reader(fin, delimiter='\t')
for (k, row) in enumerate(reader):
... |
def truncate_graph_wrt_n_passage(graph, node_indices, n_passage):
if (n_passage == 100):
return (graph, node_indices)
mention_nodes_to_remove = []
new_mention_indices = []
for (index, triple) in enumerate(node_indices['mention_nodes']):
if (triple[0] >= n_passage):
mention_... |
def freeze_t5(model):
model = (model.module if hasattr(model, 'module') else model)
for (name, child) in model.named_children():
if (name == 'gnn_model'):
continue
for param in child.parameters():
param.requires_grad = False
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.