[Numpy,Matplotlib] 1. 배열다루기+시각화의 기초
In [2]: import tensorflow as tf In [3]: tf.__version__ Out[3]: '2.4.1' In [4]: import sys print(sys.version) 3.8.5 (default, Sep 3 2020, 21:29:08) [MSC v.1916 64 bit (AMD64)] In [5]: import torch In [6]: torch.rand(10) Out[6]: tensor([0.3455, 0.7188, 0.9561, 0.4839, 0.4847, 0.4576, 0.0298, 0.0426, 0.0475, 0.4781]) In [7]: import numpy as np In [8]: arr = np.array(5) arr.shape Out[8]: () ..
2021. 6. 18.
[Tensorflow] 1. Tensorflow의 기본 Tensor
In [1]: import numpy as np import tensorflow as tf In [2]: # Tensor 생성 [1,2,3] Out[2]: [1, 2, 3] In [3]: [[1,2,3],[4,5,6]] Out[3]: [[1, 2, 3], [4, 5, 6]] In [4]: arr= np.array([1,2,3]) arr.shape Out[4]: (3,) In [5]: arr=np.array([[1,2,3],[4,5,6]]) arr.shape Out[5]: (2, 3) In [6]: #list와 tensor는 다르다 #list1=[1,2,3] tf.constant([1,2,3]) #tf.constant(list1) Out[6]: In [9]: #Array를 tesnfor로 변경 array=..
2021. 6. 17.