This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%Make sure to have \usepackage{tikz} | |
%https://tex.stackexchange.com/a/45815/140440 - for grid | |
%https://tex.stackexchange.com/a/381175/140440 - for alignment in equation | |
% This function draws a matrix. | |
\newcommand{\mat}[2]{% cols, rows | |
\vcenter{\hbox{ %Vertical alignment | |
\begin{tikzpicture}[scale=0.3, align=center] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Author: Mathieu Blondel | |
# License: BSD 3 clause | |
import numpy as np | |
def projection_simplex(V, z=1, axis=None): | |
""" | |
Projection of x onto the simplex, scaled by z: | |
P(x; z) = argmin_{y >= 0, sum(y) = z} ||y - x||^2 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\begin{tikzpicture}[sloped] | |
\node (a) at (-6,0) {a}; | |
\node (b) at (-3,0) {b}; | |
\node (c) at (-0.5,0) {c}; | |
\node (d) at (0.5,0) {d}; | |
\node (e) at (2,0) {e}; | |
\node (ab) at (-4.5,3) {}; | |
\node (cd) at (0,1) {}; | |
\node (cde) at (1,2) {}; | |
\node (all) at (-1.5,5) {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javafx.application.Application; | |
import javafx.collections.FXCollections; | |
import javafx.collections.ObservableList; | |
import javafx.scene.Group; | |
import javafx.scene.Node; | |
import javafx.scene.Scene; | |
import javafx.scene.chart.PieChart; | |
import javafx.scene.control.Label; | |
import javafx.scene.effect.Glow; | |
import javafx.scene.effect.Reflection; |