Skip to content

#Preferred Networks インターン選考2019 コーディング課題 機械学習・数理分野

Notifications You must be signed in to change notification settings

utopianf/pfnintern

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

#Preferred Networks インターン選考2019 コーディング課題 機械学習・数理分野

ソースコードはsrc/gnn.pyにおいて、主に以下のクラスに構成されている。

Class GNN(D=8, W=None, A=None, b=None, T=2)

GNNモデル。 クラス内ではX_Aが枝集合で、Xが頂点集合としている。

Class SGD Class Momentum Class Adam

それぞれoptimizerのクラス。『Deep Learning from Scratch』を大きく参考している。

実行手順

課題1

$ python tests/p1.py

[66 60 80]

  • D = 3
  • W = np.array([[2, 3, 1], [1, 3, 2], [0, 4, 5]])
  • A = np.ones(3)
  • b = 1.0
  • T = 3

課題2

$ python tests/p2.py

X_A = np.array([[0, 1, 0, 0, 0, 0, 1, 1, 0, 0], [1, 0, 1, 0, 0, 1, 0, 0, 0, 0], [0, 1, 0, 0, 1, 0, 1, 0, 1, 0], [0, 0, 0, 0, 0, 1, 1, 0, 0, 1], [0, 0, 1, 0, 0, 0, 0, 0, 0, 0], [0, 1, 0, 1, 0, 0, 1, 0, 0, 0], [1, 0, 1, 1, 0, 1, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 1, 0], [0, 0, 1, 0, 0, 0, 0, 1, 0, 1], [0, 0, 0, 1, 0, 0, 1, 0, 1, 0]]) という辺集合を持つグラフが0に分類されるときのLossが出力される。 場合によってはLossが減らないことがあるため、Ctrl+Cで強制停止する

課題3,4

$ python tests/p34.py

時間がかかる。SGD, Momentum SGD, Adamでそれぞれ最適化を行っている。 datasets/testに対する予測はprediction.txtに出力される。

About

#Preferred Networks インターン選考2019 コーディング課題 機械学習・数理分野

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages