spikingjelly.activation_based.ann2snn.examples package#
CNN for MNIST#
- spikingjelly.activation_based.ann2snn.examples.cnn_mnist.val(net, device, data_loader, T=None)[源代码]#
- spikingjelly.activation_based.ann2snn.examples.cnn_mnist.download_checkpoint(checkpoint_url, checkpoint_path)[源代码]#
- spikingjelly.activation_based.ann2snn.examples.cnn_mnist.convert_and_eval(recipe, device, ann_model, test_data_loader, time_steps)[源代码]#
- spikingjelly.activation_based.ann2snn.examples.cnn_mnist.run_recipe_comparison(device, calibration_data_loader, test_data_loader, time_steps, checkpoint_path)[源代码]#
ResNet18 for CIFAR-10#
ImageNet ResNet-18 with LocalThresholdBalancingRecipe#
- spikingjelly.activation_based.ann2snn.examples.imagenet_resnet18_ltb.build_loaders(args, transform)[源代码]#
- spikingjelly.activation_based.ann2snn.examples.imagenet_resnet18_ltb.accuracy(output, target, topk=(1, 5))[源代码]#
- spikingjelly.activation_based.ann2snn.examples.imagenet_resnet18_ltb.evaluate_ann(model, data_loader, device)[源代码]#
- spikingjelly.activation_based.ann2snn.examples.imagenet_resnet18_ltb.resolve_delay_start(model, data_loader, device, time_steps, delay_start)[源代码]#
- spikingjelly.activation_based.ann2snn.examples.imagenet_resnet18_ltb.evaluate_snn(model, data_loader, device, time_steps, delay_start=0)[源代码]#
ImageNet ViT-B/16 with STATransformerRecipe#
- spikingjelly.activation_based.ann2snn.examples.imagenet_vit_sta.build_loaders(args, transform)[源代码]#
- spikingjelly.activation_based.ann2snn.examples.imagenet_vit_sta.accuracy(output, target, topk=(1, 5))[源代码]#
- spikingjelly.activation_based.ann2snn.examples.imagenet_vit_sta.evaluate(model, data_loader, device, name)[源代码]#
- spikingjelly.activation_based.ann2snn.examples.imagenet_vit_sta.make_first_real_then_zero_sequence(x, time_steps)[源代码]#
BERT SST-2 with TransformerTDEquivalentRecipe#
- spikingjelly.activation_based.ann2snn.examples.bert_sst2_transformer_td_equivalent.import_huggingface()[源代码]#
- class spikingjelly.activation_based.ann2snn.examples.bert_sst2_transformer_td_equivalent.BertSST2FromEmbeddings(hf_model)[源代码]#
基类:
Module- 参数:
hf_model (Module)
- class spikingjelly.activation_based.ann2snn.examples.bert_sst2_transformer_td_equivalent.FXFriendlyBertSelfAttention(source, config)[源代码]#
基类:
Module- 参数:
source (Module)
- class spikingjelly.activation_based.ann2snn.examples.bert_sst2_transformer_td_equivalent.FXFriendlyBertAttention(source, config)[源代码]#
基类:
Module- 参数:
source (Module)
- class spikingjelly.activation_based.ann2snn.examples.bert_sst2_transformer_td_equivalent.FXFriendlyBertLayer(source, config)[源代码]#
基类:
Module- 参数:
source (Module)
- class spikingjelly.activation_based.ann2snn.examples.bert_sst2_transformer_td_equivalent.FXFriendlyBertEncoder(source, config)[源代码]#
基类:
Module- 参数:
source (Module)
- spikingjelly.activation_based.ann2snn.examples.bert_sst2_transformer_td_equivalent.parse_args()[源代码]#
- spikingjelly.activation_based.ann2snn.examples.bert_sst2_transformer_td_equivalent.collate_tokenized(batch, tokenizer, max_length)[源代码]#
- spikingjelly.activation_based.ann2snn.examples.bert_sst2_transformer_td_equivalent.build_loader(args, tokenizer)[源代码]#
- spikingjelly.activation_based.ann2snn.examples.bert_sst2_transformer_td_equivalent.make_embedding_batch(hf_model, batch, device)[源代码]#
- spikingjelly.activation_based.ann2snn.examples.bert_sst2_transformer_td_equivalent.make_first_real_then_zero_sequence(x, time_steps)[源代码]#
- spikingjelly.activation_based.ann2snn.examples.bert_sst2_transformer_td_equivalent.accuracy(logits, labels)[源代码]#
- spikingjelly.activation_based.ann2snn.examples.bert_sst2_transformer_td_equivalent.evaluate_ann(wrapper, hf_model, loader, device, name)[源代码]#
- spikingjelly.activation_based.ann2snn.examples.bert_sst2_transformer_td_equivalent.check_hf_wrapper_parity(wrapper, hf_model, loader, device, max_batches, atol)[源代码]#
- spikingjelly.activation_based.ann2snn.examples.bert_sst2_transformer_td_equivalent.evaluate_transformer_td_equivalent(converted, hf_model, loader, device, time_steps, name)[源代码]#
Synthetic RoBERTa QANN with SpikeZIPTFQANNRecipe#
- class spikingjelly.activation_based.ann2snn.examples.roberta_spikezip_qann_synthetic.SpikeZIPQuantizer(level=8, sym=True, scale=0.25)[源代码]#
基类:
Module
- class spikingjelly.activation_based.ann2snn.examples.roberta_spikezip_qann_synthetic.TinyQRobertaSelfAttention(hidden_size=16, num_heads=4, level=8)[源代码]#
基类:
Module
- class spikingjelly.activation_based.ann2snn.examples.roberta_spikezip_qann_synthetic.TinyQRobertaClassifier(vocab_size=32, hidden_size=16, num_heads=4, level=8)[源代码]#
基类:
Module
- spikingjelly.activation_based.ann2snn.examples.roberta_spikezip_qann_synthetic.write_output(path, payload)[源代码]#