Spaces:
No application file
No application file
| from typing import List | |
| import numpy as np | |
| def weighted_sum(weights: List[float], datas: List[np.array]) -> np.array: | |
| """ε―Ήη©ι΅ε葨ζη §ζιε葨ε ζζ±ε | |
| Args: | |
| weights (list): ζιε葨 | |
| datas (list): η©ι΅ε葨 | |
| Returns: | |
| np.array: ε ζζ±εεηη©ι΅ | |
| """ | |
| res = np.zeros(datas[0].shape) | |
| n_data = len(datas) | |
| for i in range(n_data): | |
| res += datas[i] * weights[i] / n_data | |
| return res | |