Giter Site home page Giter Site logo

invert_embeddings's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

invert_embeddings's Issues

experiment help (same as the email sent to you)

Hi, Konstantinos~
I'm an undergraduate at Nanjing University, and am preparing my school project based on your paper DeepWalking Backwards and code.
Please forgive me for reaching out, but I'm facing some trouble when trying to reproduce your experiment.
In your experiments, various graph structures(email, YouTube, BlogCatalog, etc..) are used for comparison to test the learning algorithm, but I don't know where to find the .mat files for these graphs.
So I would thank you very much if you could kindly provide some relevant .mat files(no need to be exactly the same as in the paper) for experiment usage.

A problem about code

Hi, Konstantinos
I'm an undergraduate at Beijing Jiaotong University and interest in your paper. The idea introduced in the paper inspires me a lot.
But I'm facing a problem when I run the code that you provided.
I try to run the Demo.ipynb but got an error, so could you give me some help?
The information about this error is following:

RuntimeError Traceback (most recent call last)
Cell In[8], line 4
1 # Instantiate class
2 # Parameters: Adjacency Matrix, Low-Dimensional Embedding, Filename, (Deprecated Argument), Rank
3 P = Optimizer( N.getAdjacency(), N.get_LR_embedding(), network_name, 1, str(rank) )
----> 4 P.learnNetwork()

File D:\document\code\embedding\invert_embeddings.py:299, in Optimizer.learnNetwork(self, max_iter, method)
297 self.iter_num = 0
298 self.elts *= 0
--> 299 res = scipy.optimize.minimize(pmi_loss_10_elt_param, x0=self.elts,
300 args=(self.n,'autoshift',self.vol, False), jac=True, method='L-BFGS-B',
301 callback=callback_elt_param,
302 tol=np.finfo(float).eps,
303 options={'maxiter':max_iter, 'ftol':np.finfo(float).eps, 'gtol':np.finfo(float).eps}
304 )

File ~.conda\envs\embedding\lib\site-packages\scipy\optimize_minimize.py:696, in minimize(fun, x0, args, method, jac, hess, hessp, bounds, constraints, tol, callback, options)
693 res = _minimize_newtoncg(fun, x0, args, jac, hess, hessp, callback,
694 **options)
695 elif meth == 'l-bfgs-b':
--> 696 res = _minimize_lbfgsb(fun, x0, args, jac, bounds,
697 callback=callback, **options)
698 elif meth == 'tnc':
699 res = _minimize_tnc(fun, x0, args, jac, bounds, callback=callback,
700 **options)

File ~.conda\envs\embedding\lib\site-packages\scipy\optimize_lbfgsb_py.py:305, in _minimize_lbfgsb(fun, x0, args, jac, bounds, disp, maxcor, ftol, gtol, eps, maxfun, maxiter, iprint, callback, maxls, finite_diff_rel_step, **unknown_options)
302 else:
303 iprint = disp
--> 305 sf = _prepare_scalar_function(fun, x0, jac=jac, args=args, epsilon=eps,
306 bounds=new_bounds,
307 finite_diff_rel_step=finite_diff_rel_step)
309 func_and_grad = sf.fun_and_grad
311 fortran_int = _lbfgsb.types.intvar.dtype

File ~.conda\envs\embedding\lib\site-packages\scipy\optimize_optimize.py:332, in _prepare_scalar_function(fun, x0, jac, args, bounds, epsilon, finite_diff_rel_step, hess)
328 bounds = (-np.inf, np.inf)
330 # ScalarFunction caches. Reuse of fun(x) during grad
331 # calculation reduces overall function evaluations.
--> 332 sf = ScalarFunction(fun, x0, args, grad, hess,
333 finite_diff_rel_step, bounds, epsilon=epsilon)
335 return sf

File ~.conda\envs\embedding\lib\site-packages\scipy\optimize_differentiable_functions.py:158, in ScalarFunction.init(self, fun, x0, args, grad, hess, finite_diff_rel_step, finite_diff_bounds, epsilon)
155 self.f = fun_wrapped(self.x)
157 self._update_fun_impl = update_fun
--> 158 self._update_fun()
160 # Gradient evaluation
161 if callable(grad):

File ~.conda\envs\embedding\lib\site-packages\scipy\optimize_differentiable_functions.py:251, in ScalarFunction._update_fun(self)
249 def _update_fun(self):
250 if not self.f_updated:
--> 251 self._update_fun_impl()
252 self.f_updated = True

File ~.conda\envs\embedding\lib\site-packages\scipy\optimize_differentiable_functions.py:155, in ScalarFunction.init..update_fun()
154 def update_fun():
--> 155 self.f = fun_wrapped(self.x)

File ~.conda\envs\embedding\lib\site-packages\scipy\optimize_differentiable_functions.py:141, in ScalarFunction.init..fun_wrapped(x)
139 if not np.isscalar(fx):
140 try:
--> 141 fx = np.asarray(fx).item()
142 except (TypeError, ValueError) as e:
143 raise ValueError(
144 "The user-provided objective function "
145 "must return a scalar value."
146 ) from e

File ~.conda\envs\embedding\lib\site-packages\torch_tensor.py:757, in Tensor.array(self, dtype)
755 return handle_torch_function(Tensor.array, (self,), self, dtype=dtype)
756 if dtype is None:
--> 757 return self.numpy()
758 else:
759 return self.numpy().astype(dtype, copy=False)

RuntimeError: Can't call numpy() on Tensor that requires grad. Use tensor.detach().numpy() instead.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.