profile
viewpoint
Alexander Zeilmann AlexanderZeilmann

issue openedgeoopt/geoopt

Differentiable Frechet Mean computation

Implement differentiable computation of the Frechet mean for various manifolds

created time in 2 days

issue openedfmarotta/kaobook

overlapping marincitations

Hello,

The following image illustrates my problem image

As you can see there is an overlap between two different side citations. Probably the solution is to change some parameters but I dont know where to look for

created time in 2 days

issue commentfmarotta/kaobook

Margintoc and long section titles

I managed to solve the problem by changing the parameters in kao.sty

yordiak

comment created time in 2 days

issue closedfmarotta/kaobook

Margintoc and long section titles

When I use a long title for sections there is no space between section number and its title in the margintoc. How can I solve this problem?

closed time in 2 days

yordiak

issue closedfmarotta/kaobook

Abstract in each section

I would like to create an abstract environment (something like secabstract) in each section, preferably in italics and to rounded in a ruler. Any idea how to implement this?

closed time in 2 days

yordiak

issue openedfmarotta/kaobook

Margintoc and long section titles

When I use a long title for sections there is no space between section number and its title in the margintoc. How can I solve this problem?

created time in 2 days

issue openedfmarotta/kaobook

Abstract in each section

I would like to create an abstract environment (something like secabstract) in each section, preferably in italics and to rounded in a ruler. Any idea how to implement this?

created time in 2 days

issue commentpymanopt/pymanopt

Choose manifold for ellipsoid surface

Hi,

I have done a first rough port of the stiefelgeneralizedfactory function from manopt as a GeneralizedStiefel manifold class. If anyone is interested in testing/proof-reading (or even implementing the unit-tests), my fork is available at chovine/pymanopt@9342721

Cheers

cwmmmm

comment created time in 3 days

pull request commentpymanopt/pymanopt

Tensorflow 2 back end

Hi folks, is there any chance someone would review this? The last major release of TF1 was over a year ago and there will be no more, so the lack of TF2 support is making it problematic to use pymanopt without getting into dependency trouble with other packages relying on a current tensorflow.

mshvartsman

comment created time in 4 days

issue commentpymanopt/pymanopt

A general query

This issue is somewhat old, but in case it is still of interest:

Autodiff on PyTorch (in Tensorflow is much trickier, unless one uses eager execution) is able to backpropagate through sequences of arbitrary length. Even when one has a stopping time that might depend on the input or a random number. The way it works is via what's called a "tape". When $f(x)$ is computed, the tape records the intermediate operations that were executed to get to the value of $f(x)$, then the gradients are simply computed by rolling back this dependency tree.

That being said, one has to be careful when letting the autodiff engine doing all the heavy-lifting. I particular, it is clear that $C^0$ convergence does not imply $C^1$ convergence. As such, if you have an algorithm to approximate the value of a function (say f(x) = \min g(x,z)), it does not mean that the derivative of the algorithm will approximate the derivative of the function. One may prove that that is the case in specific cases, but it is far from true in general. As such, sometimes it is necessary to compute analytically the (sub-)gradient of the function (or come up with an approximation algorithm) and implement it by hand.

bamdevm

comment created time in 6 days

delete branch pymanopt/pymanopt

delete branch : dependabot/pip/tensorflow-1.15.4

delete time in 10 days

PR closed pymanopt/pymanopt

build(deps): bump tensorflow from 1.15.2 to 1.15.4 dependencies

Bumps tensorflow from 1.15.2 to 1.15.4. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/tensorflow/tensorflow/releases">tensorflow's releases</a>.</em></p> <blockquote> <h2>TensorFlow 1.15.4</h2> <h1>Release 1.15.4</h1> <h2>Bug Fixes and Other Changes</h2> <ul> <li>Fixes an undefined behavior causing a segfault in <code>tf.raw_ops.Switch</code> (<a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15190">CVE-2020-15190</a>)</li> <li>Fixes three vulnerabilities in conversion to DLPack format (<a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15191">CVE-2020-15191</a>, <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15192">CVE-2020-15192</a>, <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15193">CVE-2020-15193</a>)</li> <li>Fixes two vulnerabilities in <code>SparseFillEmptyRowsGrad</code> (<a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15194">CVE-2020-15194</a>, <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15195">CVE-2020-15195</a>)</li> <li>Fixes an integer truncation vulnerability in code using the work sharder API (<a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15202">CVE-2020-15202</a>)</li> <li>Fixes a format string vulnerability in <code>tf.strings.as_string</code> (<a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15203">CVE-2020-15203</a>)</li> <li>Fixes segfault raised by calling session-only ops in eager mode (<a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15204">CVE-2020-15204</a>)</li> <li>Fixes data leak and potential ASLR violation from <code>tf.raw_ops.StringNGrams</code> (<a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15205">CVE-2020-15205</a>)</li> <li>Fixes segfaults caused by incomplete <code>SavedModel</code> validation (<a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15206">CVE-2020-15206</a>)</li> <li>Fixes a data corruption due to a bug in negative indexing support in TFLite (<a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15207">CVE-2020-15207</a>)</li> <li>Fixes a data corruption due to dimension mismatch in TFLite (<a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15208">CVE-2020-15208</a>)</li> <li>Fixes several vulnerabilities in TFLite saved model format (<a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15209">CVE-2020-15209</a>, <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15210">CVE-2020-15210</a>, <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15211">CVE-2020-15211</a>)</li> <li>Updates <code>sqlite3</code> to <code>3.33.00</code> to handle <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-9327">CVE-2020-9327</a>, <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-11655">CVE-2020-11655</a>, <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-11656">CVE-2020-11656</a>, <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-13434">CVE-2020-13434</a>, <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-13435">CVE-2020-13435</a>, <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-13630">CVE-2020-13630</a>, <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-13631">CVE-2020-13631</a>, <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-13871">CVE-2020-13871</a>, and <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15358">CVE-2020-15358</a>.</li> <li>Fixes <a href="https://github-redirect.dependabot.com/tensorflow/tensorflow/issues/41630">#41630</a> by including <code>max_seq_length</code> in CuDNN descriptor cache key</li> <li>Pins <code>numpy</code> to 1.18.5 to prevent ABI breakage when compiling code that uses both NumPy and TensorFlow headers.</li> </ul> <h2>TensorFlow 1.15.3</h2> <h2>Bug Fixes and Other Changes</h2> <ul> <li>Updates <code>sqlite3</code> to <code>3.31.01</code> to handle <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-19880">CVE-2019-19880</a>, <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-19244">CVE-2019-19244</a> and <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-19645">CVE-2019-19645</a></li> <li>Updates <code>curl</code> to <code>7.69.1</code> to handle <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-15601">CVE-2019-15601</a></li> <li>Updates <code>libjpeg-turbo</code> to <code>2.0.4</code> to handle <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-19664">CVE-2018-19664</a>, <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-20330">CVE-2018-20330</a> and <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-13960">CVE-2019-13960</a></li> <li>Updates Apache Spark to <code>2.4.5</code> to handle <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-10099">CVE-2019-10099</a>, <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-17190">CVE-2018-17190</a> and <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-11770">CVE-2018-11770</a></li> </ul> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/tensorflow/tensorflow/blob/master/RELEASE.md">tensorflow's changelog</a>.</em></p> <blockquote> <h1>Release 1.15.4</h1> <h2>Bug Fixes and Other Changes</h2> <ul> <li>Fixes an undefined behavior causing a segfault in <code>tf.raw_ops.Switch</code> (<a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15190">CVE-2020-15190</a>)</li> <li>Fixes three vulnerabilities in conversion to DLPack format (<a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15191">CVE-2020-15191</a>, <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15192">CVE-2020-15192</a>, <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15193">CVE-2020-15193</a>)</li> <li>Fixes two vulnerabilities in <code>SparseFillEmptyRowsGrad</code> (<a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15194">CVE-2020-15194</a>, <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15195">CVE-2020-15195</a>)</li> <li>Fixes an integer truncation vulnerability in code using the work sharder API (<a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15202">CVE-2020-15202</a>)</li> <li>Fixes a format string vulnerability in <code>tf.strings.as_string</code> (<a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15203">CVE-2020-15203</a>)</li> <li>Fixes segfault raised by calling session-only ops in eager mode (<a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15204">CVE-2020-15204</a>)</li> <li>Fixes data leak and potential ASLR violation from <code>tf.raw_ops.StringNGrams</code> (<a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15205">CVE-2020-15205</a>)</li> <li>Fixes segfaults caused by incomplete <code>SavedModel</code> validation (<a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15206">CVE-2020-15206</a>)</li> <li>Fixes a data corruption due to a bug in negative indexing support in TFLite (<a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15207">CVE-2020-15207</a>)</li> <li>Fixes a data corruption due to dimension mismatch in TFLite (<a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15208">CVE-2020-15208</a>)</li> <li>Fixes several vulnerabilities in TFLite saved model format (<a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15209">CVE-2020-15209</a>, <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15210">CVE-2020-15210</a>, <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15211">CVE-2020-15211</a>)</li> <li>Updates <code>sqlite3</code> to <code>3.33.00</code> to handle <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-9327">CVE-2020-9327</a>, <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-11655">CVE-2020-11655</a>, <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-11656">CVE-2020-11656</a>, <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-13434">CVE-2020-13434</a>, <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-13435">CVE-2020-13435</a>, <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-13630">CVE-2020-13630</a>, <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-13631">CVE-2020-13631</a>, <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-13871">CVE-2020-13871</a>, and <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15358">CVE-2020-15358</a>.</li> <li>Fixes <a href="https://github-redirect.dependabot.com/tensorflow/tensorflow/issues/41630">#41630</a> by including <code>max_seq_length</code> in CuDNN descriptor cache key</li> <li>Pins <code>numpy</code> to 1.18.5 to prevent ABI breakage when compiling code that uses both NumPy and TensorFlow headers.</li> </ul> <h1>Release 2.3.0</h1> <h2>Major Features and Improvements</h2> <ul> <li><code>tf.data</code> adds two new mechanisms to solve input pipeline bottlenecks and save resources:</li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/tensorflow/tensorflow/commit/df8c55ce12b5cfc6f29b01889f7773911a75e6ef"><code>df8c55c</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/tensorflow/tensorflow/issues/43442">#43442</a> from tensorflow-jenkins/version-numbers-1.15.4-31571</li> <li><a href="https://github.com/tensorflow/tensorflow/commit/0e8cbcb0b1756de4afda8677add8a55355720ab7"><code>0e8cbcb</code></a> Update version numbers to 1.15.4</li> <li><a href="https://github.com/tensorflow/tensorflow/commit/5b65bf202a00f558784e61b7dba5063195cce0f5"><code>5b65bf2</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/tensorflow/tensorflow/issues/43437">#43437</a> from tensorflow-jenkins/relnotes-1.15.4-10691</li> <li><a href="https://github.com/tensorflow/tensorflow/commit/814e8d83f5966af55168bc1141dc8ba68561556f"><code>814e8d8</code></a> Update RELEASE.md</li> <li><a href="https://github.com/tensorflow/tensorflow/commit/757085e3e62197ab5ad6a10c667aae08a8929556"><code>757085e</code></a> Insert release notes place-fill</li> <li><a href="https://github.com/tensorflow/tensorflow/commit/e99e53dda53644e49f4b8b4ec16ef92f6399fc3b"><code>e99e53d</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/tensorflow/tensorflow/issues/43410">#43410</a> from tensorflow/mm-fix-1.15</li> <li><a href="https://github.com/tensorflow/tensorflow/commit/bad36df000e97cfe0a271e08778a81db4ce8834a"><code>bad36df</code></a> Add missing import</li> <li><a href="https://github.com/tensorflow/tensorflow/commit/f3f1835aed4ab1874c0891c487cd6d0340fed67b"><code>f3f1835</code></a> No <code>disable_tfrt</code> present on this branch</li> <li><a href="https://github.com/tensorflow/tensorflow/commit/7ef5c62a21f2c03483c21566dd6c048218dced26"><code>7ef5c62</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/tensorflow/tensorflow/issues/43406">#43406</a> from tensorflow/mihaimaruseac-patch-1</li> <li><a href="https://github.com/tensorflow/tensorflow/commit/abbf34a5885400f81620df23d9da70f30630e699"><code>abbf34a</code></a> Remove import that is not needed</li> <li>Additional commits viewable in <a href="https://github.com/tensorflow/tensorflow/compare/v1.15.2...v1.15.4">compare view</a></li> </ul> </details> <br />

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


<details> <summary>Dependabot commands and options</summary> <br />

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
  • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
  • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
  • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

You can disable automated security fix PRs for this repo from the Security Alerts page.

</details>

+1 -1

2 comments

1 changed file

dependabot[bot]

pr closed time in 10 days

pull request commentpymanopt/pymanopt

build(deps): bump tensorflow from 1.15.2 to 1.15.4

Superseded by #127.

dependabot[bot]

comment created time in 10 days

PR opened pymanopt/pymanopt

build(deps): bump tensorflow from 1.15.2 to 2.3.1

Bumps tensorflow from 1.15.2 to 2.3.1. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/tensorflow/tensorflow/releases">tensorflow's releases</a>.</em></p> <blockquote> <h2>TensorFlow 2.3.1</h2> <h1>Release 2.3.1</h1> <h2>Bug Fixes and Other Changes</h2> <ul> <li>Fixes an undefined behavior causing a segfault in <code>tf.raw_ops.Switch</code> (<a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15190">CVE-2020-15190</a>)</li> <li>Fixes three vulnerabilities in conversion to DLPack format (<a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15191">CVE-2020-15191</a>, <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15192">CVE-2020-15192</a>, <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15193">CVE-2020-15193</a>)</li> <li>Fixes two vulnerabilities in <code>SparseFillEmptyRowsGrad</code> (<a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15194">CVE-2020-15194</a>, <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15195">CVE-2020-15195</a>)</li> <li>Fixes several vulnerabilities in <code>RaggedCountSparseOutput</code> and <code>SparseCountSparseOutput</code> operations (<a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15196">CVE-2020-15196</a>, <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15197">CVE-2020-15197</a>, <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15198">CVE-2020-15198</a>, <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15199">CVE-2020-15199</a>, <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15200">CVE-2020-15200</a>, <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15201">CVE-2020-15201</a>)</li> <li>Fixes an integer truncation vulnerability in code using the work sharder API (<a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15202">CVE-2020-15202</a>)</li> <li>Fixes a format string vulnerability in <code>tf.strings.as_string</code> (<a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15203">CVE-2020-15203</a>)</li> <li>Fixes segfault raised by calling session-only ops in eager mode (<a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15204">CVE-2020-15204</a>)</li> <li>Fixes data leak and potential ASLR violation from <code>tf.raw_ops.StringNGrams</code> (<a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15205">CVE-2020-15205</a>)</li> <li>Fixes segfaults caused by incomplete <code>SavedModel</code> validation (<a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15206">CVE-2020-15206</a>)</li> <li>Fixes a data corruption due to a bug in negative indexing support in TFLite (<a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15207">CVE-2020-15207</a>)</li> <li>Fixes a data corruption due to dimension mismatch in TFLite (<a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15208">CVE-2020-15208</a>)</li> <li>Fixes several vulnerabilities in TFLite saved model format (<a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15209">CVE-2020-15209</a>, <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15210">CVE-2020-15210</a>, <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15211">CVE-2020-15211</a>)</li> <li>Fixes several vulnerabilities in TFLite implementation of segment sum (<a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15212">CVE-2020-15212</a>, <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15213">CVE-2020-15213</a>, <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15214">CVE-2020-15214</a>)</li> <li>Updates <code>sqlite3</code> to <code>3.33.00</code> to handle <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15358">CVE-2020-15358</a>.</li> <li>Fixes deprecated usage of <code>collections</code> API</li> <li>Removes <code>scipy</code> dependency from <code>setup.py</code> since TensorFlow does not need it to install the pip package</li> </ul> <h2>TensorFlow 2.3.0</h2> <h1>Release 2.3.0</h1> <h2>Major Features and Improvements</h2> <ul> <li><code>tf.data</code> adds two new mechanisms to solve input pipeline bottlenecks and save resources: <ul> <li><a href="https://www.tensorflow.org/api_docs/python/tf/data/experimental/snapshot">snapshot</a></li> <li><a href="https://www.tensorflow.org/api_docs/python/tf/data/experimental/service">tf.data service</a>.</li> </ul> </li> </ul> <p>In addition checkout the detailed <a href="https://www.tensorflow.org/guide/data_performance_analysis">guide</a> for analyzing input pipeline performance with TF Profiler.</p> <ul> <li> <p><a href="https://www.tensorflow.org/api_docs/python/tf/distribute/TPUStrategy"><code>tf.distribute.TPUStrategy</code></a> is now a stable API and no longer considered experimental for TensorFlow. (earlier <code>tf.distribute.experimental.TPUStrategy</code>).</p> </li> <li> <p><a href="https://www.tensorflow.org/guide/profiler">TF Profiler</a> introduces two new tools: a memory profiler to visualize your model’s memory usage over time and a <a href="https://www.tensorflow.org/guide/profiler#events">python tracer</a> which allows you to trace python function calls in your model. Usability improvements include better diagnostic messages and <a href="https://tensorflow.org/guide/profiler#collect_performance_data">profile options</a> to customize the host and device trace verbosity level.</p> </li> <li> <p>Introduces experimental support for Keras Preprocessing Layers API (<a href="https://www.tensorflow.org/api_docs/python/tf/keras/layers/experimental/preprocessing?version=nightly"><code>tf.keras.layers.experimental.preprocessing.*</code></a>) to handle data preprocessing operations, with support for composite tensor inputs. Please see below for additional details on these layers.</p> </li> <li> <p>TFLite now properly supports dynamic shapes during conversion and inference. We’ve also added opt-in support on Android and iOS for <a href="https://github.com/tensorflow/tensorflow/tree/master/tensorflow/lite/delegates/xnnpack">XNNPACK</a>, a highly optimized set of CPU kernels, as well as opt-in support for <a href="https://github.com/tensorflow/tensorflow/blob/master/tensorflow/lite/g3doc/performance/gpu_advanced.md#running-quantized-models-experimental">executing quantized models on the GPU</a>.</p> </li> <li> <p>Libtensorflow packages are available in GCS starting this release. We have also started to <a href="https://github.com/tensorflow/tensorflow#official-builds">release a nightly version of these packages</a>.</p> </li> <li> <p>The experimental Python API <a href="https://www.tensorflow.org/api_docs/python/tf/debugging/experimental/enable_dump_debug_info"><code>tf.debugging.experimental.enable_dump_debug_info()</code></a> now allows you to instrument a TensorFlow program and dump debugging information to a directory on the file system. The directory can be read and visualized by a new interactive dashboard in TensorBoard 2.3 called <a href="https://www.tensorflow.org/tensorboard/debugger_v2">Debugger V2</a>, which reveals the details of the TensorFlow program including graph structures, history of op executions at the Python (eager) and intra-graph levels, the runtime dtype, shape, and numerical composistion of tensors, as well as their code locations.</p> </li> </ul> <h2>Breaking Changes</h2> <ul> <li>Increases the <strong>minimum bazel version</strong> required to build TF to <strong>3.1.0</strong>.</li> <li><code>tf.data</code> <ul> <li>Makes the following (breaking) changes to the <code>tf.data</code>.</li> <li>C++ API: - <code>IteratorBase::RestoreInternal</code>, <code>IteratorBase::SaveInternal</code>, and <code>DatasetBase::CheckExternalState</code> become pure-virtual and subclasses are now expected to provide an implementation.</li> <li>The deprecated <code>DatasetBase::IsStateful</code> method is removed in favor of <code>DatasetBase::CheckExternalState</code>.</li> <li>Deprecated overrides of <code>DatasetBase::MakeIterator</code> and <code>MakeIteratorFromInputElement</code> are removed.</li> </ul> </li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/tensorflow/tensorflow/blob/master/RELEASE.md">tensorflow's changelog</a>.</em></p> <blockquote> <h1>Release 2.3.1</h1> <h2>Bug Fixes and Other Changes</h2> <ul> <li>Fixes an undefined behavior causing a segfault in <code>tf.raw_ops.Switch</code> (<a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15190">CVE-2020-15190</a>)</li> <li>Fixes three vulnerabilities in conversion to DLPack format (<a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15191">CVE-2020-15191</a>, <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15192">CVE-2020-15192</a>, <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15193">CVE-2020-15193</a>)</li> <li>Fixes two vulnerabilities in <code>SparseFillEmptyRowsGrad</code> (<a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15194">CVE-2020-15194</a>, <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15195">CVE-2020-15195</a>)</li> <li>Fixes several vulnerabilities in <code>RaggedCountSparseOutput</code> and <code>SparseCountSparseOutput</code> operations (<a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15196">CVE-2020-15196</a>, <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15197">CVE-2020-15197</a>, <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15198">CVE-2020-15198</a>, <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15199">CVE-2020-15199</a>, <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15200">CVE-2020-15200</a>, <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15201">CVE-2020-15201</a>)</li> <li>Fixes an integer truncation vulnerability in code using the work sharder API (<a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15202">CVE-2020-15202</a>)</li> <li>Fixes a format string vulnerability in <code>tf.strings.as_string</code> (<a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15203">CVE-2020-15203</a>)</li> <li>Fixes segfault raised by calling session-only ops in eager mode (<a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15204">CVE-2020-15204</a>)</li> <li>Fixes data leak and potential ASLR violation from <code>tf.raw_ops.StringNGrams</code> (<a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15205">CVE-2020-15205</a>)</li> <li>Fixes segfaults caused by incomplete <code>SavedModel</code> validation (<a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15206">CVE-2020-15206</a>)</li> <li>Fixes a data corruption due to a bug in negative indexing support in TFLite (<a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15207">CVE-2020-15207</a>)</li> <li>Fixes a data corruption due to dimension mismatch in TFLite (<a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15208">CVE-2020-15208</a>)</li> <li>Fixes several vulnerabilities in TFLite saved model format (<a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15209">CVE-2020-15209</a>, <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15210">CVE-2020-15210</a>, <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15211">CVE-2020-15211</a>)</li> <li>Fixes several vulnerabilities in TFLite implementation of segment sum (<a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15212">CVE-2020-15212</a>, <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15213">CVE-2020-15213</a>, <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15214">CVE-2020-15214</a>)</li> <li>Updates <code>sqlite3</code> to <code>3.33.00</code> to handle <a href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-15358">CVE-2020-15358</a>.</li> <li>Fixes deprecated usage of <code>collections</code> API</li> <li>Removes <code>scipy</code> dependency from <code>setup.py</code> since TensorFlow does not need it to install the pip package</li> </ul> <h1>Release 2.2.1</h1> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/tensorflow/tensorflow/commit/fcc4b966f1265f466e82617020af93670141b009"><code>fcc4b96</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/tensorflow/tensorflow/issues/43446">#43446</a> from tensorflow-jenkins/version-numbers-2.3.1-16251</li> <li><a href="https://github.com/tensorflow/tensorflow/commit/4cf223069a94c78b208e6c829d5f938a0fae7d07"><code>4cf2230</code></a> Update version numbers to 2.3.1</li> <li><a href="https://github.com/tensorflow/tensorflow/commit/eee82247288e52e9b8a5c2badeb65f871b4da4c4"><code>eee8224</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/tensorflow/tensorflow/issues/43441">#43441</a> from tensorflow-jenkins/relnotes-2.3.1-24672</li> <li><a href="https://github.com/tensorflow/tensorflow/commit/0d41b1dfc97500e1177cb718a0b14b04914df661"><code>0d41b1d</code></a> Update RELEASE.md</li> <li><a href="https://github.com/tensorflow/tensorflow/commit/d99bd631ea9b67ffc39c22b35fbf7deca77ad1f7"><code>d99bd63</code></a> Insert release notes place-fill</li> <li><a href="https://github.com/tensorflow/tensorflow/commit/d71d3ce2520587b752e5d27b2d4a4ba8720e4bd5"><code>d71d3ce</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/tensorflow/tensorflow/issues/43414">#43414</a> from tensorflow/mihaimaruseac-patch-1-1</li> <li><a href="https://github.com/tensorflow/tensorflow/commit/9c91596d4d24bc07b6d36ae48581a2e7b2584edf"><code>9c91596</code></a> Fix missing import</li> <li><a href="https://github.com/tensorflow/tensorflow/commit/f9f12f61867159120ce6eb08fdbd225d454232b5"><code>f9f12f6</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/tensorflow/tensorflow/issues/43391">#43391</a> from tensorflow/mihaimaruseac-patch-4</li> <li><a href="https://github.com/tensorflow/tensorflow/commit/3ed271b0b05b4f1dfd5660944c54b5fe8cc3d8dc"><code>3ed271b</code></a> Solve leftover from merge conflict</li> <li><a href="https://github.com/tensorflow/tensorflow/commit/9cf3773b717dfd46b37be2ba8cad4f038a8ff6f7"><code>9cf3773</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/tensorflow/tensorflow/issues/43358">#43358</a> from tensorflow/mm-patch-r2.3</li> <li>Additional commits viewable in <a href="https://github.com/tensorflow/tensorflow/compare/v1.15.2...v2.3.1">compare view</a></li> </ul> </details> <br />

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


