# Check if required_samples is updated, if so, regenerate samples
    if saved_required_samples != required_samples:
        raw_samples = sample_generator(env.bounds_low, env.bounds_high, required_samples)
        start_sample = 0  # restart if required_samples changed
        dataset = []
the above code generated the raw_samples correctly as expected 13 values 
raw_actions [1.80416573e-07 1.80030940e-07 1.80664200e-07 1.80412210e-07
 1.80144984e-07 2.27515696e-06 9.28662518e-06 5.90241046e-06
 3.07271480e-06 1.08082204e-06 2.51041976e-05 2.68180246e-12
 9.87563194e-01]

when the iteration reached the max_iterations, then the new generated raw_actions are not in the expected structure 
raw_actions [[1.80733926e-07 1.80141241e-07 1.80014026e-07 1.80471170e-07
  1.80518435e-07 3.60120144e-05 3.75617681e-05 1.27072846e-05
  3.95061609e-05 1.76058424e-05 2.44264138e-05 6.42337016e-12
  1.02433775e+00]]
Error running simulation: not enough values to unpack (expected 13, got 1)


def sample_generator(bounds_low, bounds_high, num_samples):
    """Generate samples using Latin Hypercube Sampling."""
    dim = len(bounds_low)
    sampler = qmc.LatinHypercube(d=dim)
    norm_samples = sampler.random(n=num_samples)
    samples = qmc.scale(norm_samples, bounds_low, bounds_high)
    return samples

def pre_training_dataset_generation(env, required_samples=1000, progress_filename='progress.pkl'):
    """Generate pre-training dataset with manual tuning data"""
    env.connect_to_simulator()

    dataset, start_sample, raw_samples, saved_required_samples = load_progress(progress_filename)

    # Check if required_samples is updated, if so, regenerate samples
    if saved_required_samples != required_samples:
        raw_samples = sample_generator(env.bounds_low, env.bounds_high, required_samples)
        start_sample = 0  # restart if required_samples changed
        dataset = []

    csv_file_mode = 'a' if start_sample > 0 else 'w'
    with open('transistor_data.csv', mode=csv_file_mode, newline='') as csvfile:
        fieldnames = ['L1', 'L3', 'L5', 'L6', 'L7', 'W1', 'W3', 'W5', 'W6', 'W7',
                      'Ib', 'Cc', 'Vc', 'M1', 'M2', 'M3', 'M4', 'M5', 'M8', 'M6', 
                      'M7', 'Area', 'PowerDissipation', 'SlewRate', 'Gain', 'Bandwidth3dB', 
                      'UnityGainFreq', 'PhaseMargin']
        writer = csv.DictWriter(csvfile, fieldnames=fieldnames)
        if start_sample == 0:
            writer.writeheader()

        current_sample = start_sample
        while current_sample < required_samples:
            sample_idx = current_sample % len(raw_samples)
            raw_actions = raw_samples[sample_idx]
            valid_sample_found = False

            while not valid_sample_found:
                iteration = 0

                while iteration < env.max_iterations:
                    print("raw_actions", raw_actions)
                    transistor_regions, saturation_condition, performance_metrics = env.simulator.run_simulation(raw_actions)

                    writer.writerow({
                        'L1': raw_actions[0], 'L3': raw_actions[1], 'L5': raw_actions[2], 'L6': raw_actions[3], 'L7': raw_actions[4],
                        'W1': raw_actions[5], 'W3': raw_actions[6], 'W5': raw_actions[7], 'W6': raw_actions[8], 'W7': raw_actions[9],
                        'Ib': raw_actions[10], 'Cc': raw_actions[11], 'Vc': raw_actions[12],
                        'M1': transistor_regions.get('M1', None), 'M2': transistor_regions.get('M2', None), 'M3': transistor_regions.get('M3', None),
                        'M4': transistor_regions.get('M4', None), 'M5': transistor_regions.get('M5', None), 'M8': transistor_regions.get('M8', None),
                        'M6': transistor_regions.get('M6', None), 'M7': transistor_regions.get('M7', None),
                        'Area': performance_metrics.get('Area', None), 'PowerDissipation': performance_metrics.get('PowerDissipation', None),
                        'SlewRate': performance_metrics.get('SlewRate', None), 'Gain': performance_metrics.get('Gain', None),
                        'Bandwidth3dB': performance_metrics.get('Bandwidth3dB', None), 'UnityGainFreq': performance_metrics.get('UnityGainFreq', None),
                        'PhaseMargin': performance_metrics.get('PhaseMargin', None)
                    })

                    if all(region == 2 for region in transistor_regions.values()): 
                        node_features_tensor, edge_feature_tensor, edge_index = netlist_to_graph(env.netlist_content, raw_actions, transistor_regions)
                        state = (torch.tensor(node_features_tensor, dtype=torch.float32), torch.tensor(edge_feature_tensor, dtype=torch.float32), torch.tensor(edge_index, dtype=torch.long))
                        actions = torch.tensor(raw_actions, dtype=torch.float32)
                        dataset.append((state, actions))
                        valid_sample_found = True
                        break

                    raw_actions = env.adjust_raw_actions_value(raw_actions, transistor_regions)
                    print("transistor_regions", transistor_regions)
                    print("iteration count", iteration)
                    iteration += 1
                    
                if not valid_sample_found:
                    raw_actions = sample_generator(env.bounds_low, env.bounds_high, 1)

            save_progress(dataset, current_sample, raw_samples, required_samples, progress_filename)
            current_sample += 1

    env.disconnect_from_simulator()

    return dataset