Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/csunny/algorithm
/ functions
Functions
223 in github.com/csunny/algorithm
⨍
Functions
223
◇
Types & classes
47
↓ 12 callers
Method
get
(self, key)
hashtable/ht.py:30
↓ 8 callers
Method
__init__
(self, dim: int, eps: float = 1e-8)
moe/model_config.py:91
↓ 7 callers
Method
add_tail
尾部插入的方式 :param item: :return:
linklist/base.py:63
↓ 7 callers
Method
pop
(self)
stack/base.py:19
↓ 6 callers
Method
__init__
(self, normalized_shape, dropout, **kwargs)
nlp/transformer.py:69
↓ 4 callers
Method
find
(self, vertex)
graph/directed_graph.py:21
↓ 3 callers
Method
__init__
(self, vocab_size, num_hiddens, num_inputs=768, **kwargs)
nlp/bert.py:52
↓ 3 callers
Method
__init__
(self, jsonl_path, tokenizer, max_length=1024)
moe/lm_dataset.py:80
↓ 3 callers
Method
_cus_hash
自定义的hash函数
hashtable/ht.py:12
↓ 3 callers
Function
binary_search
:param values: :param target: :return:
algorithm/binary_search.py:8
↓ 3 callers
Function
calculate_hash
(block)
algorithm/distributed_system/pos.py:46
↓ 3 callers
Method
enqueue
(self, value)
mqueue/base.py:16
↓ 3 callers
Method
push
(self, value)
stack/base.py:16
↓ 3 callers
Function
transpose_qkv
为了多注意力头的并行计算而变换形状
nlp/transformer.py:40
↓ 2 callers
Function
Logger
(content)
moe/train_pretrain.py:21
↓ 2 callers
Method
__iter__
(self)
tree/binary_search_tree.py:42
↓ 2 callers
Method
_generate_loss_mask
(self, input_ids)
moe/lm_dataset.py:259
↓ 2 callers
Method
add
添加node 头部插入的方式 :param item: :return:
linklist/base.py:53
↓ 2 callers
Function
data_iter
(batch_size, features, labels)
nlp/lrg.py:23
↓ 2 callers
Method
enqueue
(self, value)
graph/base.py:17
↓ 2 callers
Method
find_lowest_cost_node
(self)
graph/undirected_graph.py:20
↓ 2 callers
Function
func1
()
examples/randomfun.py:11
↓ 2 callers
Method
item
(self)
linklist/base.py:18
↓ 2 callers
Function
list_reverse
This function is order to reverse a list with python. :param a: a list object :return: : doc 这是一个字符串或者列表反转的python实现。
common/reverse_list.py:9
↓ 2 callers
Function
net
(X)
nlp/mlp.py:31
↓ 2 callers
Method
per_down
(self, i)
heap/min_binary_heap.py:32
↓ 2 callers
Method
per_down
(self, i)
heap/binary_heap.py:32
↓ 2 callers
Method
push
(self, value)
graph/base.py:42
↓ 2 callers
Method
put
(self, key, v)
hashtable/ht.py:25
↓ 2 callers
Function
repeat_kv
torch.repeat_interleave(x, dim=2, repeats=n_rep).
moe/model_config.py:148
↓ 2 callers
Function
rotate_half
(x)
moe/model_config.py:138
↓ 2 callers
Method
search
(self, target)
tree/binary_search_tree.py:78
↓ 2 callers
Method
size
(self)
mqueue/base.py:25
↓ 1 callers
Method
_create_chat_prompt
(self, conversations)
moe/lm_dataset.py:123
↓ 1 callers
Method
_create_chat_prompt
(self, conversations)
moe/lm_dataset.py:326
↓ 1 callers
Method
_generate_loss_mask
(self, input_ids)
moe/lm_dataset.py:134
↓ 1 callers
Method
_insert
(self, root, val)
tree/binary_search_tree.py:65
↓ 1 callers
Method
_norm
(self, x)
moe/model_config.py:96
↓ 1 callers
Method
_preprogress
(self, all_premise_hypothesis_tokens)
llmodels/bert/finetune.py:53
↓ 1 callers
Method
_search
(self, node, val)
tree/binary_search_tree.py:81
↓ 1 callers
Method
_truncate_pair_of_tokens
(self, p_tokens, h_tokens)
llmodels/bert/finetune.py:75
↓ 1 callers
Function
apply_rotary_pos_emb
( q, k, cos, sin, position_ids=None, unsqueeze_dim: int = 1 )
moe/model_config.py:135
↓ 1 callers
Method
bfs
从一个顶点出发对图进行广度优先遍历 :param n: :return:
graph/base.py:88
↓ 1 callers
Function
bubble_sort
冒泡排序 :param values: :return:
algorithm/bubble_sort.py:8
↓ 1 callers
Method
build_heap
(self, values)
heap/min_binary_heap.py:58
↓ 1 callers
Method
build_heap
(self, values)
heap/binary_heap.py:58
↓ 1 callers
Function
build_link_list
()
linklist/base.py:137
↓ 1 callers
Function
chat_command
(model_name_or_path: str)
llmodels/chat.py:12
↓ 1 callers
Method
dag
(self)
graph/undirected_graph.py:33
↓ 1 callers
Method
del_min
(self)
heap/min_binary_heap.py:50
↓ 1 callers
Method
del_min
(self)
heap/binary_heap.py:50
↓ 1 callers
Method
dequeue
(self)
graph/base.py:20
↓ 1 callers
Method
dequeue
(self)
mqueue/base.py:19
↓ 1 callers
Method
dfs
(self, start)
examples/num_set.py:30
↓ 1 callers
Method
empty
(self)
mqueue/base.py:29
↓ 1 callers
Function
fab
use fab to explain recursion function :doc 斐波拉切数列的递归实现。递归函数是调用自身的函数。 :param n: :return:
common/recursion.py:8
↓ 1 callers
Function
find_dump
(values)
examples/find_dup_in_list.py:5
↓ 1 callers
Function
func2
()
examples/randomfun.py:17
↓ 1 callers
Function
generate_block
:param oldblock: :param bpm: :param address: :return:
algorithm/distributed_system/pos.py:27
↓ 1 callers
Function
generate_prompt
(data_point)
llmodels/alpaca/finetune.py:73
↓ 1 callers
Method
get_all_com
(self)
examples/num_set.py:46
↓ 1 callers
Function
get_all_combination
(sums, result, count)
examples/num_com.py:5
↓ 1 callers
Function
get_lr
(current_step, total_steps, lr)
moe/train_pretrain.py:26
↓ 1 callers
Function
init_destributed_mode
()
moe/train_pretrain.py:104
↓ 1 callers
Function
init_model
(llm_config)
moe/train_pretrain.py:96
↓ 1 callers
Method
insert
(self, val)
tree/binary_search_tree.py:62
↓ 1 callers
Function
is_block_valid
:param newblock: :param oldblock: :return:
algorithm/distributed_system/pos.py:57
↓ 1 callers
Method
kruskal
(self, g)
graph/directed_graph.py:38
↓ 1 callers
Method
load_data
(self, data_path)
moe/lm_dataset.py:16
↓ 1 callers
Method
load_data
(self, path)
moe/lm_dataset.py:92
↓ 1 callers
Method
load_data
(self, path)
moe/lm_dataset.py:295
↓ 1 callers
Function
load_pretrained_model
(pretrained_model, num_hiddens, ffn_num_hiddens, num_heads, num_layers, dropout, max
llmodels/bert/finetune.py:18
↓ 1 callers
Function
main
()
graph/undirected_graph.py:48
↓ 1 callers
Function
main
()
tree/binary_search_tree.py:98
↓ 1 callers
Method
make_set
(self, vertex)
graph/directed_graph.py:17
↓ 1 callers
Function
max_min
(v)
examples/max_min.py:4
↓ 1 callers
Function
merge
合并两个已经排好序的列表 :param left: :param right: :return:
algorithm/merge_sort.py:23
↓ 1 callers
Function
merge_sort
(values)
algorithm/merge_sort.py:11
↓ 1 callers
Method
min
(self, i)
heap/min_binary_heap.py:41
↓ 1 callers
Method
min
(self, i)
heap/binary_heap.py:41
↓ 1 callers
Method
moe_infer
(self, x, flat_expert_indices, flat_expert_weights)
moe/model_config.py:358
↓ 1 callers
Function
mprint
(n)
algorithm/dp/fab.py:19
↓ 1 callers
Function
partition
(lst, lo, hi)
algorithm/quick_sort.py:63
↓ 1 callers
Method
perc_up
(self, i)
heap/min_binary_heap.py:17
↓ 1 callers
Method
perc_up
(self, i)
heap/binary_heap.py:17
↓ 1 callers
Function
permulation_trans
(s)
examples/str_one.py:19
↓ 1 callers
Function
permurarion
(s, start)
examples/str_one.py:4
↓ 1 callers
Method
pop
(self)
graph/base.py:45
↓ 1 callers
Function
precomputer_freqs_cis
Precompute the cos and sin of the frequencies for RoPE.
moe/model_config.py:104
↓ 1 callers
Function
q_s
(v)
examples/q_s.py:4
↓ 1 callers
Function
quick_sort_v3
(values, lo, hi)
algorithm/quick_sort.py:55
↓ 1 callers
Function
relu
(X)
nlp/mlp.py:26
↓ 1 callers
Method
reset_parameters
(self)
moe/model_config.py:272
↓ 1 callers
Function
rev_l
(v)
examples/xuanz_min.py:5
↓ 1 callers
Function
run
()
algorithm/distributed_system/pos.py:209
↓ 1 callers
Function
sentiment_score_to_name
(score: float)
llmodels/alpaca/finetune.py:38
↓ 1 callers
Function
sgd
(params, lr, batch_size)
nlp/lrg.py:51
↓ 1 callers
Function
show_all
(n)
examples/num_com.py:25
↓ 1 callers
Function
synthetic_data
(w,b, num_examples)
nlp/lrg.py:6
↓ 1 callers
Function
test
()
linklist/base.py:150
next →
1–100 of 223, ranked by callers