<details> <summary>Dependabot commands and options</summary> <br />

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
  • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
  • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
  • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

You can disable automated security fix PRs for this repo from the Security Alerts page.

</details>

+1 -1

0 comment

1 changed file

pr created time in 10 days

create barnchpymanopt/pymanopt

branch : dependabot/pip/tensorflow-2.3.1

created branch time in 10 days

issue openedfmarotta/kaobook

Long tilte in chapter with image do not wrap

\setchapterimage[6cm]{path/to/image.png}
\setchapterpreamble[u]{\margintoc}
\chapter{Analysis of three aspects of modern countries: age, forms of government and ethno-horonyms}

If the length of the chapter title exceeds the page width, then a reader do not see the ending of this title. I do not know how to force break (newline) in this chapter.

I if disable image: %\setchapterimage[6cm]{path/to/image.png} then the title is wrap normally.

created time in 12 days

pull request commentgeoopt/geoopt

implementation of SPD manifolds

Also, I think we can do the same trick as with Stiefel manifold when choosing metric

tao-harald

comment created time in 16 days

push eventgeoopt/geoopt

Maxim Kochurov

commit sha bddba4fb569dcb3c1974a0dc47397ae88f635d80

create pull request templates (#154) * create templates * remove brackets * add some more info * mention the PR in the changelog

view details

push time in 16 days

PR merged geoopt/geoopt

create pull request templates maintenance
+65 -0

0 comment

3 changed files

ferrine

pr closed time in 16 days

push eventgeoopt/geoopt

Maxim Kochurov

commit sha c1d3a8edaeba96be834a2c945b75f1ac5429c8b7

mention the PR in the changelog

view details

push time in 16 days

push eventgeoopt/geoopt

Maxim Kochurov

commit sha 956d01505e0f1e3629fd2dc13650f3778f519c6b

remove brackets

view details

Maxim Kochurov

commit sha 14e0afb6adcda700a90205f9fb3fd50df1875bc0

add some more info

view details

push time in 16 days

PR opened geoopt/geoopt

create pull request templates
+51 -0

0 comment

2 changed files

pr created time in 16 days

create barnchgeoopt/geoopt

branch : pull-request-template

created branch time in 16 days

issue commentgeoopt/geoopt

Using Riemannian Adam on Hyperbolic Graph Neural Networks

Hi, any questions still left? Sorry, But I totally missed reviewing this issue in time

arijitthegame

comment created time in 16 days

Pull request review commentgeoopt/geoopt

implementation of SPD manifolds

+from functools import partial+from typing import Callable, Optional, Tuple, Union+import torch+from .base import Manifold++__all__ = ["SymmetricPositiveDefinite"]+++EPS = {torch.float32: 1e-4, torch.float64: 1e-7}+++class SymmetricPositiveDefinite(Manifold):+    r"""Manifold of symmetric positive definite matrices.++    .. math::++        A = A^T\\+        \langle x, A x \rangle > 0 \quad , \forall x \in \mathrm{R}^{n}, x \neq 0 \\+        A \in \mathrm{R}^{n\times m}+++    The tangent space of the manifold contains all symmetric matrices.++    References+    ----------+    - https://github.com/pymanopt/pymanopt/blob/master/pymanopt/manifolds/psd.py+    - https://github.com/dalab/matrix-manifolds/blob/master/graphembed/graphembed/manifolds/spd.py++    Parameters+    ----------+    ndim : int+        number of trailing dimensions treated as matrix dimensions.+        All the operations acting on such as inner products, etc+        will respect the :attr:`ndim`.+    """++    __scaling__ = Manifold.__scaling__.copy()+    name = "SymmetricPositiveDefinite"+    ndim = 0+    reversible = True+    defaulf_metric: str = "AIM"++    def __init__(self, ndim=2, defaulf_metric: str = defaulf_metric):+        super().__init__()+        self.ndim = ndim+        self.defaulf_metric = defaulf_metric++    def _funcm(+        self, x: torch.Tensor, func: Callable[[torch.Tensor], torch.Tensor]+    ) -> torch.Tensor:+        """Apply function to symmetric matrix.++        Parameters+        ----------+        x : torch.Tensor+            symmetric matrix+        func : Callable[[torch.Tensor], torch.Tensor]+            function to apply++        Returns+        -------+        torch.Tensor+            symmetric matrix with function applied to+        """+        e, v = torch.symeig(x, eigenvectors=True)+        return v @ torch.diag_embed(func(e)) @ v.transpose(-1, -2)++    def _expm(self, x: torch.Tensor, using_native=False) -> torch.Tensor:+        """Symmetric matrix exponent.++        Parameters+        ----------+        x : torch.Tensor+            symmetric matrix+        using_native : bool, optional+            if using native matrix exponent `torch.matrix_exp`, by default False++        Returns+        -------+        torch.Tensor+            exp(x)+        """+        if using_native:+            return torch.matrix_exp(x)+        else:+            return self._funcm(x, torch.exp)++    def _logm(self, x: torch.Tensor) -> torch.Tensor:+        """Symmetric matrix logarithm.++        Parameters+        ----------+        x : torch.Tensor+            symmetric matrix++        Returns+        -------+        torch.Tensor+            log(x)+        """+        return self._funcm(x, torch.log)++    def _sqrtm(self, x: torch.Tensor) -> torch.Tensor:+        """Symmetric matrix square root .++        Parameters+        ----------+        x : torch.Tensor+            symmetric matrix++        Returns+        -------+        torch.Tensor+            sqrt(x)+        """+        return self._funcm(x, torch.sqrt)++    def _invm(self, x: torch.Tensor) -> torch.Tensor:+        """Symmetric matrix inverse.++        Parameters+        ----------+        x : torch.Tensor+            symmetric matrix++        Returns+        -------+        torch.Tensor+            x^{-1}+        """+        return self._funcm(x, torch.reciprocal)++    def _inv_sqrtm1(self, x: torch.Tensor) -> torch.Tensor:

Well, I believe that is faster since it fuses 2 ops. Am I correct?

Yeah, since some operations need both inverse and inverse square root, it's better to fuse these two operations since they both require eigendecomposition.

tao-harald

comment created time in 16 days

Pull request review commentgeoopt/geoopt

implementation of SPD manifolds

+from functools import partial+from typing import Callable, Optional, Tuple, Union+import torch+from .base import Manifold++__all__ = ["SymmetricPositiveDefinite"]+++EPS = {torch.float32: 1e-4, torch.float64: 1e-7}+++class SymmetricPositiveDefinite(Manifold):+    r"""Manifold of symmetric positive definite matrices.++    .. math::++        A = A^T\\+        \langle x, A x \rangle > 0 \quad , \forall x \in \mathrm{R}^{n}, x \neq 0 \\+        A \in \mathrm{R}^{n\times m}+++    The tangent space of the manifold contains all symmetric matrices.++    References+    ----------+    - https://github.com/pymanopt/pymanopt/blob/master/pymanopt/manifolds/psd.py+    - https://github.com/dalab/matrix-manifolds/blob/master/graphembed/graphembed/manifolds/spd.py++    Parameters+    ----------+    ndim : int+        number of trailing dimensions treated as matrix dimensions.+        All the operations acting on such as inner products, etc+        will respect the :attr:`ndim`.+    """++    __scaling__ = Manifold.__scaling__.copy()+    name = "SymmetricPositiveDefinite"+    ndim = 0+    reversible = True+    defaulf_metric: str = "AIM"++    def __init__(self, ndim=2, defaulf_metric: str = defaulf_metric):+        super().__init__()+        self.ndim = ndim+        self.defaulf_metric = defaulf_metric++    def _funcm(+        self, x: torch.Tensor, func: Callable[[torch.Tensor], torch.Tensor]+    ) -> torch.Tensor:+        """Apply function to symmetric matrix.++        Parameters+        ----------+        x : torch.Tensor+            symmetric matrix+        func : Callable[[torch.Tensor], torch.Tensor]+            function to apply++        Returns+        -------+        torch.Tensor+            symmetric matrix with function applied to+        """+        e, v = torch.symeig(x, eigenvectors=True)+        return v @ torch.diag_embed(func(e)) @ v.transpose(-1, -2)++    def _expm(self, x: torch.Tensor, using_native=False) -> torch.Tensor:+        """Symmetric matrix exponent.++        Parameters+        ----------+        x : torch.Tensor+            symmetric matrix+        using_native : bool, optional+            if using native matrix exponent `torch.matrix_exp`, by default False++        Returns+        -------+        torch.Tensor+            exp(x)+        """+        if using_native:+            return torch.matrix_exp(x)+        else:+            return self._funcm(x, torch.exp)++    def _logm(self, x: torch.Tensor) -> torch.Tensor:+        """Symmetric matrix logarithm.++        Parameters+        ----------+        x : torch.Tensor+            symmetric matrix++        Returns+        -------+        torch.Tensor+            log(x)+        """+        return self._funcm(x, torch.log)++    def _sqrtm(self, x: torch.Tensor) -> torch.Tensor:+        """Symmetric matrix square root .++        Parameters+        ----------+        x : torch.Tensor+            symmetric matrix++        Returns+        -------+        torch.Tensor+            sqrt(x)
            :math:`x^{1/2}`
tao-harald

comment created time in 16 days

Pull request review commentgeoopt/geoopt

implementation of SPD manifolds

+from functools import partial+from typing import Callable, Optional, Tuple, Union+import torch+from .base import Manifold++__all__ = ["SymmetricPositiveDefinite"]+++EPS = {torch.float32: 1e-4, torch.float64: 1e-7}+++class SymmetricPositiveDefinite(Manifold):+    r"""Manifold of symmetric positive definite matrices.++    .. math::++        A = A^T\\+        \langle x, A x \rangle > 0 \quad , \forall x \in \mathrm{R}^{n}, x \neq 0 \\+        A \in \mathrm{R}^{n\times m}+++    The tangent space of the manifold contains all symmetric matrices.++    References+    ----------+    - https://github.com/pymanopt/pymanopt/blob/master/pymanopt/manifolds/psd.py+    - https://github.com/dalab/matrix-manifolds/blob/master/graphembed/graphembed/manifolds/spd.py++    Parameters+    ----------+    ndim : int+        number of trailing dimensions treated as matrix dimensions.+        All the operations acting on such as inner products, etc+        will respect the :attr:`ndim`.+    """++    __scaling__ = Manifold.__scaling__.copy()+    name = "SymmetricPositiveDefinite"+    ndim = 0+    reversible = True+    defaulf_metric: str = "AIM"++    def __init__(self, ndim=2, defaulf_metric: str = defaulf_metric):+        super().__init__()+        self.ndim = ndim+        self.defaulf_metric = defaulf_metric++    def _funcm(+        self, x: torch.Tensor, func: Callable[[torch.Tensor], torch.Tensor]+    ) -> torch.Tensor:+        """Apply function to symmetric matrix.++        Parameters+        ----------+        x : torch.Tensor+            symmetric matrix+        func : Callable[[torch.Tensor], torch.Tensor]+            function to apply++        Returns+        -------+        torch.Tensor+            symmetric matrix with function applied to+        """+        e, v = torch.symeig(x, eigenvectors=True)+        return v @ torch.diag_embed(func(e)) @ v.transpose(-1, -2)++    def _expm(self, x: torch.Tensor, using_native=False) -> torch.Tensor:+        """Symmetric matrix exponent.++        Parameters+        ----------+        x : torch.Tensor+            symmetric matrix+        using_native : bool, optional+            if using native matrix exponent `torch.matrix_exp`, by default False++        Returns+        -------+        torch.Tensor+            exp(x)+        """+        if using_native:+            return torch.matrix_exp(x)+        else:+            return self._funcm(x, torch.exp)++    def _logm(self, x: torch.Tensor) -> torch.Tensor:+        """Symmetric matrix logarithm.++        Parameters+        ----------+        x : torch.Tensor+            symmetric matrix++        Returns+        -------+        torch.Tensor+            log(x)+        """+        return self._funcm(x, torch.log)++    def _sqrtm(self, x: torch.Tensor) -> torch.Tensor:+        """Symmetric matrix square root .++        Parameters+        ----------+        x : torch.Tensor+            symmetric matrix++        Returns+        -------+        torch.Tensor+            sqrt(x)+        """+        return self._funcm(x, torch.sqrt)++    def _invm(self, x: torch.Tensor) -> torch.Tensor:+        """Symmetric matrix inverse.++        Parameters+        ----------+        x : torch.Tensor+            symmetric matrix++        Returns+        -------+        torch.Tensor+            x^{-1}+        """+        return self._funcm(x, torch.reciprocal)++    def _inv_sqrtm1(self, x: torch.Tensor) -> torch.Tensor:+        """Symmetric matrix inverse square root.++        Parameters+        ----------+        x : torch.Tensor+            symmetric matrix++        Returns+        -------+        torch.Tensor+            x^{-1/2}+        """+        return self._funcm(x, lambda tensor: torch.reciprocal(torch.sqrt(tensor)))++    def _inv_sqrtm2(self, x: torch.Tensor) -> Tuple[torch.Tensor, torch.Tensor]:+        """Symmetric matrix inverse square root, with square root return also.++        Parameters+        ----------+        x : torch.Tensor+            symmetric matrix++        Returns+        -------+        Tuple[torch.Tensor, torch.Tensor]+            x^{-1/2}, sqrt(x)+        """+        e, v = torch.symeig(x, eigenvectors=True)+        sqrt_e = torch.sqrt(e)+        inv_sqrt_e = 1 / sqrt_e+        return (+            v @ torch.diag_embed(inv_sqrt_e) @ v.transpose(-1, -2),+            v @ torch.diag_embed(sqrt_e) @ v.transpose(-1, -2),+        )++    def _sym(self, x: torch.Tensor) -> torch.Tensor:+        r"""Make matrix symmetric.++        .. math::++            \frac{A + A^T}{2}++        Parameters+        ----------+        x : torch.Tensor+            matrix to symmetrize++        Returns+        -------+        torch.Tensor+            symmetric matrix+        """+        return (x + x.transpose(-1, -2)) / 2++    _dist_doc = """+        Parameters+        ----------+        x : torch.Tensor+            point on the manifold+        y : torch.Tensor+            point on the manifold+        keepdim : bool+            keep the last dim?++        Returns+        -------+        torch.Tensor+            distance between two points+        """++    def _affine_invariant_metric(+        self, x: torch.Tensor, y: torch.Tensor, keepdim=False+    ) -> torch.Tensor:+        r"""Affine Invariant Metric distance.++        {}++        References+        ----------+        A Riemannian framework for tensor computing. 2006.+        """.format(+            self._dist_doc+        )+        inv_sqrt_x = self._inv_sqrtm1(x)+        return 0.5 * torch.norm(+            self._logm(inv_sqrt_x @ y @ inv_sqrt_x), dim=[-1, -2], keepdim=keepdim+        )++    def _stein_metric(+        self, x: torch.Tensor, y: torch.Tensor, keepdim=False+    ) -> torch.Tensor:+        r"""Stein Metric distance.++        {}++        References+        ----------+        A new metric on the manifold of kernel matrices with application to matrix geometric means. 2012.+        """.format(+            self._dist_doc+        )++        def log_det(tensor: torch.Tensor) -> torch.Tensor:+            return torch.log(torch.det(tensor))++        if keepdim:

keep_dim is an important parameter, let's just expand collapsed dims in this case?

tao-harald

comment created time in 16 days

Pull request review commentgeoopt/geoopt

implementation of SPD manifolds

+from functools import partial+from typing import Callable, Optional, Tuple, Union+import torch+from .base import Manifold++__all__ = ["SymmetricPositiveDefinite"]+++EPS = {torch.float32: 1e-4, torch.float64: 1e-7}+++class SymmetricPositiveDefinite(Manifold):+    r"""Manifold of symmetric positive definite matrices.++    .. math::++        A = A^T\\+        \langle x, A x \rangle > 0 \quad , \forall x \in \mathrm{R}^{n}, x \neq 0 \\+        A \in \mathrm{R}^{n\times m}+++    The tangent space of the manifold contains all symmetric matrices.++    References+    ----------+    - https://github.com/pymanopt/pymanopt/blob/master/pymanopt/manifolds/psd.py+    - https://github.com/dalab/matrix-manifolds/blob/master/graphembed/graphembed/manifolds/spd.py++    Parameters+    ----------+    ndim : int+        number of trailing dimensions treated as matrix dimensions.+        All the operations acting on such as inner products, etc+        will respect the :attr:`ndim`.+    """++    __scaling__ = Manifold.__scaling__.copy()+    name = "SymmetricPositiveDefinite"+    ndim = 0+    reversible = True+    defaulf_metric: str = "AIM"++    def __init__(self, ndim=2, defaulf_metric: str = defaulf_metric):+        super().__init__()+        self.ndim = ndim+        self.defaulf_metric = defaulf_metric++    def _funcm(+        self, x: torch.Tensor, func: Callable[[torch.Tensor], torch.Tensor]+    ) -> torch.Tensor:+        """Apply function to symmetric matrix.++        Parameters+        ----------+        x : torch.Tensor+            symmetric matrix+        func : Callable[[torch.Tensor], torch.Tensor]+            function to apply++        Returns+        -------+        torch.Tensor+            symmetric matrix with function applied to+        """+        e, v = torch.symeig(x, eigenvectors=True)+        return v @ torch.diag_embed(func(e)) @ v.transpose(-1, -2)++    def _expm(self, x: torch.Tensor, using_native=False) -> torch.Tensor:+        """Symmetric matrix exponent.++        Parameters+        ----------+        x : torch.Tensor+            symmetric matrix+        using_native : bool, optional+            if using native matrix exponent `torch.matrix_exp`, by default False++        Returns+        -------+        torch.Tensor+            exp(x)+        """+        if using_native:+            return torch.matrix_exp(x)+        else:+            return self._funcm(x, torch.exp)++    def _logm(self, x: torch.Tensor) -> torch.Tensor:+        """Symmetric matrix logarithm.++        Parameters+        ----------+        x : torch.Tensor+            symmetric matrix++        Returns+        -------+        torch.Tensor+            log(x)+        """+        return self._funcm(x, torch.log)++    def _sqrtm(self, x: torch.Tensor) -> torch.Tensor:+        """Symmetric matrix square root .++        Parameters+        ----------+        x : torch.Tensor+            symmetric matrix++        Returns+        -------+        torch.Tensor+            sqrt(x)+        """+        return self._funcm(x, torch.sqrt)++    def _invm(self, x: torch.Tensor) -> torch.Tensor:+        """Symmetric matrix inverse.++        Parameters+        ----------+        x : torch.Tensor+            symmetric matrix++        Returns+        -------+        torch.Tensor+            x^{-1}+        """+        return self._funcm(x, torch.reciprocal)++    def _inv_sqrtm1(self, x: torch.Tensor) -> torch.Tensor:

Also, the best place to put this is batch_linalg file

tao-harald

comment created time in 16 days

Pull request review commentgeoopt/geoopt

implementation of SPD manifolds

+from functools import partial+from typing import Callable, Optional, Tuple, Union+import torch+from .base import Manifold++__all__ = ["SymmetricPositiveDefinite"]+++EPS = {torch.float32: 1e-4, torch.float64: 1e-7}+++class SymmetricPositiveDefinite(Manifold):+    r"""Manifold of symmetric positive definite matrices.++    .. math::++        A = A^T\\+        \langle x, A x \rangle > 0 \quad , \forall x \in \mathrm{R}^{n}, x \neq 0 \\+        A \in \mathrm{R}^{n\times m}+++    The tangent space of the manifold contains all symmetric matrices.++    References+    ----------+    - https://github.com/pymanopt/pymanopt/blob/master/pymanopt/manifolds/psd.py+    - https://github.com/dalab/matrix-manifolds/blob/master/graphembed/graphembed/manifolds/spd.py++    Parameters+    ----------+    ndim : int+        number of trailing dimensions treated as matrix dimensions.+        All the operations acting on such as inner products, etc+        will respect the :attr:`ndim`.+    """++    __scaling__ = Manifold.__scaling__.copy()+    name = "SymmetricPositiveDefinite"+    ndim = 0+    reversible = True+    defaulf_metric: str = "AIM"++    def __init__(self, ndim=2, defaulf_metric: str = defaulf_metric):+        super().__init__()+        self.ndim = ndim+        self.defaulf_metric = defaulf_metric++    def _funcm(+        self, x: torch.Tensor, func: Callable[[torch.Tensor], torch.Tensor]+    ) -> torch.Tensor:+        """Apply function to symmetric matrix.++        Parameters+        ----------+        x : torch.Tensor+            symmetric matrix+        func : Callable[[torch.Tensor], torch.Tensor]+            function to apply++        Returns+        -------+        torch.Tensor+            symmetric matrix with function applied to+        """+        e, v = torch.symeig(x, eigenvectors=True)+        return v @ torch.diag_embed(func(e)) @ v.transpose(-1, -2)++    def _expm(self, x: torch.Tensor, using_native=False) -> torch.Tensor:+        """Symmetric matrix exponent.++        Parameters+        ----------+        x : torch.Tensor+            symmetric matrix+        using_native : bool, optional+            if using native matrix exponent `torch.matrix_exp`, by default False++        Returns+        -------+        torch.Tensor+            exp(x)+        """+        if using_native:+            return torch.matrix_exp(x)+        else:+            return self._funcm(x, torch.exp)++    def _logm(self, x: torch.Tensor) -> torch.Tensor:+        """Symmetric matrix logarithm.++        Parameters+        ----------+        x : torch.Tensor+            symmetric matrix++        Returns+        -------+        torch.Tensor+            log(x)+        """+        return self._funcm(x, torch.log)++    def _sqrtm(self, x: torch.Tensor) -> torch.Tensor:+        """Symmetric matrix square root .++        Parameters+        ----------+        x : torch.Tensor+            symmetric matrix++        Returns+        -------+        torch.Tensor+            sqrt(x)+        """+        return self._funcm(x, torch.sqrt)++    def _invm(self, x: torch.Tensor) -> torch.Tensor:+        """Symmetric matrix inverse.++        Parameters+        ----------+        x : torch.Tensor+            symmetric matrix++        Returns+        -------+        torch.Tensor+            x^{-1}+        """+        return self._funcm(x, torch.reciprocal)++    def _inv_sqrtm1(self, x: torch.Tensor) -> torch.Tensor:+        """Symmetric matrix inverse square root.++        Parameters+        ----------+        x : torch.Tensor+            symmetric matrix++        Returns+        -------+        torch.Tensor+            x^{-1/2}+        """+        return self._funcm(x, lambda tensor: torch.reciprocal(torch.sqrt(tensor)))++    def _inv_sqrtm2(self, x: torch.Tensor) -> Tuple[torch.Tensor, torch.Tensor]:+        """Symmetric matrix inverse square root, with square root return also.++        Parameters+        ----------+        x : torch.Tensor+            symmetric matrix++        Returns+        -------+        Tuple[torch.Tensor, torch.Tensor]+            x^{-1/2}, sqrt(x)+        """+        e, v = torch.symeig(x, eigenvectors=True)+        sqrt_e = torch.sqrt(e)+        inv_sqrt_e = 1 / sqrt_e+        return (+            v @ torch.diag_embed(inv_sqrt_e) @ v.transpose(-1, -2),+            v @ torch.diag_embed(sqrt_e) @ v.transpose(-1, -2),+        )++    def _sym(self, x: torch.Tensor) -> torch.Tensor:+        r"""Make matrix symmetric.++        .. math::++            \frac{A + A^T}{2}++        Parameters+        ----------+        x : torch.Tensor+            matrix to symmetrize++        Returns+        -------+        torch.Tensor+            symmetric matrix+        """+        return (x + x.transpose(-1, -2)) / 2++    _dist_doc = """+        Parameters+        ----------+        x : torch.Tensor+            point on the manifold+        y : torch.Tensor+            point on the manifold+        keepdim : bool+            keep the last dim?++        Returns+        -------+        torch.Tensor+            distance between two points+        """++    def _affine_invariant_metric(+        self, x: torch.Tensor, y: torch.Tensor, keepdim=False+    ) -> torch.Tensor:+        r"""Affine Invariant Metric distance.++        {}++        References+        ----------+        A Riemannian framework for tensor computing. 2006.+        """.format(+            self._dist_doc+        )+        inv_sqrt_x = self._inv_sqrtm1(x)+        return 0.5 * torch.norm(+            self._logm(inv_sqrt_x @ y @ inv_sqrt_x), dim=[-1, -2], keepdim=keepdim+        )++    def _stein_metric(+        self, x: torch.Tensor, y: torch.Tensor, keepdim=False+    ) -> torch.Tensor:+        r"""Stein Metric distance.++        {}++        References+        ----------+        A new metric on the manifold of kernel matrices with application to matrix geometric means. 2012.+        """.format(+            self._dist_doc+        )++        def log_det(tensor: torch.Tensor) -> torch.Tensor:+            return torch.log(torch.det(tensor))++        if keepdim:+            raise ValueError("`torch.det` doesn't support keepdim.")+        return log_det((x + y) * 0.5) - 0.5 * log_det(x @ y)++    def _log_eucliden_metric(+        self, x: torch.Tensor, y: torch.Tensor, keepdim=False+    ) -> torch.Tensor:+        r"""Log-Eucliden Metric distance.++        {}++        References+        ----------+        Log‐Euclidean metrics for fast and simple calculus on diffusion tensors. 2006.+        """.format(+            self._dist_doc+        )+        return torch.norm(self._logm(x) - self._logm(y), dim=[-1, -2], keepdim=keepdim)++    def _check_point_on_manifold(+        self, x: torch.Tensor, *, atol=1e-5, rtol=1e-5+    ) -> Union[Tuple[bool, Optional[str]], bool]:+        ok = torch.allclose(x, x.transpose(-1, -2), atol=atol, rtol=rtol)+        if not ok:+            return False, "`x != x.transpose` with atol={}, rtol={}".format(atol, rtol)+        e, _ = torch.symeig(x)+        ok = (e > -atol).min()+        if not ok:+            return False, "eigenvalues of x are not all greater than 0."+        return True, None++    def _check_vector_on_tangent(+        self, x: torch.Tensor, u: torch.Tensor, *, atol=1e-5, rtol=1e-5+    ) -> Union[Tuple[bool, Optional[str]], bool]:+        ok = torch.allclose(u, u.transpose(-1, -2), atol=atol, rtol=rtol)+        if not ok:+            return False, "`u != u.transpose` with atol={}, rtol={}".format(atol, rtol)+        return True, None++    def projx(self, x: torch.Tensor) -> torch.Tensor:+        symx = self._sym(x)+        return self._funcm(symx, partial(torch.clamp, min=EPS[x.dtype]))++    def proju(self, x: torch.Tensor, u: torch.Tensor) -> torch.Tensor:+        return self._sym(u)++    def egrad2rgrad(self, x: torch.Tensor, u: torch.Tensor) -> torch.Tensor:+        return x @ self.proju(x, u) @ x.transpose(-1, -2)++    _dist_metric = {+        "AIM": _affine_invariant_metric,+        "SM": _stein_metric,+        "LEM": _log_eucliden_metric,+    }++    def dist(+        self,+        x: torch.Tensor,+        y: torch.Tensor,+        mode: str = defaulf_metric,+        keepdim=False,+    ) -> torch.Tensor:+        """Compute distance between 2 points on the manifold that is the shortest path along geodesics.++        Parameters+        ----------+        x : torch.Tensor+            point on the manifold+        y : torch.Tensor+            point on the manifold+        mode : str, optional+            choose metric to compute distance, by default defaulf_metric+        keepdim : bool, optional+            keep the last dim?, by default False++        Returns+        -------+        torch.Tensor+            distance between two points++        Raises+        ------+        ValueError+            if `mode` isn't in `_dist_metric`+        """+        if mode in self._dist_metric:+            return self._dist_metric[mode](self, x, y, keepdim=keepdim)+        else:+            raise ValueError(+                "Unsopported metric:'"+                + mode+                + "'. Please choose one from "+                + str(tuple(self._dist_metric.keys()))+            )++    def inner(+        self,+        x: torch.Tensor,+        u: torch.Tensor,+        v: Optional[torch.Tensor] = None,+        keepdim=False,+    ) -> torch.Tensor:+        """+        Inner product for tangent vectors at point :math:`x`.++        Parameters+        ----------+        x : torch.Tensor+            point on the manifold+        u : torch.Tensor+            tangent vector at point :math:`x`+        v : Optional[torch.Tensor]+            tangent vector at point :math:`x`+        keepdim : bool+            keep the last dim?++        Returns+        -------+        torch.Tensor+            inner product (broadcasted)++        Raises+        ------+        ValueError+            if `keepdim` sine `torch.trace` doesn't support keepdim+        """+        if v is None:+            v = u+        if keepdim:

again, this is an important feature used in optimizer routine

tao-harald

comment created time in 16 days

Pull request review commentgeoopt/geoopt

implementation of SPD manifolds

+from functools import partial+from typing import Callable, Optional, Tuple, Union+import torch+from .base import Manifold++__all__ = ["SymmetricPositiveDefinite"]+++EPS = {torch.float32: 1e-4, torch.float64: 1e-7}+++class SymmetricPositiveDefinite(Manifold):+    r"""Manifold of symmetric positive definite matrices.++    .. math::++        A = A^T\\+        \langle x, A x \rangle > 0 \quad , \forall x \in \mathrm{R}^{n}, x \neq 0 \\+        A \in \mathrm{R}^{n\times m}+++    The tangent space of the manifold contains all symmetric matrices.++    References+    ----------+    - https://github.com/pymanopt/pymanopt/blob/master/pymanopt/manifolds/psd.py+    - https://github.com/dalab/matrix-manifolds/blob/master/graphembed/graphembed/manifolds/spd.py++    Parameters+    ----------+    ndim : int+        number of trailing dimensions treated as matrix dimensions.+        All the operations acting on such as inner products, etc+        will respect the :attr:`ndim`.+    """++    __scaling__ = Manifold.__scaling__.copy()+    name = "SymmetricPositiveDefinite"+    ndim = 0+    reversible = True+    defaulf_metric: str = "AIM"++    def __init__(self, ndim=2, defaulf_metric: str = defaulf_metric):+        super().__init__()+        self.ndim = ndim+        self.defaulf_metric = defaulf_metric++    def _funcm(+        self, x: torch.Tensor, func: Callable[[torch.Tensor], torch.Tensor]+    ) -> torch.Tensor:+        """Apply function to symmetric matrix.++        Parameters+        ----------+        x : torch.Tensor+            symmetric matrix+        func : Callable[[torch.Tensor], torch.Tensor]+            function to apply++        Returns+        -------+        torch.Tensor+            symmetric matrix with function applied to+        """+        e, v = torch.symeig(x, eigenvectors=True)+        return v @ torch.diag_embed(func(e)) @ v.transpose(-1, -2)++    def _expm(self, x: torch.Tensor, using_native=False) -> torch.Tensor:+        """Symmetric matrix exponent.++        Parameters+        ----------+        x : torch.Tensor+            symmetric matrix+        using_native : bool, optional+            if using native matrix exponent `torch.matrix_exp`, by default False++        Returns+        -------+        torch.Tensor+            exp(x)+        """+        if using_native:+            return torch.matrix_exp(x)+        else:+            return self._funcm(x, torch.exp)++    def _logm(self, x: torch.Tensor) -> torch.Tensor:+        """Symmetric matrix logarithm.++        Parameters+        ----------+        x : torch.Tensor+            symmetric matrix++        Returns+        -------+        torch.Tensor+            log(x)+        """+        return self._funcm(x, torch.log)++    def _sqrtm(self, x: torch.Tensor) -> torch.Tensor:+        """Symmetric matrix square root .++        Parameters+        ----------+        x : torch.Tensor+            symmetric matrix++        Returns+        -------+        torch.Tensor+            sqrt(x)+        """+        return self._funcm(x, torch.sqrt)++    def _invm(self, x: torch.Tensor) -> torch.Tensor:+        """Symmetric matrix inverse.++        Parameters+        ----------+        x : torch.Tensor+            symmetric matrix++        Returns+        -------+        torch.Tensor+            x^{-1}+        """+        return self._funcm(x, torch.reciprocal)++    def _inv_sqrtm1(self, x: torch.Tensor) -> torch.Tensor:+        """Symmetric matrix inverse square root.++        Parameters+        ----------+        x : torch.Tensor+            symmetric matrix++        Returns+        -------+        torch.Tensor+            x^{-1/2}+        """+        return self._funcm(x, lambda tensor: torch.reciprocal(torch.sqrt(tensor)))++    def _inv_sqrtm2(self, x: torch.Tensor) -> Tuple[torch.Tensor, torch.Tensor]:+        """Symmetric matrix inverse square root, with square root return also.++        Parameters+        ----------+        x : torch.Tensor+            symmetric matrix++        Returns+        -------+        Tuple[torch.Tensor, torch.Tensor]+            x^{-1/2}, sqrt(x)+        """+        e, v = torch.symeig(x, eigenvectors=True)+        sqrt_e = torch.sqrt(e)+        inv_sqrt_e = 1 / sqrt_e+        return (+            v @ torch.diag_embed(inv_sqrt_e) @ v.transpose(-1, -2),+            v @ torch.diag_embed(sqrt_e) @ v.transpose(-1, -2),+        )++    def _sym(self, x: torch.Tensor) -> torch.Tensor:

already there

tao-harald

comment created time in 16 days

more