uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
|
|
@ -0,0 +1,23 @@
|
|||
{lib, stdenv, fetchFromGitHub, cmake}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "fasttext";
|
||||
version = "0.9.2";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "facebookresearch";
|
||||
repo = "fastText";
|
||||
rev = "v${version}";
|
||||
sha256 = "07cz2ghfq6amcljaxpdr5chbd64ph513y8zqmibfx2xwfp74xkhn";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ cmake ];
|
||||
|
||||
meta = with lib; {
|
||||
description = "Library for text classification and representation learning";
|
||||
homepage = "https://fasttext.cc/";
|
||||
license = licenses.mit;
|
||||
platforms = platforms.unix;
|
||||
maintainers = [ ];
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
{ lib
|
||||
, stdenv
|
||||
, rustPlatform
|
||||
, fetchFromGitHub
|
||||
, installShellFiles
|
||||
, pkg-config
|
||||
, libiconv
|
||||
, openssl
|
||||
, Security
|
||||
}:
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "finalfrontier";
|
||||
version = "0.9.4";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "finalfusion";
|
||||
repo = pname;
|
||||
rev = version;
|
||||
sha256 = "1lvwv238p8hrl4sc5pmnvaargl2dd25p44gxl3kibq5ng03afd0n";
|
||||
};
|
||||
|
||||
cargoSha256 = "0lhcazcih48gc23q484h344bzz7p3lh189ljhswdyph2i11caarp";
|
||||
|
||||
nativeBuildInputs = [
|
||||
installShellFiles
|
||||
pkg-config
|
||||
];
|
||||
|
||||
buildInputs = [ openssl ] ++ lib.optionals stdenv.isDarwin [
|
||||
libiconv
|
||||
Security
|
||||
];
|
||||
|
||||
postInstall = ''
|
||||
installManPage man/*.1
|
||||
|
||||
# Install shell completions
|
||||
for shell in bash fish zsh; do
|
||||
$out/bin/finalfrontier completions $shell > finalfrontier.$shell
|
||||
done
|
||||
installShellCompletion finalfrontier.{bash,fish,zsh}
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Utility for training word and subword embeddings";
|
||||
homepage = "https://github.com/finalfusion/finalfrontier/";
|
||||
license = licenses.asl20;
|
||||
maintainers = with maintainers; [ ];
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
{ lib
|
||||
, stdenv
|
||||
, rustPlatform
|
||||
, fetchFromGitHub
|
||||
, installShellFiles
|
||||
, blas
|
||||
, gfortran
|
||||
, lapack
|
||||
, openssl
|
||||
, Security
|
||||
}:
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "finalfusion-utils";
|
||||
version = "0.14.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "finalfusion";
|
||||
repo = pname;
|
||||
rev = version;
|
||||
sha256 = "sha256-suzivynlgk4VvDOC2dQR40n5IJHoJ736+ObdrM9dIqE=";
|
||||
};
|
||||
|
||||
cargoSha256 = "sha256-HekjmctuzOWs5k/ihhsV8vVkm6906jEnFf3yvhkrA5Y=";
|
||||
|
||||
nativeBuildInputs = [ installShellFiles ];
|
||||
|
||||
buildInputs = [
|
||||
blas
|
||||
gfortran.cc.lib
|
||||
lapack
|
||||
openssl
|
||||
] ++ lib.optionals stdenv.isDarwin [
|
||||
Security
|
||||
];
|
||||
|
||||
# Enables build against a generic BLAS.
|
||||
buildFeatures = [ "netlib" ];
|
||||
|
||||
postInstall = ''
|
||||
# Install shell completions
|
||||
for shell in bash fish zsh; do
|
||||
$out/bin/finalfusion completions $shell > finalfusion.$shell
|
||||
done
|
||||
installShellCompletion finalfusion.{bash,fish,zsh}
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Utility for converting, quantizing, and querying word embeddings";
|
||||
homepage = "https://github.com/finalfusion/finalfusion-utils/";
|
||||
license = licenses.asl20;
|
||||
maintainers = with maintainers; [ ];
|
||||
mainProgram = "finalfusion";
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
{ lib, python3Packages, fetchFromGitHub, qt5 }:
|
||||
python3Packages.buildPythonApplication rec {
|
||||
pname = "labelImg";
|
||||
version = "1.8.3";
|
||||
src = fetchFromGitHub {
|
||||
owner = "tzutalin";
|
||||
repo = "labelImg";
|
||||
rev = "v${version}";
|
||||
sha256 = "07v106fzlmxrbag4xm06m4mx9m0gckb27vpwsn7sap1bbgc1pap5";
|
||||
};
|
||||
nativeBuildInputs = with python3Packages; [
|
||||
pyqt5
|
||||
qt5.wrapQtAppsHook
|
||||
];
|
||||
propagatedBuildInputs = with python3Packages; [
|
||||
pyqt5
|
||||
lxml
|
||||
sip_4
|
||||
];
|
||||
preBuild = ''
|
||||
make qt5py3
|
||||
'';
|
||||
postInstall = ''
|
||||
cp libs/resources.py $out/${python3Packages.python.sitePackages}/libs
|
||||
'';
|
||||
dontWrapQtApps = true;
|
||||
preFixup = ''
|
||||
makeWrapperArgs+=("''${qtWrapperArgs[@]}")
|
||||
'';
|
||||
meta = with lib; {
|
||||
description = "A graphical image annotation tool and label object bounding boxes in images";
|
||||
homepage = "https://github.com/tzutalin/labelImg";
|
||||
license = licenses.mit;
|
||||
platforms = platforms.linux;
|
||||
maintainers = [ maintainers.cmcdragonkai ];
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
{ lib, fetchFromGitHub, python3Packages }:
|
||||
|
||||
python3Packages.buildPythonPackage rec {
|
||||
pname = "nengo-gui";
|
||||
version = "0.4.8";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "nengo";
|
||||
repo = "nengo-gui";
|
||||
rev = "v${version}";
|
||||
sha256 = "1awb0h2l6yifb77zah7a4qzxqvkk4ac5fynangalidr10sk9rzk3";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = with python3Packages; [ nengo ];
|
||||
|
||||
# checks req missing:
|
||||
# pyimgur
|
||||
doCheck = false;
|
||||
|
||||
meta = with lib; {
|
||||
description = "Nengo interactive visualizer";
|
||||
homepage = "https://nengo.ai/";
|
||||
license = licenses.unfreeRedistributable;
|
||||
maintainers = with maintainers; [ arjix ];
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
{ config, stdenv
|
||||
, callPackage
|
||||
, lib
|
||||
, fetchurl
|
||||
, unzip
|
||||
, licenseAccepted ? config.sc2-headless.accept_license or false
|
||||
}:
|
||||
|
||||
if !licenseAccepted then throw ''
|
||||
You must accept the Blizzard® Starcraft® II AI and Machine Learning License at
|
||||
https://blzdistsc2-a.akamaihd.net/AI_AND_MACHINE_LEARNING_LICENSE.html
|
||||
by setting nixpkgs config option 'sc2-headless.accept_license = true;'
|
||||
''
|
||||
else assert licenseAccepted;
|
||||
let maps = callPackage ./maps.nix {};
|
||||
in stdenv.mkDerivation rec {
|
||||
version = "4.7.1";
|
||||
pname = "sc2-headless";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://blzdistsc2-a.akamaihd.net/Linux/SC2.${version}.zip";
|
||||
sha256 = "0q1ry9bd3dm8y4hvh57yfq7s05hl2k2sxi2wsl6h0r3w690v1kdd";
|
||||
};
|
||||
|
||||
unpackCmd = ''
|
||||
unzip -P 'iagreetotheeula' $curSrc
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [ unzip ];
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out
|
||||
cp -r . "$out"
|
||||
rm -r $out/Libs
|
||||
|
||||
cp -ur "${maps.minigames}"/* "${maps.melee}"/* "${maps.ladder2017season1}"/* "${maps.ladder2017season2}"/* "${maps.ladder2017season3}"/* \
|
||||
"${maps.ladder2017season4}"/* "${maps.ladder2018season1}"/* "${maps.ladder2018season2}"/* \
|
||||
"${maps.ladder2018season3}"/* "${maps.ladder2018season4}"/* "${maps.ladder2019season1}"/* "$out"/Maps/
|
||||
'';
|
||||
|
||||
preFixup = ''
|
||||
find $out -type f -print0 | while IFS=''' read -d ''' -r file; do
|
||||
isELF "$file" || continue
|
||||
patchelf \
|
||||
--interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
||||
--set-rpath ${lib.makeLibraryPath [stdenv.cc.cc stdenv.cc.libc]} \
|
||||
"$file"
|
||||
done
|
||||
'';
|
||||
|
||||
meta = {
|
||||
platforms = lib.platforms.linux;
|
||||
description = "Starcraft II headless linux client for machine learning research";
|
||||
license = {
|
||||
fullName = "BLIZZARD® STARCRAFT® II AI AND MACHINE LEARNING LICENSE";
|
||||
url = "https://blzdistsc2-a.akamaihd.net/AI_AND_MACHINE_LEARNING_LICENSE.html";
|
||||
free = false;
|
||||
};
|
||||
maintainers = with lib.maintainers; [ danharaj ];
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
{ fetchzip
|
||||
}:
|
||||
let
|
||||
fetchzip' = args: (fetchzip args).overrideAttrs (old: { UNZIP = "-j -P iagreetotheeula"; });
|
||||
in
|
||||
{
|
||||
minigames = fetchzip {
|
||||
url = "https://github.com/deepmind/pysc2/releases/download/v1.2/mini_games.zip";
|
||||
sha256 = "19f873ilcdsf50g2v0s2zzmxil1bqncsk8nq99bzy87h0i7khkla";
|
||||
stripRoot = false;
|
||||
};
|
||||
|
||||
melee = fetchzip' {
|
||||
url = "http://blzdistsc2-a.akamaihd.net/MapPacks/Melee.zip";
|
||||
sha256 = "0z44pgy10jklsvgpr0kcn4c2mz3hw7nlcmvsy6a6lzpi3dvzf33i";
|
||||
stripRoot = false;
|
||||
};
|
||||
ladder2017season1 = fetchzip' {
|
||||
url = "http://blzdistsc2-a.akamaihd.net/MapPacks/Ladder2017Season1.zip";
|
||||
sha256 = "0ngg4g74s2ryhylny93fm8yq9rlrhphwnjg2s6f3qr85a2b3zdpd";
|
||||
stripRoot = false;
|
||||
};
|
||||
ladder2017season2 = fetchzip' {
|
||||
url = "http://blzdistsc2-a.akamaihd.net/MapPacks/Ladder2017Season2.zip";
|
||||
sha256 = "01kycnvqagql9pkjkcgngfcnry2pc4kcygdkk511m0qr34909za5";
|
||||
stripRoot = false;
|
||||
};
|
||||
ladder2017season3 = fetchzip' {
|
||||
url = "http://blzdistsc2-a.akamaihd.net/MapPacks/Ladder2017Season3_Updated.zip";
|
||||
sha256 = "0wix3lwmbyxfgh8ldg0n66i21p0dbavk2dxjngz79rx708m8qvld";
|
||||
stripRoot = false;
|
||||
};
|
||||
ladder2017season4 = fetchzip' {
|
||||
url = "http://blzdistsc2-a.akamaihd.net/MapPacks/Ladder2017Season4.zip";
|
||||
sha256 = "1sidnmk2rc9j5fd3a4623pvaika1mm1rwhznb2qklsqsq1x2qckp";
|
||||
stripRoot = false;
|
||||
};
|
||||
ladder2018season1 = fetchzip' {
|
||||
url = "http://blzdistsc2-a.akamaihd.net/MapPacks/Ladder2018Season1.zip";
|
||||
sha256 = "0mp0ilcq0gmd7ahahc5i8c7bdr3ivk6skx0b2cgb1z89l5d76irq";
|
||||
stripRoot = false;
|
||||
};
|
||||
ladder2018season2 = fetchzip' {
|
||||
url = "http://blzdistsc2-a.akamaihd.net/MapPacks/Ladder2018Season2_Updated.zip";
|
||||
sha256 = "176rs848cx5src7qbr6dnn81bv1i86i381fidk3v81q9bxlmc2rv";
|
||||
stripRoot = false;
|
||||
};
|
||||
ladder2018season3 = fetchzip' {
|
||||
url = "http://blzdistsc2-a.akamaihd.net/MapPacks/Ladder2018Season3.zip";
|
||||
sha256 = "1r3wv4w53g9zq6073ajgv74prbdsd1x3zfpyhv1kpxbffyr0x0zp";
|
||||
stripRoot = false;
|
||||
};
|
||||
ladder2018season4 = fetchzip' {
|
||||
url = "http://blzdistsc2-a.akamaihd.net/MapPacks/Ladder2018Season4.zip";
|
||||
sha256 = "0k47rr6pzxbanlqnhliwywkvf0w04c8hxmbanksbz6aj5wpkcn1s";
|
||||
stripRoot = false;
|
||||
};
|
||||
ladder2019season1 = fetchzip' {
|
||||
url = "http://blzdistsc2-a.akamaihd.net/MapPacks/Ladder2019Season1.zip";
|
||||
sha256 = "1dlk9zza8h70lbjvg2ykc5wr9vsvvdk02szwrkgdw26mkssl2rg9";
|
||||
stripRoot = false;
|
||||
};
|
||||
}
|
||||
192
pkgs/applications/science/machine-learning/shogun/default.nix
Normal file
192
pkgs/applications/science/machine-learning/shogun/default.nix
Normal file
|
|
@ -0,0 +1,192 @@
|
|||
{ lib
|
||||
, stdenv
|
||||
, fetchFromGitHub
|
||||
, fetchpatch
|
||||
, fetchurl
|
||||
# build
|
||||
, cmake
|
||||
, ctags
|
||||
, python3Packages
|
||||
, swig
|
||||
# math
|
||||
, eigen
|
||||
, blas
|
||||
, lapack
|
||||
, glpk
|
||||
# data
|
||||
, protobuf
|
||||
, json_c
|
||||
, libxml2
|
||||
, hdf5
|
||||
, curl
|
||||
# compression
|
||||
, libarchive
|
||||
, bzip2
|
||||
, xz
|
||||
, snappy
|
||||
, lzo
|
||||
# more math
|
||||
, nlopt
|
||||
, lp_solve
|
||||
, colpack
|
||||
# extra support
|
||||
, pythonSupport ? false
|
||||
, opencvSupport ? false
|
||||
, opencv ? null
|
||||
, withSvmLight ? false
|
||||
}:
|
||||
|
||||
assert pythonSupport -> python3Packages != null;
|
||||
assert opencvSupport -> opencv != null;
|
||||
|
||||
assert (!blas.isILP64) && (!lapack.isILP64);
|
||||
|
||||
let
|
||||
pname = "shogun";
|
||||
version = "6.1.4";
|
||||
|
||||
rxcppVersion = "4.0.0";
|
||||
gtestVersion = "1.8.0";
|
||||
|
||||
srcs = {
|
||||
toolbox = fetchFromGitHub {
|
||||
owner = pname + "-toolbox";
|
||||
repo = pname;
|
||||
rev = pname + "_" + version;
|
||||
sha256 = "05s9dclmk7x5d7wnnj4qr6r6c827m72a44gizcv09lxr28pr9inz";
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
|
||||
# The CMake external projects expect the packed archives
|
||||
rxcpp = fetchurl {
|
||||
url = "https://github.com/Reactive-Extensions/RxCpp/archive/v${rxcppVersion}.tar.gz";
|
||||
sha256 = "0y2isr8dy2n1yjr9c5570kpc9lvdlch6jv0jvw000amwn5d3krsh";
|
||||
};
|
||||
gtest = fetchurl {
|
||||
url = "https://github.com/google/googletest/archive/release-${gtestVersion}.tar.gz";
|
||||
sha256 = "1n5p1m2m3fjrjdj752lf92f9wq3pl5cbsfrb49jqbg52ghkz99jq";
|
||||
};
|
||||
};
|
||||
in
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
inherit pname version;
|
||||
|
||||
outputs = [ "out" "dev" "doc" ];
|
||||
|
||||
src = srcs.toolbox;
|
||||
|
||||
patches = [
|
||||
# Fix compile errors with json-c
|
||||
# https://github.com/shogun-toolbox/shogun/pull/4104
|
||||
(fetchpatch {
|
||||
url = "https://github.com/shogun-toolbox/shogun/commit/365ce4c4c700736d2eec8ba6c975327a5ac2cd9b.patch";
|
||||
sha256 = "158hqv4xzw648pmjbwrhxjp7qcppqa7kvriif87gn3zdn711c49s";
|
||||
})
|
||||
|
||||
# Fix compile errors with GCC 9+
|
||||
# https://github.com/shogun-toolbox/shogun/pull/4811
|
||||
(fetchpatch {
|
||||
url = "https://github.com/shogun-toolbox/shogun/commit/c8b670be4790e0f06804b048a6f3d77c17c3ee95.patch";
|
||||
sha256 = "sha256-MxsR3Y2noFQevfqWK3nmX5iK4OVWeKBl5tfeDNgjcXk=";
|
||||
})
|
||||
(fetchpatch {
|
||||
url = "https://github.com/shogun-toolbox/shogun/commit/5aceefd9fb0e2132c354b9a0c0ceb9160cc9b2f7.patch";
|
||||
sha256 = "sha256-AgJJKQA8vc5oKaTQDqMdwBR4hT4sn9+uW0jLe7GteJw=";
|
||||
})
|
||||
|
||||
# Fix compile errors with Eigen 3.4
|
||||
./eigen-3.4.patch
|
||||
|
||||
] ++ lib.optional (!withSvmLight) ./svmlight-scrubber.patch;
|
||||
|
||||
nativeBuildInputs = [ cmake swig ctags ]
|
||||
++ (with python3Packages; [ python jinja2 ply ]);
|
||||
|
||||
buildInputs = [
|
||||
eigen
|
||||
blas
|
||||
lapack
|
||||
glpk
|
||||
protobuf
|
||||
json_c
|
||||
libxml2
|
||||
hdf5
|
||||
curl
|
||||
libarchive
|
||||
bzip2
|
||||
xz
|
||||
snappy
|
||||
lzo
|
||||
nlopt
|
||||
lp_solve
|
||||
colpack
|
||||
] ++ lib.optionals pythonSupport (with python3Packages; [ python numpy ])
|
||||
++ lib.optional opencvSupport opencv;
|
||||
|
||||
cmakeFlags = let
|
||||
enableIf = cond: if cond then "ON" else "OFF";
|
||||
in [
|
||||
"-DBUILD_META_EXAMPLES=ON"
|
||||
"-DCMAKE_DISABLE_FIND_PACKAGE_ARPACK=ON"
|
||||
"-DCMAKE_DISABLE_FIND_PACKAGE_ARPREC=ON"
|
||||
"-DCMAKE_DISABLE_FIND_PACKAGE_CPLEX=ON"
|
||||
"-DCMAKE_DISABLE_FIND_PACKAGE_Mosek=ON"
|
||||
"-DCMAKE_DISABLE_FIND_PACKAGE_TFLogger=ON"
|
||||
"-DCMAKE_DISABLE_FIND_PACKAGE_ViennaCL=ON"
|
||||
"-DCMAKE_SKIP_BUILD_RPATH=OFF"
|
||||
"-DCMAKE_CTEST_ARGUMENTS='--exclude-regex;TrainedModelSerialization'" # Sporadic segfault
|
||||
"-DENABLE_TESTING=${enableIf doCheck}"
|
||||
"-DDISABLE_META_INTEGRATION_TESTS=ON"
|
||||
"-DTRAVIS_DISABLE_META_CPP=ON"
|
||||
"-DINTERFACE_PYTHON=${enableIf pythonSupport}"
|
||||
"-DOpenCV=${enableIf opencvSupport}"
|
||||
"-DUSE_SVMLIGHT=${enableIf withSvmLight}"
|
||||
];
|
||||
|
||||
CXXFLAGS = "-faligned-new";
|
||||
|
||||
doCheck = true;
|
||||
|
||||
postUnpack = ''
|
||||
mkdir -p $sourceRoot/third_party/{rxcpp,GoogleMock}
|
||||
ln -s ${srcs.rxcpp} $sourceRoot/third_party/rxcpp/v${rxcppVersion}.tar.gz
|
||||
ln -s ${srcs.gtest} $sourceRoot/third_party/GoogleMock/release-${gtestVersion}.tar.gz
|
||||
'';
|
||||
|
||||
postPatch = ''
|
||||
# Fix preprocessing SVMlight code
|
||||
sed -i \
|
||||
-e 's@#ifdef SVMLIGHT@#ifdef USE_SVMLIGHT@' \
|
||||
-e '/^#ifdef USE_SVMLIGHT/,/^#endif/ s@#endif@#endif //USE_SVMLIGHT@' \
|
||||
src/shogun/kernel/string/CommUlongStringKernel.cpp
|
||||
sed -i -e 's/#if USE_SVMLIGHT/#ifdef USE_SVMLIGHT/' src/interfaces/swig/Machine.i
|
||||
sed -i -e 's@// USE_SVMLIGHT@//USE_SVMLIGHT@' src/interfaces/swig/Transfer.i
|
||||
sed -i -e 's@/\* USE_SVMLIGHT \*/@//USE_SVMLIGHT@' src/interfaces/swig/Transfer_includes.i
|
||||
'' + lib.optionalString (!withSvmLight) ''
|
||||
# Run SVMlight scrubber
|
||||
patchShebangs scripts/light-scrubber.sh
|
||||
echo "removing SVMlight code"
|
||||
./scripts/light-scrubber.sh
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
mkdir -p $doc/share/doc/shogun/examples
|
||||
mv $out/share/shogun/examples/cpp $doc/share/doc/shogun/examples
|
||||
cp ../examples/undocumented/libshogun/*.cpp $doc/share/doc/shogun/examples/cpp
|
||||
rm -r $out/share
|
||||
'';
|
||||
|
||||
postFixup = ''
|
||||
# CMake incorrectly calculates library path from dev prefix
|
||||
substituteInPlace $dev/lib/cmake/shogun/ShogunTargets-release.cmake \
|
||||
--replace "\''${_IMPORT_PREFIX}/lib/" "$out/lib/"
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "A toolbox which offers a wide range of efficient and unified machine learning methods";
|
||||
homepage = "http://shogun-toolbox.org/";
|
||||
license = if withSvmLight then licenses.unfree else licenses.gpl3Plus;
|
||||
maintainers = with maintainers; [ edwtjo smancill ];
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
From: Sebastián Mancilla <smancill@smancill.dev>
|
||||
Subject: [PATCH] Fix compile errors when using Eigen 3.4
|
||||
|
||||
---
|
||||
.../machine/gp/MultiLaplaceInferenceMethod.cpp | 18 +++++++++---------
|
||||
1 file changed, 9 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/src/shogun/machine/gp/MultiLaplaceInferenceMethod.cpp b/src/shogun/machine/gp/MultiLaplaceInferenceMethod.cpp
|
||||
index 2e27678d2..60050afea 100644
|
||||
--- a/src/shogun/machine/gp/MultiLaplaceInferenceMethod.cpp
|
||||
+++ b/src/shogun/machine/gp/MultiLaplaceInferenceMethod.cpp
|
||||
@@ -84,9 +84,9 @@ class CMultiPsiLine : public func_base
|
||||
float64_t result=0;
|
||||
for(index_t bl=0; bl<C; bl++)
|
||||
{
|
||||
- eigen_f.block(bl*n,0,n,1)=K*alpha->block(bl*n,0,n,1)*CMath::exp(log_scale*2.0);
|
||||
- result+=alpha->block(bl*n,0,n,1).dot(eigen_f.block(bl*n,0,n,1))/2.0;
|
||||
- eigen_f.block(bl*n,0,n,1)+=eigen_m;
|
||||
+ eigen_f.segment(bl*n,n)=K*alpha->segment(bl*n,n)*CMath::exp(log_scale*2.0);
|
||||
+ result+=alpha->segment(bl*n,n).dot(eigen_f.segment(bl*n,n))/2.0;
|
||||
+ eigen_f.segment(bl*n,n)+=eigen_m;
|
||||
}
|
||||
|
||||
// get first and second derivatives of log likelihood
|
||||
@@ -272,7 +272,7 @@ void CMultiLaplaceInferenceMethod::update_alpha()
|
||||
{
|
||||
Map<VectorXd> alpha(m_alpha.vector, m_alpha.vlen);
|
||||
for(index_t bl=0; bl<C; bl++)
|
||||
- eigen_mu.block(bl*n,0,n,1)=eigen_ktrtr*CMath::exp(m_log_scale*2.0)*alpha.block(bl*n,0,n,1);
|
||||
+ eigen_mu.segment(bl*n,n)=eigen_ktrtr*CMath::exp(m_log_scale*2.0)*alpha.segment(bl*n,n);
|
||||
|
||||
//alpha'*(f-m)/2.0
|
||||
Psi_New=alpha.dot(eigen_mu)/2.0;
|
||||
@@ -316,7 +316,7 @@ void CMultiLaplaceInferenceMethod::update_alpha()
|
||||
|
||||
for(index_t bl=0; bl<C; bl++)
|
||||
{
|
||||
- VectorXd eigen_sD=eigen_dpi.block(bl*n,0,n,1).cwiseSqrt();
|
||||
+ VectorXd eigen_sD=eigen_dpi.segment(bl*n,n).cwiseSqrt();
|
||||
LLT<MatrixXd> chol_tmp((eigen_sD*eigen_sD.transpose()).cwiseProduct(eigen_ktrtr*CMath::exp(m_log_scale*2.0))+
|
||||
MatrixXd::Identity(m_ktrtr.num_rows, m_ktrtr.num_cols));
|
||||
MatrixXd eigen_L_tmp=chol_tmp.matrixU();
|
||||
@@ -341,11 +341,11 @@ void CMultiLaplaceInferenceMethod::update_alpha()
|
||||
VectorXd tmp2=m_tmp.array().rowwise().sum();
|
||||
|
||||
for(index_t bl=0; bl<C; bl++)
|
||||
- eigen_b.block(bl*n,0,n,1)+=eigen_dpi.block(bl*n,0,n,1).cwiseProduct(eigen_mu.block(bl*n,0,n,1)-eigen_mean_bl-tmp2);
|
||||
+ eigen_b.segment(bl*n,n)+=eigen_dpi.segment(bl*n,n).cwiseProduct(eigen_mu.segment(bl*n,n)-eigen_mean_bl-tmp2);
|
||||
|
||||
Map<VectorXd> &eigen_c=eigen_W;
|
||||
for(index_t bl=0; bl<C; bl++)
|
||||
- eigen_c.block(bl*n,0,n,1)=eigen_E.block(0,bl*n,n,n)*(eigen_ktrtr*CMath::exp(m_log_scale*2.0)*eigen_b.block(bl*n,0,n,1));
|
||||
+ eigen_c.segment(bl*n,n)=eigen_E.block(0,bl*n,n,n)*(eigen_ktrtr*CMath::exp(m_log_scale*2.0)*eigen_b.segment(bl*n,n));
|
||||
|
||||
Map<MatrixXd> c_tmp(eigen_c.data(),n,C);
|
||||
|
||||
@@ -409,7 +409,7 @@ float64_t CMultiLaplaceInferenceMethod::get_derivative_helper(SGMatrix<float64_t
|
||||
{
|
||||
result+=((eigen_E.block(0,bl*n,n,n)-eigen_U.block(0,bl*n,n,n).transpose()*eigen_U.block(0,bl*n,n,n)).array()
|
||||
*eigen_dK.array()).sum();
|
||||
- result-=(eigen_dK*eigen_alpha.block(bl*n,0,n,1)).dot(eigen_alpha.block(bl*n,0,n,1));
|
||||
+ result-=(eigen_dK*eigen_alpha.segment(bl*n,n)).dot(eigen_alpha.segment(bl*n,n));
|
||||
}
|
||||
|
||||
return result/2.0;
|
||||
@@ -489,7 +489,7 @@ SGVector<float64_t> CMultiLaplaceInferenceMethod::get_derivative_wrt_mean(
|
||||
result[i]=0;
|
||||
//currently only compute the explicit term
|
||||
for(index_t bl=0; bl<C; bl++)
|
||||
- result[i]-=eigen_alpha.block(bl*n,0,n,1).dot(eigen_dmu);
|
||||
+ result[i]-=eigen_alpha.segment(bl*n,n).dot(eigen_dmu);
|
||||
}
|
||||
|
||||
return result;
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
From: Sebastián Mancilla <smancill@smancill.dev>
|
||||
Subject: Update SVMlight scrubber script
|
||||
|
||||
This requires previously fixing a few wrong preprocessor directives that
|
||||
are supposed to fence code using SVMlight.
|
||||
|
||||
- The script was too eager and removing *.light files in SVMlight format
|
||||
that are used by other tests. The code reading those files doesn't use
|
||||
any SVMlight code so it should be fine to keep it and run the tests.
|
||||
|
||||
- The Python test *domainadaptationsvm.py was not removed because of
|
||||
wrong globbing.
|
||||
|
||||
- Remove a couple of examples using SVMlight that were missed.
|
||||
|
||||
- The script is actually modifying (and breaking) itself because the
|
||||
grep for the USE_SVMLIGHT macro is too eager again and matches itself
|
||||
(and the version stored in upstream's Debian package control tarball
|
||||
is broken because of it). Just fix it by grepping for preprocessor
|
||||
directives only.
|
||||
|
||||
- No need to fix the Transfer_includes.i file in the script with a final
|
||||
%} when its preprocessor directives have been fixed.
|
||||
|
||||
- The Swig files were moved to a new directory at some point but the
|
||||
script was not updated accordingly.
|
||||
---
|
||||
scripts/light-scrubber.sh | 16 ++++++----------
|
||||
1 file changed, 6 insertions(+), 10 deletions(-)
|
||||
|
||||
diff a/scripts/light-scrubber.sh b/scripts/light-scrubber.sh
|
||||
--- a/scripts/light-scrubber.sh
|
||||
+++ b/scripts/light-scrubber.sh
|
||||
@@ -26,14 +26,16 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
-rm -rf examples/*/*/{*light*,*_domainadaptationsvm_*} \
|
||||
+rm -rf examples/*/*/{*light*.*,*domainadaptationsvm*} \
|
||||
examples/undocumented/matlab_and_octave/tests/*light* \
|
||||
+ examples/undocumented/python/serialization_string_kernels.py \
|
||||
+ examples/undocumented/python/mkl_binclass.py \
|
||||
src/shogun/classifier/svm/SVMLight.* \
|
||||
src/shogun/classifier/svm/SVMLightOneClass.* \
|
||||
src/shogun/regression/svr/SVRLight.* \
|
||||
doc/md/LICENSE_SVMlight*
|
||||
|
||||
-for _file in `grep -rl USE_SVMLIGHT .`
|
||||
+grep -rl '^#ifdef USE_SVMLIGHT' . | while read -r _file
|
||||
do
|
||||
sed -i.orig -e \
|
||||
'/\#ifdef USE_SVMLIGHT/,/\#endif \/\/USE_SVMLIGHT/c \\' ${_file} && \
|
||||
@@ -41,7 +43,7 @@ do
|
||||
rm -rf ${_file}.orig
|
||||
done
|
||||
|
||||
-for _file in `find . -depth -name 'CMakeLists.txt'`
|
||||
+find . -depth -name 'CMakeLists.txt' | while read -r _file
|
||||
do
|
||||
sed -i.orig -e 's!.*_sv[mr]light_.*!!g' ${_file} && \
|
||||
touch -r ${_file}.orig ${_file} && \
|
||||
@@ -56,13 +58,7 @@ do
|
||||
rm -rf ${_file}.orig
|
||||
done
|
||||
|
||||
-_file="src/interfaces/modular/Transfer_includes.i" && \
|
||||
-cp -a ${_file} ${_file}.orig && \
|
||||
-echo '%}' >> ${_file} && \
|
||||
-touch -r ${_file}.orig ${_file} && \
|
||||
-rm -rf ${_file}.orig
|
||||
-
|
||||
-_file="src/interfaces/modular/Machine.i" && \
|
||||
+_file="src/interfaces/swig/Machine.i" && \
|
||||
sed -i.orig -e '/.*CSVRLight.*/d' ${_file} && \
|
||||
touch -r ${_file}.orig ${_file} && \
|
||||
rm -rf ${_file}.orig
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
{ lib, stdenv, fetchFromGitHub, boost165, zlib }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "starspace";
|
||||
version = "unstable-2021-01-17";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "facebookresearch";
|
||||
repo = pname;
|
||||
rev = "8aee0a950aa607c023e5c91cff518bec335b5df5";
|
||||
sha256 = "0sc7a37z1skb9377a1qs8ggwrkz0nmpybx7sms38xj05b702kbvj";
|
||||
};
|
||||
|
||||
buildInputs = [ boost165 zlib ];
|
||||
|
||||
makeFlags = [
|
||||
"CXX=${stdenv.cc.targetPrefix}c++"
|
||||
"BOOST_DIR=${boost165.dev}/include"
|
||||
];
|
||||
|
||||
preBuild = ''
|
||||
cp makefile_compress makefile
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
mv starspace $out/bin
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "General-purpose neural model for efficient learning of entity embeddings";
|
||||
homepage = "https://ai.facebook.com/tools/starspace/";
|
||||
license = licenses.mit;
|
||||
platforms = platforms.unix;
|
||||
maintainers = [ maintainers.mausch ];
|
||||
};
|
||||
}
|
||||
89
pkgs/applications/science/machine-learning/streamlit/default.nix
Executable file
89
pkgs/applications/science/machine-learning/streamlit/default.nix
Executable file
|
|
@ -0,0 +1,89 @@
|
|||
{
|
||||
# Nix
|
||||
lib,
|
||||
buildPythonApplication,
|
||||
fetchPypi,
|
||||
|
||||
# Build inputs
|
||||
altair,
|
||||
astor,
|
||||
base58,
|
||||
blinker,
|
||||
boto3,
|
||||
botocore,
|
||||
click,
|
||||
cachetools,
|
||||
enum-compat,
|
||||
future,
|
||||
GitPython,
|
||||
jinja2,
|
||||
pillow,
|
||||
pyarrow,
|
||||
pydeck,
|
||||
pympler,
|
||||
protobuf,
|
||||
requests,
|
||||
setuptools,
|
||||
toml,
|
||||
tornado,
|
||||
tzlocal,
|
||||
validators,
|
||||
watchdog,
|
||||
}:
|
||||
|
||||
let
|
||||
click_7 = click.overridePythonAttrs(old: rec {
|
||||
version = "7.1.2";
|
||||
src = old.src.override {
|
||||
inherit version;
|
||||
sha256 = "d2b5255c7c6349bc1bd1e59e08cd12acbbd63ce649f2588755783aa94dfb6b1a";
|
||||
};
|
||||
});
|
||||
in buildPythonApplication rec {
|
||||
pname = "streamlit";
|
||||
version = "1.2.0";
|
||||
format = "wheel"; # the only distribution available
|
||||
|
||||
src = fetchPypi {
|
||||
inherit pname version format;
|
||||
sha256 = "1dzb68a8n8wvjppcmqdaqnh925b2dg6rywv51ac9q09zjxb6z11n";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = [
|
||||
altair
|
||||
astor
|
||||
base58
|
||||
blinker
|
||||
boto3
|
||||
botocore
|
||||
cachetools
|
||||
click_7
|
||||
enum-compat
|
||||
future
|
||||
GitPython
|
||||
jinja2
|
||||
pillow
|
||||
protobuf
|
||||
pyarrow
|
||||
pydeck
|
||||
pympler
|
||||
requests
|
||||
setuptools
|
||||
toml
|
||||
tornado
|
||||
tzlocal
|
||||
validators
|
||||
watchdog
|
||||
];
|
||||
|
||||
postInstall = ''
|
||||
rm $out/bin/streamlit.cmd # remove windows helper
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://streamlit.io/";
|
||||
description = "The fastest way to build custom ML tools";
|
||||
maintainers = with maintainers; [ yrashk ];
|
||||
license = licenses.asl20;
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
{ lib, stdenv, fetchFromGitHub, cmake, boost, flatbuffers, rapidjson, spdlog, zlib }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "vowpal-wabbit";
|
||||
version = "9.0.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "VowpalWabbit";
|
||||
repo = "vowpal_wabbit";
|
||||
rev = version;
|
||||
sha256 = "sha256-ZUurY2bmTKKIW4GR4oiIpLxb6DSRUNJI/EyNSOu9D9c=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ cmake ];
|
||||
|
||||
buildInputs = [
|
||||
boost
|
||||
flatbuffers
|
||||
rapidjson
|
||||
spdlog
|
||||
zlib
|
||||
];
|
||||
|
||||
# -DBUILD_TESTS=OFF is set as both it saves time in the build and the default
|
||||
# cmake flags appended by the builder include -DBUILD_TESTING=OFF for which
|
||||
# this is the equivalent flag.
|
||||
# Flatbuffers are an optional feature.
|
||||
# BUILD_FLATBUFFERS=ON turns it on. This will still consume Flatbuffers as a
|
||||
# system dependency
|
||||
cmakeFlags = [
|
||||
"-DVW_INSTALL=ON"
|
||||
"-DBUILD_TESTS=OFF"
|
||||
"-DBUILD_JAVA=OFF"
|
||||
"-DBUILD_PYTHON=OFF"
|
||||
"-DUSE_LATEST_STD=ON"
|
||||
"-DRAPIDJSON_SYS_DEP=ON"
|
||||
"-DFMT_SYS_DEP=ON"
|
||||
"-DSPDLOG_SYS_DEP=ON"
|
||||
"-DBUILD_FLATBUFFERS=ON"
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
description = "Machine learning system focused on online reinforcement learning";
|
||||
homepage = "https://github.com/VowpalWabbit/vowpal_wabbit/";
|
||||
license = licenses.bsd3;
|
||||
longDescription = ''
|
||||
Machine learning system which pushes the frontier of machine learning with techniques such as online,
|
||||
hashing, allreduce, reductions, learning2search, active, and interactive and reinforcement learning
|
||||
'';
|
||||
maintainers = with maintainers; [ jackgerrits ];
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue