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
{- | |
https://twitter.com/andrejbauer/status/1358357606536986624 | |
Today's exercise in constructive math: characterize the maximal | |
elements of Plotkin's domain T^ω := {(A,B) ∈ P(ℕ) × P(ℕ) | A ∩ B = ∅}, | |
ordered by pairwise ⊆. Coq definitions are in the picture. | |
Hint: they are *not* just those that satisfy A ∪ B = ℕ. | |
-} | |
module Tomega where |
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
{-# OPTIONS_GHC -Wall #-} | |
module OptimalTransport (computeOptimalTransport) where | |
import qualified Data.Vector.Generic as VG | |
import Numeric.LinearAlgebra ((<.>), (#>), (<#), (><)) | |
import qualified Numeric.LinearAlgebra as LA | |
-- | Solve entropy regularized optimal transport problem: | |
-- | |
-- \[ |
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
{-# LANGUAGE ConstraintKinds #-} | |
{-# LANGUAGE QuantifiedConstraints #-} | |
data Rose f a = Branch a (f (Rose f a)) | |
type Eq1 f = (forall b. Eq b => Eq (f b)) | |
{- | |
ng.hs:6:33: error: | |
• Expected a type, but ‘Eq (f b)’ has kind ‘Constraint’ | |
• In the type ‘(forall b. Eq b => Eq (f b))’ |
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
{-# OPTIONS_GHC -Wall #-} | |
{-# LANGUAGE BangPatterns #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
-- translated from https://github.com/chokkan/liblbfgs | |
module LineSearch | |
( Params (..) | |
, defaultParams | |
, lineSearch | |
, lineSearchMoreThuente | |
) where |
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
require 'win32ole' | |
ex = WIN32OLE.new("Excel.Application") | |
fso = WIN32OLE.new("Scripting.FileSystemObject") | |
files = ["Book1.xlsx", "Book2.xlsx"] | |
book = ex.Workbooks.Add | |
files.each { |file| | |
file = fso.GetAbsolutePathName(file) |
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 Pyro4 | |
import inspect | |
@Pyro4.expose | |
class C: | |
def m(self): | |
return 0 | |
print(Pyro4.util.get_exposed_members(C())) | |
# => {'methods': set(), 'oneway': set(), 'attrs': set()} |
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 argparse | |
import numpy | |
import torch | |
from torch import nn | |
import torch.nn.functional as F | |
import ignite | |
import chainer | |
from chainer import training |
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
#!/usr/bin/env python | |
import argparse | |
import torch | |
from torch import nn | |
import torch.nn.functional as F | |
import ignite | |
import chainer | |
from chainer import reporter |