在吵架的四郎很中意你
在吵架的四郎很中意你
全部文章
分类
归档
标签
去牛客网
登录
/
注册
在吵架的四郎很中意你的博客
全部文章
(共11篇)
题解 | Leaky ReLU 激活函数
import numpy as np from typing import Union def leaky_relu(z, alpha=0.01): if z < 0: return z * alpha else: return z if...
2025-04-02
0
40
题解 | 实现ReLU激活函数
def relu(z: float) -> float: if z < 0: return float(0) else: return z if __name__ == "__main__": z = eva...
2025-04-02
0
43
题解 | Log Softmax函数的实现
import numpy as np def log_softmax(scores: list) -> np.ndarray: exp_scores = [] for s in scores: exp_scores.append(np.exp(s)) ...
2025-04-02
0
45
题解 | 单神经元
import math import numpy as np def single_neuron_model(features, labels, weights, bias): forward = np.dot(features, weights) + bias predicti...
2025-04-02
0
53
题解 | softmax激活函数实现
import numpy as np import math def softmax(scores: list[float]) -> list[float]: exp_scores = [] for s in scores: exp_scores.appen...
2025-04-02
0
54
题解 | Sigmoid 激活函数实现
import math def sigmoid(z: float) -> float: result = 1/(1+math.e**(-z)) return round(result, 4) if __name__ == "__main__": ...
2025-04-02
0
57
题解 | 标量的矩阵乘法
from typing import List, Union def scalar_multiply(matrix: List[List[Union[int, float]]], scalar: Union[int, float]) -> List[List[Union[int, floa...
2025-04-02
0
38
题解 | 按行或列计算平均值
from typing import List, Union import numpy as np def calculate_matrix_mean(matrix: List[List[Union[int, float]]], mode: str) -> List[float]: ...
2025-04-02
0
46
题解 | 重塑矩阵
from typing import List, Tuple, Union import numpy as np def reshape_matrix(a: List[List[Union[int, float]]], new_shape: Tuple[int, int]) -> List...
2025-04-02
1
33
题解 | 矩阵转置
from typing import List, Union # 使用 Union 来表示类型可以是 int 或 float def transpose_matrix(a: List[List[Union[int, float]]]) -> List[List[Union[int, flo...
2025-04-02
0
49
首页
上一页
1
2
下一页
末页