Catalog PyPI
PACKAGE EXPLORERView in registry

ace-nn

PyPI

Alternating Conditional Exceptation with Neural Network

Versions collected1
Direct dependencies0From release 0.2
Last observed20 Oct, 18:09 UTC

README

Version 0.2 documentation

ace_nn

Build Status

Introduction

This repo contains experimental implementation of ace algorithm via neural network. It is shown by xiangxiang-xu that calculating optimal features by Alternating Conditional Expectation is equivalent to maximize H-score.

How to run

Three examples are provided ( one for continuous variable and the other twos are for discrete variable) and their results are the same as ace. The main function is ace_nn and its parameters are very similar to ace_cream.

import numpy as np
from ace_nn import ace_nn
# discrete case, binary symmetric channel with crossover probability 0.1
N_SIZE = 1000
x = np.random.choice([0,1], size=N_SIZE)
n = np.random.choice([0,1], size=N_SIZE, p=[0.9, 0.1])
y = np.mod(x + n, 2)
# set both x(cat=0) and y(cat=-1) as categorical type
tx, ty = ace_nn(x, y, cat=[-1,0], epochs=100)

# continuous case
x = np.random.uniform(0, np.pi, 200)
y = np.exp(np.sin(x)+np.random.normal(size=200)/2)
tx, ty = ace_nn(x, y)

For more detail, run help(ace_nn) to see the parameters and returns of this function.

Further discussion

Currently, the neural networks used to approximate optimal $f(x)$ and $g(y)$ are two-layer MLP with tanh as activation function. More turns of epochs are needed for large alphabet $|\mathcal{X}|$ and $|\mathcal{Y}|$ and the running time is not short.

Also, batch_size and hidden_units_num can be hypertuned, and there is no guarantee that current configuration of neural network is optimal for solving ace.

Application

we can use ace_nn(x, y, return_hscore = True) to calculate a lower bound of $\frac{\norm{B}_F^2}{2}$

Downloads & popularity

2downloads
1-day window · source-reported counts20 Oct 2026
1890
2026-07-23: 1 · observed 2026-10-21T10:55:55.9861399Z · period 2026-07-23–2026-07-232026-07-24: 1 · observed 2026-10-21T10:55:55.9861399Z · period 2026-07-24–2026-07-242026-07-27: 3 · observed 2026-10-21T10:55:55.9861399Z · period 2026-07-27–2026-07-272026-07-28: 1 · observed 2026-10-21T10:55:55.9861399Z · period 2026-07-28–2026-07-282026-08-01: 1 · observed 2026-10-21T10:55:55.9861399Z · period 2026-08-01–2026-08-012026-08-02: 1 · observed 2026-10-21T10:55:55.9861399Z · period 2026-08-02–2026-08-022026-08-03: 4 · observed 2026-10-21T10:55:55.9861399Z · period 2026-08-03–2026-08-032026-08-04: 2 · observed 2026-10-21T10:55:55.9861399Z · period 2026-08-04–2026-08-042026-08-07: 1 · observed 2026-10-21T10:55:55.9861399Z · period 2026-08-07–2026-08-072026-08-09: 2 · observed 2026-10-21T10:55:55.9861399Z · period 2026-08-09–2026-08-092026-08-14: 3 · observed 2026-10-21T10:55:55.9861399Z · period 2026-08-14–2026-08-142026-08-17: 3 · observed 2026-10-21T10:55:55.9861399Z · period 2026-08-17–2026-08-172026-08-18: 18 · observed 2026-10-21T10:55:55.9861399Z · period 2026-08-18–2026-08-182026-08-19: 1 · observed 2026-10-21T10:55:55.9861399Z · period 2026-08-19–2026-08-192026-08-20: 1 · observed 2026-10-21T10:55:55.9861399Z · period 2026-08-20–2026-08-202026-08-24: 1 · observed 2026-10-21T10:55:55.9861399Z · period 2026-08-24–2026-08-242026-08-28: 2 · observed 2026-10-21T10:55:55.9861399Z · period 2026-08-28–2026-08-282026-08-31: 2 · observed 2026-10-21T10:55:55.9861399Z · period 2026-08-31–2026-08-312026-09-03: 1 · observed 2026-10-21T10:55:55.9861399Z · period 2026-09-03–2026-09-032026-09-06: 2 · observed 2026-10-21T10:55:55.9861399Z · period 2026-09-06–2026-09-062026-09-08: 2 · observed 2026-10-21T10:55:55.9861399Z · period 2026-09-08–2026-09-082026-09-09: 2 · observed 2026-10-21T10:55:55.9861399Z · period 2026-09-09–2026-09-092026-09-10: 1 · observed 2026-10-21T10:55:55.9861399Z · period 2026-09-10–2026-09-102026-09-12: 1 · observed 2026-10-21T10:55:55.9861399Z · period 2026-09-12–2026-09-122026-09-14: 2 · observed 2026-10-21T10:55:55.9861399Z · period 2026-09-14–2026-09-142026-09-24: 3 · observed 2026-10-21T10:55:55.9861399Z · period 2026-09-24–2026-09-242026-09-26: 3 · observed 2026-10-21T10:55:55.9861399Z · period 2026-09-26–2026-09-262026-09-27: 1 · observed 2026-10-21T10:55:55.9861399Z · period 2026-09-27–2026-09-272026-09-30: 4 · observed 2026-10-21T10:55:55.9861399Z · period 2026-09-30–2026-09-302026-10-06: 1 · observed 2026-10-21T10:55:55.9861399Z · period 2026-10-06–2026-10-062026-10-09: 2 · observed 2026-10-21T10:55:55.9861399Z · period 2026-10-09–2026-10-092026-10-10: 4 · observed 2026-10-21T10:55:55.9861399Z · period 2026-10-10–2026-10-102026-10-11: 2 · observed 2026-10-21T10:55:55.9861399Z · period 2026-10-11–2026-10-112026-10-13: 4 · observed 2026-10-21T10:55:55.9861399Z · period 2026-10-13–2026-10-132026-10-18: 1 · observed 2026-10-21T10:55:55.9861399Z · period 2026-10-18–2026-10-182026-10-19: 2 · observed 2026-10-21T10:55:55.9861399Z · period 2026-10-19–2026-10-192026-10-20: 2 · observed 2026-10-21T10:55:55.9861399Z · period 2026-10-20–2026-10-20
23 Jul20 Oct

