<jupyter_start><jupyter_text>Policy Initialization<jupyter_code>dim_state, dim_action = 4, 1
policy = FelixPolicy(dim_state, dim_action)
plot_policy(policy)<jupyter_output><empty_output><jupyter_text>NNPolicy with Default Initialization<jupyter_code>dim_state, dim_action = 4, 1
policy = NNPolicy(dim_state, dim_action, biased_head=True)
plot_policy(policy)
dim_state, dim_action = 4, 1
policy = NNPolicy(dim_state, dim_action, biased_head=False)  # Unbias the head?
plot_policy(policy)<jupyter_output><empty_output><jupyter_text>NNPolicy with Zero Bias Initialization<jupyter_code>dim_state, dim_action = 4, 1
policy = NNPolicy(dim_state, dim_action, biased_head=True)
zero_bias(policy)
plot_policy(policy)<jupyter_output><empty_output><jupyter_text>NNPolicy with Default Head Initialization<jupyter_code>dim_state, dim_action = 4, 1
policy = NNPolicy(dim_state, dim_action, biased_head=True)
# zero_bias(policy)
init_head_weight(policy)
plot_policy(policy)<jupyter_output><empty_output><jupyter_text>NNPolicy with Zero Bias and Default Weight Initialization<jupyter_code>dim_state, dim_action = 4, 1
policy = NNPolicy(dim_state, dim_action, biased_head=True)
zero_bias(policy)
init_head_weight(policy)
plot_policy(policy)<jupyter_output><empty_output><jupyter_text>Effect of  Initial Std Dev<jupyter_code>dim_state, dim_action = 4, 1
policy = NNPolicy(dim_state, dim_action, initial_scale=0.1)
zero_bias(policy)
init_head_weight(policy)  # Increase scale weight
plot_policy(policy)
dim_state, dim_action = 4, 1
policy = NNPolicy(dim_state, dim_action, initial_scale=0.01)
zero_bias(policy)
init_head_weight(policy)  # Increase scale weight
plot_policy(policy)
dim_state, dim_action = 4, 1
policy = NNPolicy(dim_state, dim_action, initial_scale=0.5)
zero_bias(policy)
init_head_weight(policy)  # Increase scale weight
plot_policy(policy)<jupyter_output><empty_output><jupyter_text>Value Functions<jupyter_code>dim_state, dim_action = 4, 1
value_function = NNValueFunction(dim_state)
zero_bias(value_function)
init_head_weight(value_function)  # Increase scale weight
torch.nn.init.uniform_(value_function.nn.head.bias, 2 + -0.1, 2 + 0.1)
plot_value_function(value_function)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09709618874773139, 'fraction_numerical': 0.014972776769509982, 'mean_word_length': 10.983695652173912, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '7', 'dir': 'jupyter-structured-clean-dedup', 'id': '46273', 'license': 'MIT', 'n_tokens_mistral': 832, 'n_tokens_neox': 782, 'n_words': 138, 'path': 'examples/demos/Network Initialization.ipynb', 'repo_name': 'shenao-zhang/DCPU', 'size': '2204'}