fixes
This commit is contained in:
parent
0dc40c5635
commit
85c800d39e
4
py/gp.py
4
py/gp.py
@ -1,4 +1,6 @@
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
|
from node2vec import Node2Vec
|
||||||
from sklearn.gaussian_process.kernels import Kernel, Hyperparameter
|
from sklearn.gaussian_process.kernels import Kernel, Hyperparameter
|
||||||
from sklearn.gaussian_process.kernels import GenericKernelMixin
|
from sklearn.gaussian_process.kernels import GenericKernelMixin
|
||||||
from sklearn.gaussian_process import GaussianProcessRegressor
|
from sklearn.gaussian_process import GaussianProcessRegressor
|
||||||
@ -12,7 +14,7 @@ class BookKernel(GenericKernelMixin, Kernel):
|
|||||||
|
|
||||||
self.G = G
|
self.G = G
|
||||||
self.node2vec = Node2Vec(self.G, dimensions=32, walk_length=16, num_walks=256, workers=8)
|
self.node2vec = Node2Vec(self.G, dimensions=32, walk_length=16, num_walks=256, workers=8)
|
||||||
self.model = node2vec.fit(window=10, min_count=1, batch_words=4)
|
self.model = self.node2vec.fit(window=10, min_count=1, batch_words=4)
|
||||||
self.wv = self.model.wv
|
self.wv = self.model.wv
|
||||||
|
|
||||||
def _f(self, s1, s2):
|
def _f(self, s1, s2):
|
||||||
|
Loading…
Reference in New Issue
Block a user