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

Policy Uncertainty Head #168

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions tf/net.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ def __init__(self,
self.set_policyformat(policy)
self.set_valueformat(value)
self.set_movesleftformat(moves_left)
self.set_uncformat(pb.NetworkFormat.POLICY_UNC_CONVOLUTION)

def set_networkformat(self, net):
self.pb.format.network_format.network = net
Expand All @@ -68,6 +69,9 @@ def set_valueformat(self, value):
def set_movesleftformat(self, moves_left):
self.pb.format.network_format.moves_left = moves_left

def set_uncformat(self, unc):
self.pb.format.network_format.unc = unc

def set_input(self, input_format):
self.pb.format.network_format.input = input_format
if input_format == pb.NetworkFormat.INPUT_112_WITH_CANONICALIZATION_V2 or input_format == pb.NetworkFormat.INPUT_112_WITH_CANONICALIZATION_V2_ARMAGEDDON:
Expand Down Expand Up @@ -309,6 +313,10 @@ def moves_left_to_bp(l, w):
pb_name = moves_left_to_bp(layers[1], weights_name)
else:
pb_name = 'moves_left.' + convblock_to_bp(weights_name)
elif base_layer == 'uncertainty1':
pb_name = 'unc1.' + convblock_to_bp(weights_name)
elif base_layer == 'uncertainty':
pb_name = 'unc.' + convblock_to_bp(weights_name)
elif base_layer.startswith('residual'):
block = int(base_layer.split('_')[1]) - 1 # 1 indexed
if layers[1] == '1':
Expand Down
Loading