AI Decision System
Replayable, offline-verifiable records for AI-assisted go/no-go decisions: experiment promotions, typed model answers and human-approved actions.
翻譯準備中
個人 GitHub 帳號下公開儲存庫的擁有者可以登入並驗證所有權,自行管理介紹,無需管理員核准。
登入並產生驗證檔案,在 30 分鐘內將其提交至此儲存庫的預設分支。其他分支或分叉儲存庫中的檔案無效。然後在下方檢查檔案,即可無需管理員核准直接管理專案。請保留檔案以維持管理權限。
如需登入,將前往登入頁面。登入後請回到此處,再次點擊所選的驗證按鈕。
在專案資料夾中執行 /nomorevibe verify,即可驗證所有權並自行管理介紹。
一分鐘完成驗證barry: Your go-to motif accountant
翻譯準備中
取自儲存庫 README
正在載入完整 README。
檢視完整 README ↗This repository contains a C++ template library that essentially counts sufficient statistics on binary arrays. Its primary goal is to provide a general framework for building discrete exponential-family models. A particular example is Exponential Random Graph Models (ERGMs), but we can use barry to deal with non-square arrays.
Among the key features included in barry, we have:
To use barry, you can either download the entire repository or, since it is header-only, the single header version barry.hpp.
This library was created and maintained by Dr. George G. Vega Yon as part of his doctoral dissertation "Essays on Bioinformatics and Social Network Analysis: Statistical and Computational Methods for Complex Systems."
In the following code we create an array of size 5x5 of class Network
(available in the namespace netcounters), add/remove ties, print the
graph, and count common statistics used in ERGMs:
#include <iostream>
#include <ostream>
#include "../include/barry.hpp"
typedef std::vector< unsigned int > vuint;
int main() {
// Creating network of size six with five ties
netcounters::Network net(
6, 6,
{0, 0, 4, 4, 2, 0, 1},
{1, 2, 0, 2, 4, 0, 1}
);
// How does this looks like?
net.print("Current view");
// Adding extra ties
net += {1, 0};
net(2, 0) = true;
// And removing a couple
net(0, 0) = false;
net -= {1, 1};
net.print("New view");
// Initializing the data. The program deals with freing the memory
net.set_data(new netcounters::NetworkData, true);
// Creating counter object for the network and adding stats to count
netcounters::NetStatsCounter counter(&net);
netcounters::counter_edges(counter.get_counters());
netcounters::counter_ttriads(counter.get_counters());
netcounters::counter_isolates(counter.get_counters());
netcounters::counter_ctriads(counter.get_counters());
netcounters::counter_mutual(counter.get_counters());
// Counting and printing the results
std::vector< double > counts = counter.count_all();
std::cout <<
"Edges : " << counts[0] << std::endl <<
"Transitive triads : " << counts[1] << std::endl <<
"Isolates : " << counts[2] << std::endl <<
"C triads : " << counts[3] << std::endl <<
"Mutuals : " << counts[4] << std::endl;
return 0;
}
Compiling this program using g++
g++ -std=c++11 -Wall -pedantic 08-counts.cpp -o counts && ./counts
Yields the following output:
Current view
[ 0,] 1 1 1 . . .
[ 1,] . 1 . . . .
[ 2,] . . . . 1 .
[ 3,] . . . . . .
[ 4,] 1 . 1 . . .
[ 5,] . . . . . .
New view
[ 0,] . 1 1 . . .
[ 1,] 1 . . . . .
[ 2,] 1 . . . 1 .
[ 3,] . . . . . .
[ 4,] 1 . 1 . . .
[ 5,] . . . . . .
Edges : 7
Transitive triads : 3
Isolates : 2
C triads : 1
Mutuals : 3
The project includes a Makefile with various build targets. To see all available options, run:
make help
This will display all available targets including:
tests - Build and run tests with OpenMPtest-portable - Build and run tests without OpenMP (cross-platform)coverage - Run tests with coverage analysisdocs - Generate documentationThe default target is help, so running make without arguments will show the available options.
One of the key features of barry is that it will handle memory efficiently. In the case of pooled-data models, the module for statistical models avoids double-counting support when possible by keeping track of what datasets (networks, for instance) share the same.
The documentation website, with implementation notes and the API reference,
is at https://uscbiostats.github.io/barry. It is built with
MkDocs and mkdoxy
from the files in docs/ and the Doxygen comments in the headers
(run make docs or make preview to build it locally).
The math behind the exact log-likelihood, its gradient, and its Hessian, and how barry computes them, is described in doc/likelihood-derivatives.md.
Please note that the barry project is released with a
Contributor Code of Conduct.
By contributing to this project, you agree to abide by its terms.