Mercurial > repos > bimib > cobraxy
comparison COBRAxy/flux_simulation_beta.py @ 479:a036b8d3642f draft
Uploaded
| author | luca_milaz |
|---|---|
| date | Mon, 22 Sep 2025 16:21:14 +0000 |
| parents | f3c3af900de2 |
| children | ecaf3c9852b3 |
comparison
equal
deleted
inserted
replaced
| 478:78b28b2ee1f0 | 479:a036b8d3642f |
|---|---|
| 201 optgp = OptGPSampler(model, thinning, seed) | 201 optgp = OptGPSampler(model, thinning, seed) |
| 202 samples = optgp.sample(n_samples) | 202 samples = optgp.sample(n_samples) |
| 203 | 203 |
| 204 # Save as numpy array (more memory efficient) | 204 # Save as numpy array (more memory efficient) |
| 205 batch_filename = f"{ARGS.output_path}/{model_name}_{i}_OPTGP.npy" | 205 batch_filename = f"{ARGS.output_path}/{model_name}_{i}_OPTGP.npy" |
| 206 np.save(batch_filename, samples.values) | 206 np.save(batch_filename, samples.to_numpy()) |
| 207 | 207 |
| 208 seed += 1 | 208 seed += 1 |
| 209 | 209 |
| 210 # Merge all batches into a single DataFrame | 210 # Merge all batches into a single DataFrame |
| 211 all_samples = [] | 211 all_samples = [] |
| 280 ) | 280 ) |
| 281 | 281 |
| 282 # Save as numpy array (more memory efficient) | 282 # Save as numpy array (more memory efficient) |
| 283 batch_filename = f"{ARGS.output_path}/{model_name}_{i}_CBS.npy" | 283 batch_filename = f"{ARGS.output_path}/{model_name}_{i}_CBS.npy" |
| 284 utils.logWarning(batch_filename, ARGS.out_log) | 284 utils.logWarning(batch_filename, ARGS.out_log) |
| 285 np.save(batch_filename, samples.values) | 285 np.save(batch_filename, samples.to_numpy()) |
| 286 | 286 |
| 287 # Merge all batches into a single DataFrame | 287 # Merge all batches into a single DataFrame |
| 288 all_samples = [] | 288 all_samples = [] |
| 289 | 289 |
| 290 for i in range(n_batches): | 290 for i in range(n_batches): |
