Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/ConnorJL/GPT2
/ functions
Functions
101 in github.com/ConnorJL/GPT2
⨍
Functions
101
◇
Types & classes
5
↓ 5 callers
Function
dropout
(x, pdrop, train)
models/gpt2/gpt2.py:157
↓ 5 callers
Function
mkdir
(fp)
datasets/openwebtext/extract_text.py:94
↓ 5 callers
Function
shape_list
Deal with dynamic shape in tensorflow cleanly.
models/gpt2/gpt2.py:7
↓ 4 callers
Function
conv1d
(x, scope, nf, *, w_init_stdev=0.02, params=None, scale=False)
models/gpt2/gpt2.py:47
↓ 4 callers
Method
delete
Delete the TPU node.
experimental/tpu_survival.py:116
↓ 4 callers
Method
tpu_name
Format tpu_name to be used in creation and deletion calls.
experimental/tpu_survival.py:53
↓ 3 callers
Function
bpe_text
(batch_size, files, iterations, stitch, amount=1024, batch=True)
inputs.py:53
↓ 3 callers
Function
norm
Normalize to mean = 0, std = 1, then do a diagonal affine transform.
models/gpt2/gpt2.py:21
↓ 2 callers
Function
_get_x
(i)
inputs.py:73
↓ 2 callers
Method
_resource_apply_dense
(self, grad, handle)
optimizers.py:255
↓ 2 callers
Method
_should_use_factored_second_moment_estimate
Should we use a factored second moment estimator. Based on the shape of the variable. Args: shape: a list of integers
optimizers.py:207
↓ 2 callers
Function
adafactor_decay_rate_pow
(exponent)
optimizers.py:329
↓ 2 callers
Method
create
Create a TPU node.
experimental/tpu_survival.py:129
↓ 2 callers
Method
decode
(self, tokens)
models/gpt2/encoder.py:104
↓ 2 callers
Method
encode
(self, text)
datasets/openwebtext/encoder.py:97
↓ 2 callers
Method
encode
(self, text)
models/gpt2/encoder.py:97
↓ 2 callers
Function
extract_month
(url_file_name)
datasets/openwebtext/extract_text.py:75
↓ 2 callers
Function
get_pairs
Return set of symbol pairs in a word. Word is represented as tuple of symbols (symbols being variable-length strings).
datasets/openwebtext/encoder.py:32
↓ 2 callers
Function
get_pairs
Return set of symbol pairs in a word. Word is represented as tuple of symbols (symbols being variable-length strings).
models/gpt2/encoder.py:32
↓ 2 callers
Method
get_value
(self)
experimental/experiments.py:69
↓ 2 callers
Method
kill_current_task
Kill the current running task.
experimental/tpu_survival.py:81
↓ 2 callers
Function
parse_archive
(archive_fp, out_dir, n_procs, chunk_size=100)
datasets/openwebtext/extract_text.py:47
↓ 2 callers
Function
reduce_rms
(x)
optimizers.py:335
↓ 2 callers
Function
save
(runners)
experimental/overrunner.py:38
↓ 2 callers
Function
step
(params, tokens, past=None)
models/gpt2/sample.py:34
↓ 2 callers
Function
step_num
()
optimizers.py:332
↓ 1 callers
Method
_apply_dense
(self, grad, var)
optimizers.py:231
↓ 1 callers
Function
_bytes_feature
Returns a bytes_list from a string / byte.
datasets/openwebtext/create_tfrecords.py:27
↓ 1 callers
Method
_decay_rate_default
(self)
optimizers.py:312
↓ 1 callers
Function
_int64_feature
Returns an int64_list from a bool / enum / int / uint.
datasets/openwebtext/create_tfrecords.py:23
↓ 1 callers
Method
_learning_rate_default
(self, multiply_by_parameter_scale)
optimizers.py:315
↓ 1 callers
Method
_parameter_scale
Estimate the scale of the parameters from the current values. We include a minimum value of 0.001 to give it a chance to escape 0 if i
optimizers.py:242
↓ 1 callers
Function
_top_k
()
models/gpt2/sample.py:10
↓ 1 callers
Function
adafactor_decay_rate_adam
(beta2)
optimizers.py:322
↓ 1 callers
Function
attention_mask
1's in the lower triangle, counting from the lower right corner. Same as tf.matrix_band_part(tf.ones([nd, ns]), -1, ns-nd), but doesn't produce g
models/gpt2/gpt2.py:64
↓ 1 callers
Function
attn
(x, scope, n_state, *, past, params, train=False)
models/gpt2/gpt2.py:75
↓ 1 callers
Function
block
(x, scope, *, past, params, train=False)
models/gpt2/gpt2.py:134
↓ 1 callers
Method
bpe
(self, token)
datasets/openwebtext/encoder.py:56
↓ 1 callers
Method
bpe
(self, token)
models/gpt2/encoder.py:56
↓ 1 callers
Function
bytes_to_unicode
Returns list of utf-8 byte and a corresponding list of unicode strings. The reversible bpe codes work on unicode strings. This means you
datasets/openwebtext/encoder.py:11
↓ 1 callers
Function
bytes_to_unicode
Returns list of utf-8 byte and a corresponding list of unicode strings. The reversible bpe codes work on unicode strings. This means you
models/gpt2/encoder.py:11
↓ 1 callers
Function
cast_like
Cast x to y's dtype, if necessary.
optimizers.py:338
↓ 1 callers
Function
chunks
(l, n)
datasets/openwebtext/create_tfrecords.py:32
↓ 1 callers
Function
chunks
Yield successive n-sized chunks from l.
datasets/openwebtext/extract_text.py:82
↓ 1 callers
Function
cosine_decay_with_warmup
(global_step, learning_rate_base, total_steps,
optimizers.py:66
↓ 1 callers
Function
create_train_op
(loss, params)
optimizers.py:5
↓ 1 callers
Method
dump_dict
(self)
experimental/tpu_survival.py:148
↓ 1 callers
Function
expand_tile
Add a new axis of given size.
models/gpt2/gpt2.py:146
↓ 1 callers
Function
gelu
(x)
models/gpt2/gpt2.py:18
↓ 1 callers
Function
generate_experiments
(base, parameters, number)
experimental/experiments.py:100
↓ 1 callers
Function
get_processed_files
(out_dir)
datasets/openwebtext/extract_text.py:42
↓ 1 callers
Function
list_tpus
List existing TPU nodes in the project/location. Args: project: (str) GCP project id. location: (str) GCP compute location, such as "us-ce
experimental/tpu_survival.py:162
↓ 1 callers
Function
mask_attn_weights
(w)
models/gpt2/gpt2.py:89
↓ 1 callers
Function
merge_heads
(x)
models/gpt2/gpt2.py:85
↓ 1 callers
Function
merge_states
Smash the last two dimensions of x into a single dimension.
models/gpt2/gpt2.py:42
↓ 1 callers
Function
mlp
(x, scope, n_state, *, params, train=False)
models/gpt2/gpt2.py:125
↓ 1 callers
Function
multihead_attn
(q, k, v)
models/gpt2/gpt2.py:97
↓ 1 callers
Function
openwebtext
(params, eval=False, batch=True)
inputs.py:8
↓ 1 callers
Function
openwebtext_long
(params, eval=False, batch=True)
inputs.py:20
↓ 1 callers
Function
perplexity_metric
(loss)
metric_fns.py:3
↓ 1 callers
Function
positions_for
(tokens, past_length)
models/gpt2/gpt2.py:152
↓ 1 callers
Method
run_task
Call a subprocess to run the training task on the current TPU node.
experimental/tpu_survival.py:95
↓ 1 callers
Function
save_parsed_text
(parsed_entries, out_dir)
datasets/openwebtext/extract_text.py:35
↓ 1 callers
Function
softmax
(x, axis=-1)
models/gpt2/gpt2.py:13
↓ 1 callers
Function
split_states
Reshape the last dimension of x into [n, x.shape[-1]/n].
models/gpt2/gpt2.py:37
↓ 1 callers
Function
top_k_logits
(logits, k)
models/gpt2/sample.py:5
↓ 1 callers
Method
tpu_cidr_block
Format CIDR block to be used in creation calls.
experimental/tpu_survival.py:57
↓ 1 callers
Method
update_state
Poll the TPU nodes and update self.state.
experimental/tpu_survival.py:62
Method
__init__
Construct a new Adafactor optimizer. See class comment. Args: multiply_by_parameter_scale: a boolean learning_rate: an
optimizers.py:163
Method
__init__
(self, encoder, bpe_merges, errors='replace')
datasets/openwebtext/encoder.py:44
Method
__init__
(self, encoder, bpe_merges, errors='replace')
models/gpt2/encoder.py:44
Method
__init__
(self, name, distribution, model=True, dtype=None, values=None)
experimental/experiments.py:49
Method
__init__
(self, project=None, location=None, id=None, params=None, d=None)
experimental/tpu_survival.py:23
Method
_apply_sparse
(self, grad, var)
optimizers.py:234
Function
_assert_float_dtype
(dtype)
models/gpt2/gpt2.py:162
Method
_create_slots
(self, var_list)
optimizers.py:217
Function
_parse_function
(example_proto)
inputs.py:57
Method
_resource_apply_sparse
(self, grad, handle, indices)
optimizers.py:237
Function
_sample_text
(x)
inputs.py:86
Function
_stitch_text
(x, y)
inputs.py:70
Function
body
(past, prev, output)
models/gpt2/sample.py:57
Function
cond
(*args)
models/gpt2/sample.py:68
Function
create_file
(args)
datasets/openwebtext/create_tfrecords.py:47
Function
create_tpu
Create a TPU node. Args: project: (str) GCP project id. location: (str) GCP compute location, such as "us-central1-b". tpu_name: (str)
experimental/tpu_survival.py:180
Method
decode
(self, tokens)
datasets/openwebtext/encoder.py:104
Function
delete_tpu
List existing TPU nodes in the project/location. Args: project: (str) GCP project id. location: (str) GCP compute location, such as "us-ce
experimental/tpu_survival.py:236
Function
do_work
(f)
datasets/openwebtext/run_newspaper_extract.py:21
Function
extract_archive
(archive_fp, outdir=".")
datasets/openwebtext/extract_text.py:88
Function
generic_text
(params)
inputs.py:42
Function
get_encoder
(encoder_path)
datasets/openwebtext/encoder.py:109
Function
get_encoder
(encoder_path)
models/gpt2/encoder.py:109
Function
get_tpu
List existing TPU nodes in the project/location. Args: project: (str) GCP project id. location: (str) GCP compute location, such as "us-ce
experimental/tpu_survival.py:217
Function
gpt2_model
(features, labels, mode, params)
model_fns.py:9
Function
gpt2_pred_input
(params, text=None)
inputs.py:110
Function
gpt2_predict
(network, text, params)
predict_fns.py:11
Function
model
(X, params, labels=None, past=None, scope='model', reuse=False, train=False)
models/gpt2/gpt2.py:168
Function
openwebtext_longbiased
(params, eval=False)
inputs.py:32
Function
parse_file
(file_entry)
datasets/openwebtext/extract_text.py:27
Function
past_shape
(*, params, batch_size=None, sequence=None)
models/gpt2/gpt2.py:143
Function
sample_sequence
(*, params, length, start_token=None, batch_size=None, context=None, temperature=1, top_k=0)
models/gpt2/sample.py:25
next →
1–100 of 101, ranked by callers