pypistats · 37 observations shown. Missing days are unknown. Source category: overall: without mirrors.

View observed values
Date / source periodValueObserved at
2026-10-20 – 2026-10-2022026-10-21T10:55:55.9861399Z
2026-10-19 – 2026-10-1922026-10-21T10:55:55.9861399Z
2026-10-18 – 2026-10-1812026-10-21T10:55:55.9861399Z
2026-10-13 – 2026-10-1342026-10-21T10:55:55.9861399Z
2026-10-11 – 2026-10-1122026-10-21T10:55:55.9861399Z
2026-10-10 – 2026-10-1042026-10-21T10:55:55.9861399Z
2026-10-09 – 2026-10-0922026-10-21T10:55:55.9861399Z
2026-10-06 – 2026-10-0612026-10-21T10:55:55.9861399Z
2026-09-30 – 2026-09-3042026-10-21T10:55:55.9861399Z
2026-09-27 – 2026-09-2712026-10-21T10:55:55.9861399Z
2026-09-26 – 2026-09-2632026-10-21T10:55:55.9861399Z
2026-09-24 – 2026-09-2432026-10-21T10:55:55.9861399Z
2026-09-14 – 2026-09-1422026-10-21T10:55:55.9861399Z
2026-09-12 – 2026-09-1212026-10-21T10:55:55.9861399Z
2026-09-10 – 2026-09-1012026-10-21T10:55:55.9861399Z
2026-09-09 – 2026-09-0922026-10-21T10:55:55.9861399Z
2026-09-08 – 2026-09-0822026-10-21T10:55:55.9861399Z
2026-09-06 – 2026-09-0622026-10-21T10:55:55.9861399Z
2026-09-03 – 2026-09-0312026-10-21T10:55:55.9861399Z
2026-08-31 – 2026-08-3122026-10-21T10:55:55.9861399Z
2026-08-28 – 2026-08-2822026-10-21T10:55:55.9861399Z
2026-08-24 – 2026-08-2412026-10-21T10:55:55.9861399Z
2026-08-20 – 2026-08-2012026-10-21T10:55:55.9861399Z
2026-08-19 – 2026-08-1912026-10-21T10:55:55.9861399Z
2026-08-18 – 2026-08-18182026-10-21T10:55:55.9861399Z
2026-08-17 – 2026-08-1732026-10-21T10:55:55.9861399Z
2026-08-14 – 2026-08-1432026-10-21T10:55:55.9861399Z
2026-08-09 – 2026-08-0922026-10-21T10:55:55.9861399Z
2026-08-07 – 2026-08-0712026-10-21T10:55:55.9861399Z
2026-08-04 – 2026-08-0422026-10-21T10:55:55.9861399Z
2026-08-03 – 2026-08-0342026-10-21T10:55:55.9861399Z
2026-08-02 – 2026-08-0212026-10-21T10:55:55.9861399Z
2026-08-01 – 2026-08-0112026-10-21T10:55:55.9861399Z
2026-07-28 – 2026-07-2812026-10-21T10:55:55.9861399Z
2026-07-27 – 2026-07-2732026-10-21T10:55:55.9861399Z
2026-07-24 – 2026-07-2412026-10-21T10:55:55.9861399Z
2026-07-23 – 2026-07-2312026-10-21T10:55:55.9861399Z

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
0.21 Mar 20190

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
zhaofeng-shu33/ace_nn

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 18:09 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:2871bed55ce7bc030cfe49c19c530ad3aaea3890f4a303c7ffe334e280dd5596