Skip to content

How does vectorized_value_and_grad work? #179

Answered by jcmgray
vincentmr asked this question in Q&A
Discussion options

You must be logged in to vote

I haven't looked over your examples in detail, but my first thought would be that the vectorizer that quimb uses internally has no fixed relation to jparams.ravel(), other than the number of parameters, since it treats the tags and tensor network structure as the 'base' data-structure.

The process it follows is something like:

  1. parse the TN, finding the tagged (/untagged) tensors, extracting either the raw data or parameters into a list, the order is determined from the graph and tag structure
  2. then flatten and stack all of these into a vector, which is the vectorized parameter and gradient space

Generally the point of the TNOptimizer is to optimize the parameters inplace, so user access …

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
1 reply
@jcmgray
Comment options

Answer selected by vincentmr
Comment options

You must be logged in to vote
5 replies
@jcmgray
Comment options

@vincentmr
Comment options

@jcmgray
Comment options

@vincentmr
Comment options

@jcmgray
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants