- Projet: "Recenser les actions pour les migrants en france"
- Lieu: Bourget du lac
-PHP
-JavaScript
-Bash
-Python
-Perl
import os | |
import sys | |
import psutil | |
import inspect | |
import time | |
from pathlib import Path | |
import h5py as hp | |
import anndata as ad | |
from anndata.experimental import sparse_dataset |
name: base | |
channels: | |
- bioconda | |
- conda-forge | |
- defaults | |
dependencies: | |
- _libgcc_mutex=0.1 | |
- backcall=0.2.0 | |
- backports=1.0 | |
- backports.functools_lru_cache=1.6.1 |
#!/bin/python3 | |
# 2 Partition problem | |
# input: n integers 1 <= i <= n | |
# question: can we split those ingers into two sets, such that we minimize the difference between the sums ? | |
# | |
# Using branch & bound | |
#def branch() | |
#def lower_bound() |
lambda = [100, 10, 1, .1, .01, .001]; | |
wx = zeros(length(lambda),Y-1); | |
figure; | |
for i = 1:length(lambda) | |
% signature : SoftSVM_SGD(D, T, lambda, n) | |
[w, his, bis] = SoftSVM_SGD(D, 200, lambda(i), 1); | |
wx(i,:) = w; | |
% plotting | |
subplot(floor(length(lambda)/3),3,i); | |
set(gca, 'YScale', 'log'); |
% Zebra enigma inspiration | |
:- op(100, xfy, on). | |
X on List :- member(X, List). | |
% Across / Beside | |
% We imagine people disposed on the table in the order 1, 2 | 3, 4 and not 1, 3 | 2, 4 | |
% We define indexof function (for some odd reason nth0/3 didn't worked) | |
% indexof(_Element, _Index, _List). | |
indexof(E, 0, L) :- L = [E | _]. % if E is first element of List : 0 | |
indexof(E, N1, [_ | R]) :- indexof(E, N, R), N1 is N+1. % else increment |
/* intersect predicate */ | |
intersect([], L2). % empty list matches | |
intersect([HL1 | RL1], L2) :- member(HL1, L2) ; % if heads of L1 member of L2 | |
RL1 = [_], intersect(RL1, L2). % or if any character of L1 (we recursively send the rest, and the head will be read each time). | |
% RL1 must be nonempty so it don't maches base case. RL1 = [_] ie. list isn't empty | |
/* all_intersect predicate */ | |
all_intersect([], L2). % empty list matches | |
all_intersect([HL1 | RL1], L2) :- intersect(HL1, L2), % we try intersect on the head | |
all_intersect(RL1, L2). % and we call recursively on the tail |
/* Base predicates */ | |
on(b1, b2). | |
on(b3, b4). | |
on(b4, b5). | |
on(b5, b6). | |
just_left(b2, b6). | |
just_left(b6, b7). | |
/* above predicate */ | |
above(X, Y) :- on(X, Y) ; /* X is above Y if directly on it*/ |