MCPcopy Create free account

hub / github.com/QiangAIResearcher/sahp_repo / functions

Functions54 in github.com/QiangAIResearcher/sahp_repo

↓ 5 callersMethodforward
(self, seq_dt, seq_types, src_mask)
models/sahp.py:70
↓ 5 callersMethodstate_decay
(self, converge_point, start_point, omega, duration_t)
models/sahp.py:65
↓ 4 callersFunctionprocess_loaded_sequences
Preprocess synthetic Hawkes data by padding the sequences. Args: loaded_hawkes_data: process_dim: tmax: Returns:
utils/load_synth_data.py:22
↓ 2 callersMethodcompute_loss
Compute the negative log-likelihood as a loss function. Args: seq_times: event occurrence timestamps seq_one
models/sahp.py:85
↓ 2 callersFunctioneval_sahp
(batch_size, loop_range, seq_lengths, seq_times, seq_types, model, device, lambda_l1=0)
train_functions/train_sahp.py:59
↓ 2 callersMethodrate
Implement `lrate` above
utils/atten_optimizer.py:24
↓ 2 callersMethodread_predict
Read an event sequence and predict the next event time and type. Args: seq_times: # start from 0 seq_types:
models/sahp.py:140
↓ 2 callersFunctiontrain_eval_sahp
(params)
train_functions/train_sahp.py:78
↓ 1 callersMethod__init__
(self, nLayers, d_model, atten_heads, dropout, process_dim, device, max_sequence_length)
models/sahp.py:26
↓ 1 callersMethod__init__
(self, d_model, max_len=4096)
models/embedding/position.py:8
↓ 1 callersMethod_plot_tick_intensity
(self, timestamps_i, sample_times, intensity_i, intens_at_evs, ax, label, n_point
models/sahp.py:301
↓ 1 callersFunctionconvert_task_sub
(task, sub)
utils/convert_realdata_syntheform.py:4
↓ 1 callersMethodgenerate_sequence
(self, tmax: float, record_intensity: bool)
models/base.py:31
↓ 1 callersFunctiongenerate_sim_interval_seqs
Generate a simulated time interval sequences from original time interval sequences based on uniform distribution Args: interval_
utils/util.py:33
↓ 1 callersMethodintensity_per_type
(self, seq_types, dt_seq, sample_times, timestamps, type)
models/sahp.py:236
↓ 1 callersFunctionmake_model
helper: construct a models form hyper parameters
train_functions/train_sahp.py:14
↓ 1 callersMethodmake_std_mask
create a mask to hide padding and future input
train_functions/train_sahp.py:44
↓ 1 callersFunctionone_hot_embedding
Embedding labels to one-hot form. Produces an easy-to-use mask to select components of the intensity. Args: labels: class labels, sized [N
utils/load_synth_data.py:56
↓ 1 callersFunctionpredict_from_hidden
(model, h_t_vals, dt_vals, next_dt, next_type, plot, hmax: float = 40., n_samples=1000
models/base.py:88
↓ 1 callersFunctionprediction_evaluation
(device, model, test_seq_lengths, test_seq_times, test_seq_types, test_size, tmax)
train_functions/train_sahp.py:196
↓ 1 callersFunctionsave_model
(model: torch.nn.Module, chosen_data_file, extra_tag, hidden_size, now_timestamp, model_name=None)
utils/save_model.py:8
↓ 1 callersMethodstep
Update parameters and rate
utils/atten_optimizer.py:15
↓ 1 callersFunctionsubsequent_mask
mask out subsequent positions
train_functions/train_sahp.py:28
Method__init__
(self, model_size, factor, warmup, initial_lr, optimizer)
utils/atten_optimizer.py:6
Method__init__
(self,src,pad, device)
train_functions/train_sahp.py:39
Method__init__
(self, model: nn.Module, record_intensity: bool = False)
models/base.py:8
Method__init__
(self,model, record_intensity = True)
models/sahp.py:313
Method__init__
(self, h, d_model, dropout=0.1)
models/attention/multi_head.py:10
Method__init__
(self, size, dropout)
models/utils/sublayer.py:11
Method__init__
(self, size, eps=1e-6)
models/utils/layer_norm.py:8
Method__init__
(self, d_model, d_ff, dropout=0.1)
models/utils/feed_forward.py:8
Method__init__
:param vocab_size: total vocab size :param embed_size: embedding size of token embedding :param dropout: dropout rate
models/embedding/event_embedding.py:15
Method__init__
(self, type_size, embed_size, padding_idx)
models/embedding/event_type.py:5
Method__init__
(self, d_model, max_len=4096)
models/embedding/position.py:36
Method_restart_sequence
(self)
models/base.py:21
Method_restart_sequence
(self)
models/sahp.py:317
Functioncount_parameters
(model)
utils/util.py:79
Methodforward
(self, query, key, value, mask=None)
models/attention/multi_head.py:24
Methodforward
(self, query, key, value, mask=None, dropout=None)
models/attention/single.py:12
Methodforward
(self, x)
models/utils/gelu.py:11
Methodforward
Apply residual connection to any sublayer with the same size.
models/utils/sublayer.py:16
Methodforward
(self, x)
models/utils/layer_norm.py:14
Methodforward
(self, x)
models/utils/feed_forward.py:15
Methodforward
(self, sequence)
models/embedding/event_embedding.py:28
Methodforward
(self, x)
models/embedding/position.py:24
Methodforward
(self, x, interval)
models/embedding/position.py:46
Functiongenerate_multiple_sequences
Args: generator: tmax: end time for the simulations n_gen_seq: number of samples to take
utils/evaluation.py:6
Functionget_batch
(batch_size, i_batch, model, seq_lengths, seq_times, seq_types, rnn = True)
utils/util.py:9
Functionl1_loss
(model)
train_functions/train_sahp.py:52
Functionpad_bos
(batch_data, type_size)
utils/util.py:67
Methodplot_estimated_intensity
(self,timestamps, n_points=10000, plot_nodes=None, t_min=None, t_max=None,
models/sahp.py:210
Methodplot_events_and_intensity
(self, model_name: str = None, debug=False)
models/base.py:35
Functionpredict_test
Run predictions on testing dataset Args: seq_lengths: seq_types: seq_times: model: hmax: use_jupy
utils/evaluation.py:35
Functionread_syn
(file_name)
utils/load_synth_data.py:6