2,940 karma · joined Oct 16, 2020 (6y ago) · 2,890 submissions
----------------------------------------------------
comment 4y ago · link · parent
>>> a = [np.arange(i) for i in range(1, 11)]
>>> np.array(a).T
array([array([0]), array([0, 1]), array([0, 1, 2]), array([0, 1, 2, 3]),
array([0, 1, 2, 3, 4]), array([0, 1, 2, 3, 4, 5]),
array([0, 1, 2, 3, 4, 5, 6]), array([0, 1, 2, 3, 4, 5, 6, 7]),
array([0, 1, 2, 3, 4, 5, 6, 7, 8]),
array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])], dtype=object)
In fact, if we are to zip them, it should yield:>>> list(zip(*a))
[(0, 0, 0, 0, 0, 0, 0, 0, 0, 0)]
zip_arrays otoh does give the same result.
>>> zip_arrays(a)
array([[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]])
comment 4y ago · link · parent
>>> zip_arrays(arrays)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 2, in zip_arrays2
File "<stdin>", line 2, in <listcomp>
File "<__array_function__ internals>", line 180, in concatenate
ValueError: zero-dimensional arrays cannot be concatenatedTry this:
def zip_arrays(arrays):
return np.concatenate([array[:l,...,None] for l in [min(array.shape[0] for array in arrays)] for array in arrays], axis=-1)
Or if we are trying to be more tidy instead of a one linerdef zip_arrays(arrays):
l = min(a.shape[0] for a in arrays)
arrays = [a[:l, ..., None] for a in arrays]
return np.concatenate(arrays)comment 4y ago · link · parent
The 1e4 speedup was on a Trust Region optimizer. The algorithm was implemented to solve "the hard case"[1] involves multiple Cholesky factorizations, a matrix inversion, an eigenvalue decomposition on each step, and a call to scipy.linalg.solve_triangular.
Part of the speedup is likely from caching/avoiding recomputations things.
Granted, I had to rewrite a lot of the code to accommodate jax's peculiarities around python semantics, and made extensive use of jax.lax.{fori_loop, while_loop, scan, cond}.
[1] http://www.apmath.spbu.ru/cnsa/pdf/monograf/Numerical_Optimi..., see page 87.
comment 4y ago · link · parent
https://www.goodreads.com/book/show/8295305-a-book-of-abstra...
comment 4y ago · link · parent
The same alternative that cut taxes for his rich friends [1], and hiked the taxes for the same people that voted for him [2-3]?
[1] https://www.theguardian.com/business/2019/oct/09/trump-tax-c...
[2] https://www.nytimes.com/2020/10/31/opinion/republicans-biden...
[3] https://www.washingtonpost.com/news/wonk/wp/2017/11/16/senat...
> The law they passed initially lowered taxes for most Americans, but it built in automatic, stepped tax increases every two years that begin in 2021 and that by 2027 would affect nearly everyone but people at the top of the economic hierarchy. All taxpayer income groups with incomes of $75,000 and under — that’s about 65 percent of taxpayers — will face a higher tax rate in 2027 than in 2019.
comment 4y ago · link · parent
[1] https://www.dw.com/en/european-commission-declares-nuclear-a...
[2] https://time.com/6139049/europe-natural-gas-green-energy
comment 4y ago · link · parent
- Trump wanted to sell US gas to EU in 2018.
- Trump wanted to pull out of NATO -> weaker NATO weaker response to Putin's invasion in 2019.
- Germany cut nuclear because Schroeder, friend of Putin's. See links above.
What weakness did Trump "exploit" and "how"? Also, citations needed.
> If dumb Western leaders were at least as smart as Trump, we wouldn’t be in this situation.
Yes, if western leaders were as smart as Trump, Ukraine would have been lost already, and covid would have ravaged Europe like it did with US.
comment 4y ago · link · parent
- Trump calls Putin "savvy" https://youtu.be/UsTH-WqbEu8?t=80
- Trump defends praising Putin https://edition.cnn.com/2022/02/26/politics/trump-cpac-putin...
> The problem is not that Putin is smart, which, of course, he's smart
And sorry, it wasn't a genius, it was a stupid flop filled with greed and hubris.
Jesus Christ touch some grass.
comment 4y ago · link · parent
- First day of war, Trump praises Putin for his behaviour, on tape, call him a genius [1, 4].
- Second day of war, Trump doubles down, on tape. [1]
- When asked whether [Trump] made a mistake calling [Putin] a genius, Moskow Mitch dodges the question, responds that Putin is a "ruthless thug". [2]
- [Repeatedly] met with Putin with no staff / note takers. [3]
- [The first time] Trump was impeached over holding aid of $400m from Ukraine. [4]
- Trump sides with Russia against FBI at Helsinki summit [5]
- Trump veto'd sanctions against Russia [6]
- Trump says it's 'common sense' to include Russia in G7 [7]
- Trump revealed highly classified information to Russian foreign minister and ambassador [8]
- Trump offered to help Putin with wildfires while ignoring wildfires in US [9, 10]
And the list keeps growing, consider looking into Manafort under the light of these events.
As for Schroeder, consider that he pushed for gas, is a close friend of Putin and didn't extend lifetimes of Nuclear plants, and after leaving his position he became board member in Gazprom [11, 12, 13]
[1] https://www.independent.co.uk/news/world/americas/us-politic...
[2] https://www.newsweek.com/mitch-mcconnell-calls-putin-ruthles...
[3] https://www.vox.com/2019/1/29/18202515/trump-putin-russia-g2...
[4] https://www.businessinsider.com/trump-statement-ukraine-cris...
[5] https://www.bbc.com/news/world-europe-44852812
[6] https://www.nytimes.com/2017/07/27/us/politics/senate-russia...
[7] https://www.reuters.com/article/us-g7-summit-trump/trump-say...
[8] https://www.washingtonpost.com/world/national-security/trump...
[9] https://www.reuters.com/article/us-usa-russia-trump-putin-wi...
[10] https://democrats.org/news/fact-sheet-trump-ignored-and-refu...
[11] https://www.politico.eu/article/outrage-germany-ex-chancello...
[12] https://www.thisismoney.co.uk/money/markets/article-10562307...
[13] https://www.theglobeandmail.com/world/article-former-german-...
comment 4y ago · link · parent
It has nothing to with the average Russian, but everything to do with the Government, the dictator, and those who willingly support them.
That isn't to say the west hasn't done anything wrong. But by my account, we can pin the following on Russia:
- Installing puppets in foreign governments
- Schroeder
- Trump / GOP
- Pushing for Brexit
- Supporting conspiracy groups that lead to an insurrection that threatened the semblance of democracy that the US had- Sent children to war
- Committed 11 distinct war crimes in just 8 days, including shooting civies and children that were fleeing, hospitals, and wearing UN and Ua colours.
Russia isn't the problem, the problem is the person at the driver seat that is actively threatening a nuclear holocaust.
comment 4y ago · link · parent
It is a plague that needs to be eradicated. That isn't silencing a nation though, that is silencing a cancerous government that is infecting every nation it can.
comment 4y ago · link · parent
> Are regular American citizens to be blamed and punished for their leaders war crimes?
Whataboutism is unnecessary and the answer is I can't see any reason as to why not.