I tried again with py script.
I added some print code.
import pymc as pm
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import arviz as az
import aesara.tensor as at
from aesara.compile.ops import as_op
assert pm.__version__ == '4.0.0b6'
print("import right")
data = [0.05 + i for i in np.random.uniform(-0.05, 0.2, 1000)]
@as_op(itypes=[at.dscalar, at.dscalar], otypes=[at.dscalar])
def piecewise_timespan_label(back, forward):
td = forward - back
print(type(td))
if td >= 12:
return 1
elif td >= 8:
return 0.9
elif td >= 6:
return 0.8
elif td >= 4:
return 0.6
elif td >= 2:
return 0.4
elif td >= 1:
return 0.2
elif td >= 0.5:
return 0.1
elif td >= 0.05:
return 0.08
else:
return 0.05
print("data right")
with pm.Model() as model_deterministic:
back = pm.Exponential("back", 0.2)
forward = pm.Exponential("forward", 0.2)
print(type(forward))
ratio_est = piecewise_timespan_label(back, forward)
print(type(ratio_est))
eps = pm.HalfCauchy("eps", 0.5)
y = pm.Normal("y", ratio_est, sigma=eps, observed=data)
print("model right")
with model_deterministic:
idata = pm.sample(1000)
print('here')
then I use the python code python eda.py under my local path in my terminal.
Here is the output
Could not locate executable g77
Could not locate executable f77
Could not locate executable ifort
Could not locate executable ifl
Could not locate executable f90
Could not locate executable DF
Could not locate executable efl
Using built-in specs.
COLLECT_GCC=C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin\gfortran.exe
COLLECT_LTO_WRAPPER=c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/11.2.0/lto-wrapper.exe
OFFLOAD_TARGET_NAMES=nvptx-none
Target: x86_64-w64-mingw32
Configured with: ../configure --prefix=/R/winlibs64_stage/inst_gcc-11.2.0/share/gcc --build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --enable-offload-targets=nvptx-none --with-pkgversion='MinGW-W64 x86_64-posix-seh, built by Brecht Sanders' --with-tune=generic --enable-checking=release --enable-threads=posix --disable-sjlj-exceptions --disable-libunwind-exceptions --disable-serial-configure --disable-bootstrap --enable-host-shared --enable-plugin --disable-default-ssp
--disable-rpath --enable-libstdcxx-pch --enable-libstdcxx-time=yes --disable-libstdcxx-debug --disable-version-specific-runtime-libs --with-stabs --disable-symvers --enable-languages=c,c++,fortran,lto,objc,obj-c++,d,jit --disable-gold --disable-nls --disable-stage1-checking --disable-win32-registry --disable-multilib --enable-ld --enable-libquadmath --enable-libada --enable-libssp --enable-libstdcxx --enable-lto --enable-fully-dynamic-string --enable-libgomp --enable-graphite --enable-mingw-wildcard --with-mpc=/d/Prog/winlibs64_stage/custombuilt --with-mpfr=/d/Prog/winlibs64_stage/custombuilt --with-gmp=/d/Prog/winlibs64_stage/custombuilt --with-isl=/d/Prog/winlibs64_stage/custombuilt --enable-install-libiberty --enable-__cxa_atexit --without-included-gettext --with-diagnostics-color=auto --enable-clocale=generic --with-libiconv --with-system-zlib --with-build-sysroot=/R/winlibs64_stage/gcc-11.2.0/build_mingw/mingw-w64 CFLAGS=-I/d/Prog/winlibs64_stage/custombuilt/include/libdl-win32
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.2.0 (MinGW-W64 x86_64-posix-seh, built by Brecht Sanders)
WARNING (aesara.tensor.blas): Using NumPy C-API based implementation for BLAS functions.
import right
data right
<class 'aesara.tensor.var.TensorVariable'>
<class 'aesara.tensor.var.TensorVariable'>
model right
<class 'numpy.float64'>
Obviously the import ,data, model code run right.But when I need to inference the model.It broke out.