average_fusion
Bases: weighted_summation_fusion
A fusion mechanism that combines inputs using simple averaging.
It inherits from the weighted summation fusion class, and the \(k\) inputs are treated with equal importance with weight value \(1/k\).
Attributes:
Name | Type | Description |
---|---|---|
weights |
Tensor
|
Predefined weights, initialized to 1/N for all inputs, where N is the number of inputs. |
Methods:
Name | Description |
---|---|
__init__ |
Initializes the average fusion function. |
Source code in tinybig/fusion/basic_fusion.py
__init__(dims, name='average_fusion', require_parameters=False, *args, **kwargs)
Initializes the average fusion function.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dims
|
list[int] | tuple[int]
|
Dimensions of the input tensors. |
required |
name
|
str
|
Name of the fusion function. Defaults to "average_fusion". |
'average_fusion'
|
require_parameters
|
bool
|
Whether parameters are required. Defaults to False. |
False
|
*args
|
tuple
|
Additional positional arguments for the parent class. |
()
|
**kwargs
|
dict
|
Additional keyword arguments for the parent class. |
{}
|