neuron-explorer
Qwen3.5‑4B 전용 조향형 뉴런 탐색기, 모든 MLP 뉴런을 밀어 결과를 보관·탐색
README 전체를 불러오는 중입니다. 아래는 저장된 발췌입니다.
bartorch makes BART, the Berkeley Advanced Reconstruction Toolbox, available in
Python on PyTorch tensors, in host memory or on a CUDA device. BART is compiled
into the package and runs in the Python process, so a reconstruction written in
Python uses BART's parallel imaging, compressed sensing, non-Cartesian and
model-based methods without writing files or calling an executable, and can be
placed inside a larger PyTorch computation such as the training of an unrolled
network.README 전문 보기 ↗bartorch puts BART, the Berkeley Advanced Reconstruction Toolbox, inside your
Python process. You hand it PyTorch tensors, on the CPU or on a CUDA device,
and BART works on them where they are: no .cfl files, no bart executable,
no subprocess. What comes back is a tensor, so a BART reconstruction can sit
inside any PyTorch code, including the training loop of an unrolled network.
You use BART in one of three ways, from the most ready-made to the most flexible:
bt.ecalib(kspace),
bt.phantom(128), bt.traj(...). If you know BART's command line, you
already know them.pics, moba, mobafit, POCSENSE) are
functions that take k-space and return an image.A = P F S or
anything else, compose it with @ and +, and solve it with one of BART's
iterations. This is where a reconstruction BART has no command for lives,
and it is differentiable.The three are the same library underneath: apps.pics is an encoding
operator and a solver, built for you.
(coils, z, y, x) holds the
same bytes as a BART array of dimensions [x, y, z, coils], so bartorch
reverses the shape and hands BART the tensor's memory. Nothing is copied.bartorch.BartError) with
BART's message, and your interpreter keeps running.import bartorch.tools as bt
kspace = bt.phantom(128, coils=8, kspace=True) # (coils, z, y, x)
compressed = bt.cc(kspace, p=4)
maps = bt.ecalib(compressed, maps=1)
bartorch.fft(x, axes=(-2, -1)).from bartorch import apps, priors
image = apps.pics(compressed, maps, regularizers=priors.Wavelet((-1, -2), 0.005))
bartorch.priors, not a -R
string; its axes are tensor axes.apps.pics gives the same bits as BART's pics command, and the
documentation's tests hold it to that.import torch
from bartorch import linop, optim, priors
A = linop.CartesianSense(maps, (128, 128), pattern) # A = P F S
image = optim.FISTA(priors.Wavelet((-1, -2), 0.005), maxiter=100)(kspace, A)
B = A @ linop.Diagonal(phase) # one more factor, still one BART operator
loss = (B(x) - kspace).abs().pow(2).sum()
loss.backward() # x.grad is 2 B^H (B x - y)
A(x) applies the operator, A.H(y) its adjoint, and A.H @ A its
normal. A composition is handed to BART as one operator, so a solver
iterating on it never comes back to Python.A.plan tells you how BART will run what you composed: which transform,
which factors were fused, and whether it fell back to a slower path.The bartorch command takes the same arguments as bart, so a script written
for BART runs with the name changed and no BART installation:
bartorch phantom -k -s 8 kspace
bartorch ecalib -m 1 kspace maps
bartorch pics -R W:3:0:0.005 kspace maps image
pip install bartorch
pip install "bartorch[cu12]" # with CUDA 12; use cu13 for CUDA 13
Wheels are built for Linux x86-64, macOS arm64 and Windows x86-64; the CUDA build is Linux x86-64 only. The other extras are listed under Optional dependencies, GPU builds under Installation, and source builds in the developer guide.
bartorch has no publication of its own. Please cite BART (Uecker et al., doi:10.5281/zenodo.592960) and the papers behind the methods you used (ESPIRiT, compressed sensing, nonlinear inversion, ...), and report the bartorch version. Contributors and citation lists the references.
MIT. The embedded BART (BSD-3-Clause), FINUFFT (Apache-2.0) and the other bundled code keep their own licenses; see License and third-party notices. bartorch is an independent project, not affiliated with or endorsed by the BART developers, the PyTorch Foundation or The Linux Foundation. The logo combines BART's mark with the PyTorch logo's flame; PyTorch, the PyTorch logo and any related marks are trademarks of The Linux Foundation.