v0.4.0

Using Inseq 🐛

  • Getting started with Inseq
    • Installing Inseq
    • The AttributionModel class
    • The attribute method
    • The FeatureAttributionOutput class
  • Comparing Attributions with PairAggregator
  • Using Custom Attribution Targets for Contrastive Feature Attribution
  • Attributing Multilingual MT Models
  • Locating Factual Knowledge in GPT-2
  • FAQ

Main Classes

  • Main Functions
    • get_version()
    • list_feature_attribution_methods()
    • list_step_functions()
    • load_model()
    • register_step_function()
    • show_attributions()
  • Models
    • AttributionModel
      • AttributionModel.model
      • AttributionModel.model_name
      • AttributionModel.is_encoder_decoder
      • AttributionModel.pad_token
      • AttributionModel.embed_scale
      • AttributionModel.device
      • AttributionModel.attribution_method
      • AttributionModel.is_hooked
      • AttributionModel.default_attributed_fn_id
      • AttributionModel.attribute()
      • AttributionModel.configure_interpretable_embeddings()
      • AttributionModel.forward()
      • AttributionModel.remove_interpretable_embeddings()
      • AttributionModel.setup()
    • Framework Classes
      • HuggingfaceModel
        • HuggingfaceModel._autoclass
        • HuggingfaceModel.model
        • HuggingfaceModel.tokenizer
        • HuggingfaceModel.device
        • HuggingfaceModel.encoder_int_embeds
        • HuggingfaceModel.decoder_int_embeds
        • HuggingfaceModel.embed_scale
        • HuggingfaceModel.tokenizer_name
        • HuggingfaceModel.configure_embeddings_scale()
        • HuggingfaceModel.encode()
        • HuggingfaceModel.generate()
        • HuggingfaceModel.load()
      • HuggingfaceEncoderDecoderModel
        • HuggingfaceEncoderDecoderModel.configure_embeddings_scale()
      • HuggingfaceDecoderOnlyModel
        • HuggingfaceDecoderOnlyModel.configure_embeddings_scale()
    • Architectural Classes
      • EncoderDecoderAttributionModel
        • EncoderDecoderAttributionModel.enrich_step_output()
        • EncoderDecoderAttributionModel.forward()
        • EncoderDecoderAttributionModel.prepare_inputs_for_attribution()
      • DecoderOnlyAttributionModel
        • DecoderOnlyAttributionModel.enrich_step_output()
        • DecoderOnlyAttributionModel.forward()
  • Data Classes
    • TensorWrapper
      • TensorWrapper.__getitem__()
    • Batching
      • BatchEncoding
        • BatchEncoding.input_ids
        • BatchEncoding.input_tokens
        • BatchEncoding.attention_mask
        • BatchEncoding.baseline_ids
      • BatchEmbedding
        • BatchEmbedding.input_embeds
        • BatchEmbedding.baseline_embeds
      • Batch
        • Batch.encoding
        • Batch.embedding
      • EncoderDecoderBatch
        • EncoderDecoderBatch.sources
        • EncoderDecoderBatch.targets
      • DecoderOnlyBatch
    • Attributions
      • FeatureAttributionSequenceOutput
        • FeatureAttributionSequenceOutput.source
        • FeatureAttributionSequenceOutput.target
        • FeatureAttributionSequenceOutput.source_attributions
        • FeatureAttributionSequenceOutput.target_attributions
        • FeatureAttributionSequenceOutput.step_scores
        • FeatureAttributionSequenceOutput.sequence_scores
        • FeatureAttributionSequenceOutput.from_step_attributions()
        • FeatureAttributionSequenceOutput.show()
        • FeatureAttributionSequenceOutput.weight_attributions()
      • FeatureAttributionStepOutput
        • FeatureAttributionStepOutput.remap_from_filtered()
      • FeatureAttributionOutput
        • FeatureAttributionOutput.sequence_attributions
        • FeatureAttributionOutput.step_attributions
        • FeatureAttributionOutput.info
        • FeatureAttributionOutput.aggregate()
        • FeatureAttributionOutput.get_scores_dicts()
        • FeatureAttributionOutput.load()
        • FeatureAttributionOutput.merge_attributions()
        • FeatureAttributionOutput.save()
        • FeatureAttributionOutput.show()
      • GradientFeatureAttributionSequenceOutput
      • GradientFeatureAttributionStepOutput
    • Aggregators
      • DispatchableDict
      • Aggregator
        • Aggregator.end_aggregation_hook()
        • Aggregator.post_aggregate_hook()
        • Aggregator.pre_aggregate_hook()
        • Aggregator.start_aggregation_hook()
      • AggregatorPipeline
      • AggregableMixin
        • AggregableMixin.aggregate()
      • SequenceAttributionAggregator
        • SequenceAttributionAggregator.end_aggregation_hook()
        • SequenceAttributionAggregator.post_aggregate_hook()
      • ContiguousSpanAggregator
        • ContiguousSpanAggregator.aggregate()
        • ContiguousSpanAggregator.end_aggregation_hook()
        • ContiguousSpanAggregator.start_aggregation_hook()
      • SubwordAggregator
        • SubwordAggregator.aggregate()
      • PairAggregator
        • PairAggregator.pre_aggregate_hook()
  • Feature Attribution
    • FeatureAttribution
      • FeatureAttribution.attr
      • FeatureAttribution.ignore_extra_args
      • FeatureAttribution.attribute()
      • FeatureAttribution.attribute_step()
      • FeatureAttribution.filtered_attribute_step()
      • FeatureAttribution.format_attribute_args()
      • FeatureAttribution.hook()
      • FeatureAttribution.load()
      • FeatureAttribution.prepare_and_attribute()
      • FeatureAttribution.unhook()
    • Gradient Attribution Methods
      • GradientAttributionRegistry
        • GradientAttributionRegistry.attribute_step()
        • GradientAttributionRegistry.hook()
        • GradientAttributionRegistry.unhook()
      • DeepLiftAttribution
      • DiscretizedIntegratedGradientsAttribution
        • DiscretizedIntegratedGradientsAttribution.hook()
      • GradientShapAttribution
      • IntegratedGradientsAttribution
      • InputXGradientAttribution
      • SaliencyAttribution
      • Layer Attribution Methods
        • LayerIntegratedGradientsAttribution
        • LayerGradientXActivationAttribution
        • LayerDeepLiftAttribution
    • Attention Attribution Methods
      • InternalsAttributionRegistry
        • InternalsAttributionRegistry.attribute_step()
        • InternalsAttributionRegistry.format_attribute_args()
        • InternalsAttributionRegistry.hook()
        • InternalsAttributionRegistry.unhook()
      • AttentionWeightsAttribution
  • Step Functions
    • logit_fn()
    • probability_fn()
    • entropy_fn()
    • crossentropy_fn()
    • perplexity_fn()
    • contrast_prob_diff_fn()
    • mc_dropout_prob_avg_fn()
inseq
  • Search


© Copyright 2021, The Inseq Team, Licensed under the Apache License, Version 2.0. Revision cb8080c4.

Built with Sphinx using a theme provided by Read the Docs.