Open marcchale opened 3 years ago
Hi @marcchale,
Can you please give me more details of what integer you wanted to change? Remember that if the integer is inside a library we can't modify the package unless you have the package on a development setting.
@steff456 Greetings and thank you for reaching out. I opened an object of "multi-trace" class from a library called pymc3. https://docs.pymc.io/api/inference.html#pymc3.backends.base.MultiTrace. I was just exploring some results prior to plotting. I tried changing the value for attribute "chain" which is just a label for an array inside the object.
To clarify, the multitrace object is the output of the library (normal use). I was not editing the library itself. Best Marc
Please post the code you used to create that object, so we can try to reproduce your problem in our side.
@ccordoba12 @steff456 I was able to recreate the error by running the following code (adapted from pymc3 documentation) then opening the variable trace from the variable explorer, then clicking on "chains", clicking on "1" and trying to change the value to another number. You may need to install a few libraries (sorry)
"""
Created on Mon Apr 5 14:49:05 2021
@author: mchale
"""
#%% Import things
import sys
import warnings
import os
os.chdir('C:/Users/mchale/OneDrive/AFIT/Research/Mini-Prospectus/GAN Code/gml-cyber/gml-cyber-master') # Change current working directory
print('WD Updated to', str(os.getcwd()))
# Useful libraries
import pymc3 as pm
import numpy as np
import matplotlib.pyplot as plt
from theano.tensor.nlinalg import matrix_inverse
from ellipse import plot_ellipse
from print_summary import print_summary
import importKDD
import seaborn as sb
sb.set()
import pickle # python3
import arviz as az
import math
import pandas as pd
from sklearn import preprocessing
import time
import plotly.express as px
import seaborn as sns
from ipywidgets import widgets
from pyDOE2 import *
import warnings
#%% Create Some data in 2D
# True parameter values
alpha, sigma = 1, 1
beta = [1, 2.5]
# Size of dataset
size = 100
# Predictor variable
X1 = np.random.randn(size)
X2 = np.random.randn(size) * 0.2
# Simulate outcome variable
Y = alpha + beta[0] * X1 + beta[1] * X2 + np.random.randn(size) * sigma
#%% Setup Pymc3 model
#%config InlineBackend.figure_format = 'retina'
# Initialize random number generator
RANDOM_SEED = 8927
np.random.seed(RANDOM_SEED)
az.style.use("arviz-darkgrid")
print(f"Running on PyMC3 v{pm.__version__}")
basic_model = pm.Model()
with basic_model:
# Priors for unknown model parameters
alpha = pm.Normal("alpha", mu=0, sigma=10)
beta = pm.Normal("beta", mu=0, sigma=10, shape=2)
sigma = pm.HalfNormal("sigma", sigma=1)
# Expected value of outcome
mu = alpha + beta[0] * X1 + beta[1] * X2
# Likelihood (sampling distribution) of observations
Y_obs = pm.Normal("Y_obs", mu=mu, sigma=sigma, observed=Y)
# Fit model with NUTS Sampling
with basic_model:
# draw 500 posterior samples
trace = pm.sample(500, return_inferencedata=False)
Thanks @marcchale for the code.
@dalthviz, please try to reproduce this one because it's related to the Object Explorer.
Description
What steps will reproduce the problem?
Attempted to use variable explorer to edit an integer within an object from package: pymc3, class: multitrace
Traceback
Versions
Dependencies