日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > python >内容正文

python

使用numpy.tanh()打印矢量/矩阵元素的双曲正切值 使用Python的线性代数

發布時間:2023/12/1 python 25 豆豆
生活随笔 收集整理的這篇文章主要介紹了 使用numpy.tanh()打印矢量/矩阵元素的双曲正切值 使用Python的线性代数 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

Prerequisite:

先決條件:

  • Defining a Vector

    定義向量

  • Defining a Matrix

    定義矩陣

Numpy is the library of function that helps to construct or manipulate matrices and vectors. The function numpy.tanh(x) is a function used for generating a matrix / vector / variable with the Tangent Hyperbolic value of b x (as tanh(x)).

Numpy是一個功能庫,可幫助構造或操縱矩陣和向量。 函數numpy.tanh(x)是用于生成正切雙曲值為b x的矩陣/向量/變量(作為tanh(x) )的函數 。

Syntax:

句法:

numpy.tanh(x)

Input parameter(s):

輸入參數:

  • x – could be a matrix or vector or a variable.

    x –可以是矩陣,向量或變量。

Return value:

返回值:

A Matrix or vector or a variable of the same dimensions as input x with tanh(x) values (between 0 and 1) at each entry.

與輸入x尺寸相同的矩陣或向量或變量,每個條目處具有tanh(x)值(介于0和1之間)。

Applications:

應用范圍:

  • Machine Learning

    機器學習

  • Neural Network

    神經網絡

  • Python代碼將向量/矩陣元素的雙曲正切值 (Python code to hyperbolic tangent value of vector/matrix elements)

    # Linear Algebra Learning Sequence # Printing hyperbolic tangent value of # vector/matrix elements using numpy.tanh()import numpy as np#Use of np.array() to define an Vector V = np.array([323,.623,823]) print("The Vector A : ",V)VV = np.array([[3,63,.78],[.315,32,42]]) print("\nThe Vector B : \n",VV)pro = V.dot(VV.T)print("\nProduct of two vectors : ", pro)print("\ntanh(AB) : ", np.tanh(pro)) print("\ntanh(A) : ", np.tanh(V)) print("\ntanh(B) : \n", np.tanh(VV))

    Output:

    輸出:

    The Vector A : [3.23e+02 6.23e-01 8.23e+02]The Vector B : [[ 3. 63. 0.78 ][ 0.315 32. 42. ]]Product of two vectors : [ 1650.189 34687.681]tanh(AB) : [1. 1.]tanh(A) : [1. 0.55321335 1. ]tanh(B) : [[0.99505475 1. 0.65270671][0.30497892 1. 1. ]]

    翻譯自: https://www.includehelp.com/python/printing-hyperbolic-tangent-value-of-vector-matrix-elements-using-numpy-tanh.aspx

    總結

    以上是生活随笔為你收集整理的使用numpy.tanh()打印矢量/矩阵元素的双曲正切值 使用Python的线性代数的全部內容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。