Distance GNN
import numpy as np
import pandas as pd
img1 = np.random.randn(28*28).reshape(28,28)
img2 = np.random.randn(28*28).reshape(28,28)
img3 = np.random.randn(28*28).reshape(28,28)
img4 = np.random.randn(28*28).reshape(28,28)
img5 = np.random.randn(28*28).reshape(28,28)
_a = [1]*5+[2]*5+[3]*5+[4]*5+[5]*5
_b = [1,2,3,4,5]*5
-
2번째 데이터
df=pd.DataFrame({'t':_a ,'s':_b})
df
-
3번째 데이터
df=df.assign(third = [0]*25)
df
df.third[0] = np.exp(((img1-img1)**2).sum())
theta= 5000
df.third[1] = np.exp(-((img1-img2)**2/theta).sum())
df