<jupyter_start><jupyter_text>If there are no weight files, first run `python test_network.py` to generate one. Then add the filename here to examin it<jupyter_code>file_name = 'sequential_5_relu_0.0_False.h5'
with h5py.File(file_name, 'r') as weights_file:
    print(weights_file.keys())
    print([i for i in weights_file.attrs])
    
    model_weights = weights_file['model_weights']
    
    model_config = weights_file.attrs['model_config'].decode('utf-8') # Decode using the utf-8 encoding
    model_config = model_config.replace('true','True')
    model_config = model_config.replace('false','False')

    model_config = model_config.replace('null','None')
    model_config = eval(model_config)
    
#     print(sorted(model_weights['batch_normalization_1']['batch_normalization_1'].keys()))
    training_config = eval(
        weights_file.attrs['training_config'].decode('utf-8').replace('null','None').replace('false','False').replace('true','True')
    )
    
    print('Learning rate:', training_config['optimizer_config']['config']['learning_rate'])
    pp.pprint(model_config)<jupyter_output><KeysViewHDF5 ['model_weights']>
['backend', 'keras_version', 'model_config', 'training_config']
Learning rate: 0.009999999776482582
{'class_name': 'Sequential',
 'config': {'layers': [{'class_name': 'Dense',
                        'config': {'activation': 'relu',
                                   'activity_regularizer': None,
                                   'batch_input_shape': [None, 5],
                                   'bias_constraint': None,
                                   'bias_initializer': {'class_name': 'Zeros',
                                                        'config': {}},
                                   'bias_regularizer': None,
                                   'dtype': 'float32',
                                   'kernel_constraint': None,
                                   'kernel_initializer': {'class_name': 'VarianceScaling',
                                                          'config': {'distribution': 'uniform',
                           [...]
{'fraction_non_alphanumeric': 0.13412322274881516, 'fraction_numerical': 0.015639810426540283, 'mean_word_length': 2.1792168674698793, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 1, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '247698', 'license': 'MIT', 'n_tokens_mistral': 589, 'n_tokens_neox': 558, 'n_words': 98, 'path': 'KerasWeightsProcessing/examples/EDA_H5.ipynb', 'repo_name': 'bsolino/FKB', 'size': '2110'}