zoukankan      html  css  js  c++  java
  • 5-28日|5-30日

    1.科学计数法

    https://blog.csdn.net/qq_43868654/article/details/98246842 

    e/E表示10的幂:

    AeB,表示小数点在A上左移或者右移B次。

    2.pytorch clip

    import torch
    a=torch.tensor([1,2,3,4,5,6])
    print(torch.clamp(a,2,5))
    
    #输出:
    tensor([2, 2, 3, 4, 5, 5])

     实现削减值。 

    3.python partial 函数 

    https://blog.csdn.net/qq_33688922/article/details/91890142

    from functools import partial
    def mul(x,y):
        return x*y
    d=partial(mul,2,3)
    print(d)
    print(d())#也需要用括号来调用函数
    #输出:

    functools.partial(<function mul at 0x00000155E7B4FEA0>, 2, 3)
    6

    具体用就是这么用,可以使用partial固定参数,然后之后就可以随便调用,然后参数就是之前固定的。

    5-30——

    1.取数组的偶数列或奇数列

     https://blog.csdn.net/liyundiyi/article/details/80586501

    import torch
    pe=torch.randn(3,4)
    print(pe)
    print(pe[:,0::2])
    print(pe[:,1::2])
    
    #输出:
    tensor([[ 0.9722,  2.7667, -0.2812,  0.8444],
            [ 0.6217, -0.4831,  0.8454,  0.2377],
            [-0.1000,  0.2075,  1.0793,  0.6452]])
    tensor([[ 0.9722, -0.2812],
            [ 0.6217,  0.8454],
            [-0.1000,  1.0793]])
    tensor([[ 2.7667,  0.8444],
            [-0.4831,  0.2377],
            [ 0.2075,  0.6452]])

    意思是,开始位置:结束位置: 步长(间隔数)。

    6-1日

    1.多元高斯分布(multivariate Gaussian

     https://zhuanlan.zhihu.com/p/30343287,这个讲的不错。

    多元高斯分布能够自动捕获特征之间的相似度

    其中x是变量,μ是一个n*1的向量,Σ是一个n*n的协方差矩阵:

  • 相关阅读:
    Storm
    Linux 网络配置
    .NET Remoting
    jwt
    new操作符
    元数据
    C# lock
    三十而立
    面试
    灯火
  • 原文地址:https://www.cnblogs.com/BlueBlueSea/p/12987863.html
Copyright © 2011-2022 走看看