三维数组的归一化

编程入门 行业动态 更新时间:2024-10-21 18:38:18

三维<a href=https://www.elefans.com/category/jswz/34/1771288.html style=数组的归一化"/>

三维数组的归一化

二维数组的归一化

最初使用sklearn 的normalize 进行过归一化

from sklearn.preprocessing import normalize
fea_0 = normalize(fea_0, axis=0, norm='l1');
fea_1 = normalize(fea_1, axis=0, norm='l1')

但是其函数的具体解释里面

 Parameters----------X : {array-like, sparse matrix} of shape (n_samples, n_features)The data to normalize, element by element.scipy.sparse matrices should be in CSR format to avoid anun-necessary copy.

shape (n_samples, n_features)只能进行二维数组的归一化
如果进行三维数组的归一化,一个是reshape成二维数组再reshape成三维数组
要么用for循环,讲三维数组切成很多个二维数组进行归一化再拼到一起

三维数组的归一化

import torch.nn.functional as f
f.normalize(input, p=2, dim=2)

更多推荐

三维数组的归一化

本文发布于:2024-02-12 22:28:28,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1689655.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:数组   归一化

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!