Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing parameter causing errors in NT3 (P1B4) #99

Open
vgutta opened this issue Oct 19, 2021 · 5 comments
Open

Missing parameter causing errors in NT3 (P1B4) #99

vgutta opened this issue Oct 19, 2021 · 5 comments

Comments

@vgutta
Copy link

vgutta commented Oct 19, 2021

While running Pilot 1 NT3 using the command python nt3_baseline_keras2.py --conf nt3_perf_bench_model.txt I ran into this error caused by a missing parameter

Traceback (most recent call last): File "nt3_baseline_keras2.py", line 290, in <module> main() File "nt3_baseline_keras2.py", line 286, in main run(gParameters) File "nt3_baseline_keras2.py", line 101, in run X_train, Y_train, X_test, Y_test = load_data(train_file, test_file, gParameters) File "nt3_baseline_keras2.py", line 70, in load_data if gParameters['add_noise']: KeyError: 'add_noise'

Issue is caused by these lines

# TODO: Add better names for noise boolean, make a featue for both RNA seq and label noise together
# check if noise is on (this is for label)
if gParameters['add_noise']:
# check if we want noise correlated with a feature
if gParameters['noise_correlated']:
Y_train, y_train_noise_gen = candle.label_flip_correlated(Y_train,
gParameters['label_noise'], X_train,
gParameters['feature_col'],
gParameters['feature_threshold'])
# else add uncorrelated noise
else:
Y_train, y_train_noise_gen = candle.label_flip(Y_train, gParameters['label_noise'])
# check if noise is on for RNA-seq data
elif gParameters['noise_gaussian']:
X_train = candle.add_gaussian_noise(X_train, 0, gParameters['std_dev'])

It seems like the candle parser being used never includes the parameters being checked here

# Initialize parameters
gParameters = candle.finalize_parameters(nt3Bmk)

So is there a different way to run this (maybe different flags) to avoid this issue. Obviously commented out lines 68-82 in nt3_baseline_keras2.py works but was not sure if parameters such as 'add_noise' will ever make it through to NT3. If not then maybe commenting out these lines permanently will save others some trouble?

@jmohdyusof
Copy link
Contributor

jmohdyusof commented Oct 19, 2021

OK, you need to add the lines:
add_noise = False
noise_gaussian = False
to the nt3_perf_bench_model.txt.

All the keywords are parsed from the config file, so if they are not there they will not appear in gParameters and will cause an error. Adding those 2 lines is sufficient.

Alternatively, just run the benchmark with 'python nt3_baseline_keras2.py' and it will use the nt3_default_model.txt which contains the required keywords.

@vgutta
Copy link
Author

vgutta commented Oct 19, 2021

Actually I tried without any changes to the repo on a different system and I did not run into any of those issues. I'll close this for now but I'll reply if I find the reason why it did that on the first system. Thanks for your help @jmohdyusof

@vgutta vgutta closed this as completed Oct 19, 2021
@jmohdyusof
Copy link
Contributor

I can't see how it would run correctly without those keywords, unless you are using the default model file. We will push changes to master to fix the perf_bench_model

@vgutta
Copy link
Author

vgutta commented Oct 19, 2021

You are right, I ran the default model file this time. Sorry for the confusion

@vgutta vgutta reopened this Oct 19, 2021
@jmohdyusof
Copy link
Contributor

OK, the original answer still stands. The perf_bench_model file was not updated to include the keywords needed by the noise methods, so we will push an update to master to fix that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants