repo
stringlengths 7
54
| path
stringlengths 4
223
| func_name
stringlengths 1
134
| original_string
stringlengths 75
104k
| language
stringclasses 1
value | code
stringlengths 75
104k
| code_tokens
listlengths 20
28.4k
| docstring
stringlengths 1
46.3k
| docstring_tokens
listlengths 1
1.66k
| sha
stringlengths 40
40
| url
stringlengths 87
315
| partition
stringclasses 1
value | summary
stringlengths 4
350
| obf_code
stringlengths 7.85k
764k
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
tensorflow/tensor2tensor
|
tensor2tensor/utils/hparam.py
|
_parse_fail
|
def _parse_fail(name, var_type, value, values):
"""Helper function for raising a value error for bad assignment."""
raise ValueError(
'Could not parse hparam \'%s\' of type \'%s\' with value \'%s\' in %s' %
(name, var_type.__name__, value, values))
|
python
|
def _parse_fail(name, var_type, value, values):
"""Helper function for raising a value error for bad assignment."""
raise ValueError(
'Could not parse hparam \'%s\' of type \'%s\' with value \'%s\' in %s' %
(name, var_type.__name__, value, values))
|
[
"def",
"_parse_fail",
"(",
"name",
",",
"var_type",
",",
"value",
",",
"values",
")",
":",
"raise",
"ValueError",
"(",
"'Could not parse hparam \\'%s\\' of type \\'%s\\' with value \\'%s\\' in %s'",
"%",
"(",
"name",
",",
"var_type",
".",
"__name__",
",",
"value",
",",
"values",
")",
")"
] |
Helper function for raising a value error for bad assignment.
|
[
"Helper",
"function",
"for",
"raising",
"a",
"value",
"error",
"for",
"bad",
"assignment",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/utils/hparam.py#L42-L46
|
train
|
Helper function for raising a value error for bad assignment.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAf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_gSK8V7h0,Rurm1zTRfSmY,reqGiMiVQ77y,bsS9P6_LpdIe,sbGAZlkZOtyh,Cf_Qef15s3_F,eX02hlZjMfR0,wLqBDw8l0eIm,g1Uy6IV0tyJQ,f9CsFWzvg0Vq,YlkZvXL8qwsX,MCqssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(1670 - 1622) + chr(0b1101111) + '\062' + chr(65 - 10) + '\065', 0b1000), ehT0Px3KOsy9(chr(0b110 + 0o52) + chr(0b1101111) + '\064' + chr(0b101101 + 0o6), 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(114 - 64) + chr(1745 - 1694) + '\063', 0b1000), ehT0Px3KOsy9(chr(1244 - 1196) + chr(111) + chr(0b110011) + '\062' + '\x35', 0o10), ehT0Px3KOsy9(chr(1229 - 1181) + chr(5712 - 5601) + chr(0b110001) + '\063' + chr(0b10101 + 0o37), ord("\x08")), ehT0Px3KOsy9(chr(1668 - 1620) + chr(8373 - 8262) + chr(54) + '\062', 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110001) + chr(1591 - 1537) + chr(0b110001), 26877 - 26869), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x33' + chr(1125 - 1076) + chr(2566 - 2515), 63076 - 63068), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110110) + chr(89 - 41), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b100010 + 0o115) + chr(2328 - 2278) + chr(0b110100) + '\063', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + '\066' + chr(53), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x34' + '\063', 8), ehT0Px3KOsy9('\x30' + '\x6f' + chr(51) + chr(54) + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(0b10110 + 0o32) + '\157' + chr(49) + chr(0b11101 + 0o27) + chr(116 - 64), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\063' + chr(0b110101), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + '\x33' + '\061' + chr(0b10001 + 0o44), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(4108 - 3997) + chr(696 - 647) + chr(0b110110) + '\x37', 0b1000), ehT0Px3KOsy9(chr(0b101 + 0o53) + chr(111) + '\063' + chr(49) + chr(0b110010), 0o10), ehT0Px3KOsy9(chr(0b101101 + 0o3) + chr(12137 - 12026) + chr(0b110011 + 0o4) + chr(0b110010), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(575 - 525) + chr(0b100111 + 0o11) + chr(0b110110), 19491 - 19483), ehT0Px3KOsy9(chr(0b1100 + 0o44) + '\157' + chr(50) + chr(50) + chr(1849 - 1794), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b0 + 0o157) + chr(0b110101) + chr(1202 - 1154), 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(48), 0b1000), ehT0Px3KOsy9(chr(415 - 367) + chr(1850 - 1739) + '\x31' + chr(1103 - 1055) + chr(0b110011), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x31' + '\063' + chr(0b11000 + 0o33), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(7456 - 7345) + chr(0b110001) + chr(1205 - 1152) + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(1324 - 1276) + '\157' + chr(0b110010) + chr(50) + chr(0b110001), 11196 - 11188), ehT0Px3KOsy9(chr(0b10101 + 0o33) + chr(0b1011001 + 0o26) + chr(0b101010 + 0o11) + chr(0b101100 + 0o11) + chr(53), 3994 - 3986), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110010) + '\x32' + '\x30', 21243 - 21235), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x31' + chr(0b1010 + 0o54) + '\060', ord("\x08")), ehT0Px3KOsy9(chr(0b10 + 0o56) + chr(0b101110 + 0o101) + chr(0b110010) + chr(0b10110 + 0o40) + chr(0b110111), 0o10), ehT0Px3KOsy9('\x30' + '\157' + '\x33' + chr(51) + '\065', ord("\x08")), ehT0Px3KOsy9(chr(553 - 505) + chr(111) + '\x32' + '\x37' + chr(48), 37029 - 37021), ehT0Px3KOsy9('\x30' + chr(1093 - 982) + chr(1220 - 1170) + chr(582 - 533) + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(2181 - 2133) + chr(4813 - 4702) + chr(0b101100 + 0o7) + chr(0b1011 + 0o51), 0b1000), ehT0Px3KOsy9(chr(0b100000 + 0o20) + '\x6f' + chr(311 - 260) + chr(51) + chr(0b110101), 8), ehT0Px3KOsy9('\060' + chr(1070 - 959) + '\x33' + chr(48) + '\064', 34665 - 34657), ehT0Px3KOsy9('\x30' + chr(0b11101 + 0o122) + chr(1073 - 1018) + chr(48), 0o10), ehT0Px3KOsy9(chr(739 - 691) + chr(0b1101111) + '\062' + chr(50) + chr(2718 - 2663), 8), ehT0Px3KOsy9('\x30' + chr(11755 - 11644) + chr(50), 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + chr(0b111010 + 0o65) + '\065' + '\060', 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x93'), chr(0b1100100) + '\145' + '\143' + chr(9314 - 9203) + chr(3595 - 3495) + chr(0b1100101))(chr(0b101100 + 0o111) + chr(8693 - 8577) + chr(102) + chr(820 - 775) + '\070') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def etitvxrZ4RBK(AIvJRzLdDfgF, qWAMCtm_bHAI, QmmgWUB13VCJ, SPnCNu54H1db):
raise q1QCh3W88sgk(xafqLlk3kkUe(SXOLrMavuUCe(b'\xfeL\xee\xb98\x12\x1f\xa4D\x83EB\x80\x17x\xed\x1f\xba[\xf4\xf6E d~\x1b\xb6\xcd\xff\x16\x97\xa9\xc1\xf8y\xfd\xe3\x1d\xe4%\x9dT\xf2\xa14\x12\x07\xaa\\\xd6P\x03\xd5An\xeaW\xa3T\xa6\xb2['), '\x64' + '\x65' + chr(99) + chr(11218 - 11107) + chr(0b1100100) + chr(101))('\165' + chr(116) + '\146' + chr(864 - 819) + chr(0b101111 + 0o11)) % (AIvJRzLdDfgF, xafqLlk3kkUe(qWAMCtm_bHAI, xafqLlk3kkUe(SXOLrMavuUCe(b'\xfaA\xfe\xbfh]+\xba{\xeft\x15'), chr(8149 - 8049) + chr(525 - 424) + chr(0b1100011) + chr(1008 - 897) + chr(100) + chr(101))(chr(0b1001 + 0o154) + '\x74' + chr(102) + chr(0b101101) + chr(0b11 + 0o65))), QmmgWUB13VCJ, SPnCNu54H1db))
|
tensorflow/tensor2tensor
|
tensor2tensor/utils/hparam.py
|
_process_scalar_value
|
def _process_scalar_value(name, parse_fn, var_type, m_dict, values,
results_dictionary):
"""Update results_dictionary with a scalar value.
Used to update the results_dictionary to be returned by parse_values when
encountering a clause with a scalar RHS (e.g. "s=5" or "arr[0]=5".)
Mutates results_dictionary.
Args:
name: Name of variable in assignment ("s" or "arr").
parse_fn: Function for parsing the actual value.
var_type: Type of named variable.
m_dict: Dictionary constructed from regex parsing.
m_dict['val']: RHS value (scalar)
m_dict['index']: List index value (or None)
values: Full expression being parsed
results_dictionary: The dictionary being updated for return by the parsing
function.
Raises:
ValueError: If the name has already been used.
"""
try:
parsed_value = parse_fn(m_dict['val'])
except ValueError:
_parse_fail(name, var_type, m_dict['val'], values)
# If no index is provided
if not m_dict['index']:
if name in results_dictionary:
_reuse_fail(name, values)
results_dictionary[name] = parsed_value
else:
if name in results_dictionary:
# The name has already been used as a scalar, then it
# will be in this dictionary and map to a non-dictionary.
if not isinstance(results_dictionary.get(name), dict):
_reuse_fail(name, values)
else:
results_dictionary[name] = {}
index = int(m_dict['index'])
# Make sure the index position hasn't already been assigned a value.
if index in results_dictionary[name]:
_reuse_fail('{}[{}]'.format(name, index), values)
results_dictionary[name][index] = parsed_value
|
python
|
def _process_scalar_value(name, parse_fn, var_type, m_dict, values,
results_dictionary):
"""Update results_dictionary with a scalar value.
Used to update the results_dictionary to be returned by parse_values when
encountering a clause with a scalar RHS (e.g. "s=5" or "arr[0]=5".)
Mutates results_dictionary.
Args:
name: Name of variable in assignment ("s" or "arr").
parse_fn: Function for parsing the actual value.
var_type: Type of named variable.
m_dict: Dictionary constructed from regex parsing.
m_dict['val']: RHS value (scalar)
m_dict['index']: List index value (or None)
values: Full expression being parsed
results_dictionary: The dictionary being updated for return by the parsing
function.
Raises:
ValueError: If the name has already been used.
"""
try:
parsed_value = parse_fn(m_dict['val'])
except ValueError:
_parse_fail(name, var_type, m_dict['val'], values)
# If no index is provided
if not m_dict['index']:
if name in results_dictionary:
_reuse_fail(name, values)
results_dictionary[name] = parsed_value
else:
if name in results_dictionary:
# The name has already been used as a scalar, then it
# will be in this dictionary and map to a non-dictionary.
if not isinstance(results_dictionary.get(name), dict):
_reuse_fail(name, values)
else:
results_dictionary[name] = {}
index = int(m_dict['index'])
# Make sure the index position hasn't already been assigned a value.
if index in results_dictionary[name]:
_reuse_fail('{}[{}]'.format(name, index), values)
results_dictionary[name][index] = parsed_value
|
[
"def",
"_process_scalar_value",
"(",
"name",
",",
"parse_fn",
",",
"var_type",
",",
"m_dict",
",",
"values",
",",
"results_dictionary",
")",
":",
"try",
":",
"parsed_value",
"=",
"parse_fn",
"(",
"m_dict",
"[",
"'val'",
"]",
")",
"except",
"ValueError",
":",
"_parse_fail",
"(",
"name",
",",
"var_type",
",",
"m_dict",
"[",
"'val'",
"]",
",",
"values",
")",
"# If no index is provided",
"if",
"not",
"m_dict",
"[",
"'index'",
"]",
":",
"if",
"name",
"in",
"results_dictionary",
":",
"_reuse_fail",
"(",
"name",
",",
"values",
")",
"results_dictionary",
"[",
"name",
"]",
"=",
"parsed_value",
"else",
":",
"if",
"name",
"in",
"results_dictionary",
":",
"# The name has already been used as a scalar, then it",
"# will be in this dictionary and map to a non-dictionary.",
"if",
"not",
"isinstance",
"(",
"results_dictionary",
".",
"get",
"(",
"name",
")",
",",
"dict",
")",
":",
"_reuse_fail",
"(",
"name",
",",
"values",
")",
"else",
":",
"results_dictionary",
"[",
"name",
"]",
"=",
"{",
"}",
"index",
"=",
"int",
"(",
"m_dict",
"[",
"'index'",
"]",
")",
"# Make sure the index position hasn't already been assigned a value.",
"if",
"index",
"in",
"results_dictionary",
"[",
"name",
"]",
":",
"_reuse_fail",
"(",
"'{}[{}]'",
".",
"format",
"(",
"name",
",",
"index",
")",
",",
"values",
")",
"results_dictionary",
"[",
"name",
"]",
"[",
"index",
"]",
"=",
"parsed_value"
] |
Update results_dictionary with a scalar value.
Used to update the results_dictionary to be returned by parse_values when
encountering a clause with a scalar RHS (e.g. "s=5" or "arr[0]=5".)
Mutates results_dictionary.
Args:
name: Name of variable in assignment ("s" or "arr").
parse_fn: Function for parsing the actual value.
var_type: Type of named variable.
m_dict: Dictionary constructed from regex parsing.
m_dict['val']: RHS value (scalar)
m_dict['index']: List index value (or None)
values: Full expression being parsed
results_dictionary: The dictionary being updated for return by the parsing
function.
Raises:
ValueError: If the name has already been used.
|
[
"Update",
"results_dictionary",
"with",
"a",
"scalar",
"value",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/utils/hparam.py#L55-L101
|
train
|
Process a scalar value in the results_dictionary.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h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xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b1000 + 0o50) + '\x6f' + chr(1451 - 1401) + chr(0b10110 + 0o34), 43725 - 43717), ehT0Px3KOsy9(chr(914 - 866) + chr(0b10001 + 0o136) + chr(0b110010) + chr(2590 - 2537), ord("\x08")), ehT0Px3KOsy9(chr(1453 - 1405) + chr(3408 - 3297) + chr(0b110011) + chr(0b110101) + chr(54), 0b1000), ehT0Px3KOsy9(chr(0b110000 + 0o0) + '\x6f' + chr(678 - 628) + chr(0b110000) + '\067', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b101010 + 0o10) + chr(0b110000) + chr(55), 8), ehT0Px3KOsy9(chr(0b10111 + 0o31) + chr(111) + '\x32' + chr(0b110011) + chr(2496 - 2445), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(1218 - 1168) + chr(0b1101 + 0o51) + chr(50), 0o10), ehT0Px3KOsy9(chr(0b101001 + 0o7) + '\x6f' + '\x32' + chr(0b1101 + 0o51) + chr(2195 - 2144), 39434 - 39426), ehT0Px3KOsy9(chr(48) + chr(111) + '\063' + chr(0b10100 + 0o34) + '\x33', 27007 - 26999), ehT0Px3KOsy9(chr(48) + chr(111) + chr(50) + chr(0b110011), ord("\x08")), ehT0Px3KOsy9(chr(1041 - 993) + chr(0b1101111) + chr(49) + chr(0b10101 + 0o41) + '\062', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(52) + chr(0b110011), 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(49) + chr(0b10000 + 0o44) + chr(48), 0o10), ehT0Px3KOsy9(chr(0b101111 + 0o1) + chr(111) + chr(421 - 371) + chr(464 - 415) + '\063', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b10000 + 0o45) + chr(52), 0b1000), ehT0Px3KOsy9('\060' + chr(10770 - 10659) + '\x31' + chr(0b10101 + 0o41) + chr(0b101100 + 0o10), 0b1000), ehT0Px3KOsy9(chr(2185 - 2137) + chr(111) + '\065', 0o10), ehT0Px3KOsy9(chr(0b1110 + 0o42) + chr(0b1000111 + 0o50) + chr(0b110001) + chr(51), 0b1000), ehT0Px3KOsy9(chr(0b101100 + 0o4) + chr(111) + chr(2317 - 2266) + '\x30' + chr(2777 - 2723), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + '\x33' + '\067' + chr(0b110010), 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110010) + chr(0b110111) + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(2212 - 2164) + chr(9937 - 9826) + chr(0b110011) + chr(0b110100) + '\064', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1001000 + 0o47) + '\064' + '\x34', 0o10), ehT0Px3KOsy9(chr(0b100111 + 0o11) + '\157' + chr(0b110010) + chr(53) + chr(0b110000 + 0o4), 9455 - 9447), ehT0Px3KOsy9('\060' + chr(8097 - 7986) + chr(2347 - 2298) + chr(0b110000) + chr(342 - 288), 0b1000), ehT0Px3KOsy9(chr(718 - 670) + chr(0b1101111) + chr(0b110011) + '\063' + '\x32', 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b11111 + 0o23) + '\066' + chr(50), 8), ehT0Px3KOsy9(chr(1511 - 1463) + '\x6f' + '\062' + '\067' + '\x36', 8), ehT0Px3KOsy9(chr(0b100001 + 0o17) + chr(0b110011 + 0o74) + '\063' + chr(0b110111) + chr(1762 - 1714), 4856 - 4848), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b11101 + 0o26) + chr(2842 - 2788) + chr(351 - 299), 0b1000), ehT0Px3KOsy9(chr(722 - 674) + chr(2269 - 2158) + '\x31' + chr(48) + chr(0b11000 + 0o33), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(54) + chr(1155 - 1100), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110001) + chr(0b11101 + 0o30) + '\x34', 0o10), ehT0Px3KOsy9('\x30' + '\157' + '\063' + chr(146 - 98) + '\060', 7604 - 7596), ehT0Px3KOsy9('\x30' + chr(111) + '\x32' + chr(55) + chr(0b100101 + 0o21), 8), ehT0Px3KOsy9(chr(48) + chr(0b10110 + 0o131) + chr(0b110010) + chr(0b110001 + 0o6), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(51) + '\063', 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110011) + chr(881 - 832) + chr(156 - 107), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110010) + '\065', 8), ehT0Px3KOsy9(chr(48) + chr(2832 - 2721) + '\x32' + chr(0b110010) + '\065', 15191 - 15183)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(53) + chr(0b10110 + 0o32), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'<'), '\x64' + chr(0b1011101 + 0o10) + chr(4779 - 4680) + chr(0b1101111) + chr(0b1100100) + chr(101))('\165' + '\164' + chr(10331 - 10229) + chr(45) + chr(0b11001 + 0o37)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def s2pVaUlXRqp1(AIvJRzLdDfgF, HmzC8TCHBrnK, qWAMCtm_bHAI, owtF381uQ0Ga, SPnCNu54H1db, SRegsHHDvofC):
try:
qPkQ1aLs4OG0 = HmzC8TCHBrnK(owtF381uQ0Ga[xafqLlk3kkUe(SXOLrMavuUCe(b'dt\x82'), chr(0b1100100) + chr(0b1001000 + 0o35) + '\143' + chr(111) + chr(0b1100100) + chr(101))('\165' + chr(0b110100 + 0o100) + '\146' + '\055' + chr(56))])
except q1QCh3W88sgk:
etitvxrZ4RBK(AIvJRzLdDfgF, qWAMCtm_bHAI, owtF381uQ0Ga[xafqLlk3kkUe(SXOLrMavuUCe(b'dt\x82'), chr(0b1100100) + chr(0b1100101) + chr(2282 - 2183) + '\157' + '\x64' + chr(0b100010 + 0o103))(chr(3916 - 3799) + chr(7606 - 7490) + chr(2088 - 1986) + '\055' + chr(0b111000))], SPnCNu54H1db)
if not owtF381uQ0Ga[xafqLlk3kkUe(SXOLrMavuUCe(b'{{\x8a\xe2\xff'), chr(100) + chr(0b1100101) + chr(99) + '\x6f' + '\x64' + chr(101))(chr(9397 - 9280) + chr(116) + chr(102) + '\x2d' + chr(1193 - 1137))]:
if AIvJRzLdDfgF in SRegsHHDvofC:
vq7aDfq2IV__(AIvJRzLdDfgF, SPnCNu54H1db)
SRegsHHDvofC[AIvJRzLdDfgF] = qPkQ1aLs4OG0
else:
if AIvJRzLdDfgF in SRegsHHDvofC:
if not PlSM16l2KDPD(xafqLlk3kkUe(SRegsHHDvofC, xafqLlk3kkUe(SXOLrMavuUCe(b'up\x9a'), '\x64' + chr(0b1100101) + chr(99) + '\x6f' + chr(9741 - 9641) + chr(0b1000 + 0o135))(chr(0b1110101) + '\x74' + chr(102) + chr(946 - 901) + '\x38'))(AIvJRzLdDfgF), wLqBDw8l0eIm):
vq7aDfq2IV__(AIvJRzLdDfgF, SPnCNu54H1db)
else:
SRegsHHDvofC[AIvJRzLdDfgF] = {}
XdowRbJKZWL9 = ehT0Px3KOsy9(owtF381uQ0Ga[xafqLlk3kkUe(SXOLrMavuUCe(b'{{\x8a\xe2\xff'), chr(100) + chr(0b1100101) + '\143' + chr(0b1101111) + '\x64' + '\x65')('\x75' + chr(116) + '\146' + chr(0b101101) + '\070')])
if XdowRbJKZWL9 in SRegsHHDvofC[AIvJRzLdDfgF]:
vq7aDfq2IV__(xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'ih\xb5\xfc\xfa\xc6'), chr(5650 - 5550) + chr(1810 - 1709) + '\143' + '\x6f' + chr(1314 - 1214) + chr(101))(chr(117) + '\x74' + chr(0b1010001 + 0o25) + chr(0b1101 + 0o40) + chr(0b111000)), xafqLlk3kkUe(SXOLrMavuUCe(b'D!\x9c\xe8\xcf\xfa\xe1\x80\x93c\x17I'), '\144' + chr(9498 - 9397) + chr(5622 - 5523) + '\157' + '\x64' + chr(403 - 302))('\165' + chr(8767 - 8651) + chr(0b10 + 0o144) + chr(0b11000 + 0o25) + chr(56)))(AIvJRzLdDfgF, XdowRbJKZWL9), SPnCNu54H1db)
SRegsHHDvofC[AIvJRzLdDfgF][XdowRbJKZWL9] = qPkQ1aLs4OG0
|
tensorflow/tensor2tensor
|
tensor2tensor/utils/hparam.py
|
_process_list_value
|
def _process_list_value(name, parse_fn, var_type, m_dict, values,
results_dictionary):
"""Update results_dictionary from a list of values.
Used to update results_dictionary to be returned by parse_values when
encountering a clause with a list RHS (e.g. "arr=[1,2,3]".)
Mutates results_dictionary.
Args:
name: Name of variable in assignment ("arr").
parse_fn: Function for parsing individual values.
var_type: Type of named variable.
m_dict: Dictionary constructed from regex parsing.
m_dict['val']: RHS value (scalar)
values: Full expression being parsed
results_dictionary: The dictionary being updated for return by the parsing
function.
Raises:
ValueError: If the name has an index or the values cannot be parsed.
"""
if m_dict['index'] is not None:
raise ValueError('Assignment of a list to a list index.')
elements = filter(None, re.split('[ ,]', m_dict['vals']))
# Make sure the name hasn't already been assigned a value
if name in results_dictionary:
raise _reuse_fail(name, values)
try:
results_dictionary[name] = [parse_fn(e) for e in elements]
except ValueError:
_parse_fail(name, var_type, m_dict['vals'], values)
|
python
|
def _process_list_value(name, parse_fn, var_type, m_dict, values,
results_dictionary):
"""Update results_dictionary from a list of values.
Used to update results_dictionary to be returned by parse_values when
encountering a clause with a list RHS (e.g. "arr=[1,2,3]".)
Mutates results_dictionary.
Args:
name: Name of variable in assignment ("arr").
parse_fn: Function for parsing individual values.
var_type: Type of named variable.
m_dict: Dictionary constructed from regex parsing.
m_dict['val']: RHS value (scalar)
values: Full expression being parsed
results_dictionary: The dictionary being updated for return by the parsing
function.
Raises:
ValueError: If the name has an index or the values cannot be parsed.
"""
if m_dict['index'] is not None:
raise ValueError('Assignment of a list to a list index.')
elements = filter(None, re.split('[ ,]', m_dict['vals']))
# Make sure the name hasn't already been assigned a value
if name in results_dictionary:
raise _reuse_fail(name, values)
try:
results_dictionary[name] = [parse_fn(e) for e in elements]
except ValueError:
_parse_fail(name, var_type, m_dict['vals'], values)
|
[
"def",
"_process_list_value",
"(",
"name",
",",
"parse_fn",
",",
"var_type",
",",
"m_dict",
",",
"values",
",",
"results_dictionary",
")",
":",
"if",
"m_dict",
"[",
"'index'",
"]",
"is",
"not",
"None",
":",
"raise",
"ValueError",
"(",
"'Assignment of a list to a list index.'",
")",
"elements",
"=",
"filter",
"(",
"None",
",",
"re",
".",
"split",
"(",
"'[ ,]'",
",",
"m_dict",
"[",
"'vals'",
"]",
")",
")",
"# Make sure the name hasn't already been assigned a value",
"if",
"name",
"in",
"results_dictionary",
":",
"raise",
"_reuse_fail",
"(",
"name",
",",
"values",
")",
"try",
":",
"results_dictionary",
"[",
"name",
"]",
"=",
"[",
"parse_fn",
"(",
"e",
")",
"for",
"e",
"in",
"elements",
"]",
"except",
"ValueError",
":",
"_parse_fail",
"(",
"name",
",",
"var_type",
",",
"m_dict",
"[",
"'vals'",
"]",
",",
"values",
")"
] |
Update results_dictionary from a list of values.
Used to update results_dictionary to be returned by parse_values when
encountering a clause with a list RHS (e.g. "arr=[1,2,3]".)
Mutates results_dictionary.
Args:
name: Name of variable in assignment ("arr").
parse_fn: Function for parsing individual values.
var_type: Type of named variable.
m_dict: Dictionary constructed from regex parsing.
m_dict['val']: RHS value (scalar)
values: Full expression being parsed
results_dictionary: The dictionary being updated for return by the parsing
function.
Raises:
ValueError: If the name has an index or the values cannot be parsed.
|
[
"Update",
"results_dictionary",
"from",
"a",
"list",
"of",
"values",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/utils/hparam.py#L104-L135
|
train
|
Process a list value.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDASQ0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9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + chr(7368 - 7257) + '\062' + '\062' + chr(0b110010), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110001) + '\060' + chr(468 - 418), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(7407 - 7296) + chr(0b110011) + '\066' + '\x36', 0o10), ehT0Px3KOsy9('\x30' + chr(0b1011 + 0o144) + chr(49) + chr(0b100111 + 0o13) + chr(0b110001), ord("\x08")), ehT0Px3KOsy9(chr(932 - 884) + chr(3516 - 3405) + chr(0b110010) + chr(787 - 734) + '\x37', 57483 - 57475), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(51) + chr(54) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(7756 - 7645) + chr(51) + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(6835 - 6724) + '\x31' + '\x31' + chr(0b110011), 0o10), ehT0Px3KOsy9(chr(270 - 222) + chr(4802 - 4691) + '\x31' + '\065' + chr(0b100100 + 0o17), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(10918 - 10807) + chr(0b110011) + chr(0b110011) + '\x37', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b101101 + 0o102) + '\063' + chr(0b110111) + chr(0b110100), 0b1000), ehT0Px3KOsy9(chr(1307 - 1259) + chr(9702 - 9591) + chr(1938 - 1888) + chr(0b11111 + 0o21), 0b1000), ehT0Px3KOsy9(chr(0b111 + 0o51) + chr(1826 - 1715) + chr(2037 - 1988) + '\063' + chr(54), 44840 - 44832), ehT0Px3KOsy9(chr(1534 - 1486) + chr(0b1010000 + 0o37) + chr(52) + chr(201 - 152), 30568 - 30560), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110011) + chr(0b110100) + chr(55), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\061' + '\064' + '\061', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b11000 + 0o127) + '\x37' + chr(0b101111 + 0o2), 0o10), ehT0Px3KOsy9(chr(2200 - 2152) + '\157' + chr(2248 - 2198) + chr(52) + '\x30', 0o10), ehT0Px3KOsy9('\060' + chr(7777 - 7666) + chr(0b110011) + chr(0b110001) + chr(53), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1 + 0o156) + '\x32' + chr(0b110000) + '\061', 64670 - 64662), ehT0Px3KOsy9('\060' + '\157' + '\063' + chr(450 - 398) + chr(50), 0b1000), ehT0Px3KOsy9('\060' + chr(5037 - 4926) + '\x33' + '\x35' + chr(0b110111), 9340 - 9332), ehT0Px3KOsy9(chr(0b110000) + chr(12116 - 12005) + '\x31' + chr(2516 - 2464) + '\x36', 0b1000), ehT0Px3KOsy9('\060' + '\157' + '\061' + chr(1779 - 1730) + '\064', ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + '\062' + chr(0b11000 + 0o37) + '\061', 65432 - 65424), ehT0Px3KOsy9('\060' + chr(0b1101111 + 0o0) + chr(0b110011) + '\x30' + chr(52), 36091 - 36083), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b101001 + 0o11) + '\062' + '\060', 62395 - 62387), ehT0Px3KOsy9('\060' + '\x6f' + '\061' + '\063', 59040 - 59032), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\061' + chr(0b110110) + '\x31', ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110001) + chr(643 - 592) + '\065', 0o10), ehT0Px3KOsy9('\060' + chr(0b1000111 + 0o50) + chr(1451 - 1402) + '\x37' + chr(48), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110001) + chr(53) + chr(0b110001), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x31' + chr(52), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + '\x33' + '\065' + '\060', 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(0b110010) + chr(928 - 880) + '\x33', 0b1000), ehT0Px3KOsy9('\060' + chr(9116 - 9005) + chr(1488 - 1437) + chr(0b110111) + '\065', ord("\x08")), ehT0Px3KOsy9(chr(832 - 784) + chr(0b1101111) + '\x31' + '\x35' + chr(49), 8), ehT0Px3KOsy9('\060' + '\157' + chr(49) + chr(0b11010 + 0o32) + '\064', 0o10), ehT0Px3KOsy9(chr(0b10011 + 0o35) + chr(111) + chr(0b11110 + 0o24) + chr(1924 - 1874) + '\064', 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(49) + chr(0b1010 + 0o51) + chr(0b110101), 8)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110101) + chr(0b100011 + 0o15), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xbc'), chr(0b100001 + 0o103) + chr(101) + chr(99) + chr(3290 - 3179) + chr(100) + chr(0b1011000 + 0o15))(chr(0b101 + 0o160) + '\x74' + '\x66' + '\x2d' + chr(56)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def ilEp5I9h8Mwb(AIvJRzLdDfgF, HmzC8TCHBrnK, qWAMCtm_bHAI, owtF381uQ0Ga, SPnCNu54H1db, SRegsHHDvofC):
if owtF381uQ0Ga[xafqLlk3kkUe(SXOLrMavuUCe(b'\xfb,\x924\xd7'), chr(4617 - 4517) + '\145' + '\x63' + '\x6f' + chr(0b11011 + 0o111) + chr(0b1100101))(chr(0b1110101) + chr(12262 - 12146) + '\x66' + '\055' + chr(0b111000))] is not None:
raise q1QCh3W88sgk(xafqLlk3kkUe(SXOLrMavuUCe(b'\xd31\x858\xc8\x9cu.\x05\xab\xdc\x7f8\x01\x86AU\xc9\xbe\xf5\xc2\x9b\tl\xd8\xe4\xfcb\x02)X\x00b\x8c\xe6\x85G'), chr(0b1100100) + chr(1651 - 1550) + '\143' + '\x6f' + chr(0b1100100) + chr(101))(chr(117) + chr(116) + chr(0b1010011 + 0o23) + chr(0b10000 + 0o35) + '\x38'))
eHXqZodw3nXN = hi1V0ySZcNds(None, _7u55U49WwX2.split(xafqLlk3kkUe(SXOLrMavuUCe(b'\xc9b\xda\x0c'), chr(0b1100100) + chr(0b1100101) + '\143' + chr(0b1101111) + chr(0b11 + 0o141) + chr(570 - 469))(chr(117) + chr(0b110011 + 0o101) + chr(8319 - 8217) + chr(0b101101) + '\070'), owtF381uQ0Ga[xafqLlk3kkUe(SXOLrMavuUCe(b'\xe4#\x9a"'), chr(100) + chr(0b1100101) + chr(0b1000100 + 0o37) + chr(4753 - 4642) + chr(100) + chr(101))(chr(0b1110101) + chr(0b1000110 + 0o56) + chr(4614 - 4512) + '\x2d' + chr(0b11111 + 0o31))]))
if AIvJRzLdDfgF in SRegsHHDvofC:
raise vq7aDfq2IV__(AIvJRzLdDfgF, SPnCNu54H1db)
try:
SRegsHHDvofC[AIvJRzLdDfgF] = [HmzC8TCHBrnK(GlnVAPeT6CUe) for GlnVAPeT6CUe in eHXqZodw3nXN]
except q1QCh3W88sgk:
etitvxrZ4RBK(AIvJRzLdDfgF, qWAMCtm_bHAI, owtF381uQ0Ga[xafqLlk3kkUe(SXOLrMavuUCe(b'\xe4#\x9a"'), '\144' + chr(5040 - 4939) + '\143' + '\157' + chr(0b1000011 + 0o41) + chr(101))(chr(0b1110101) + '\164' + '\146' + '\055' + '\070')], SPnCNu54H1db)
|
tensorflow/tensor2tensor
|
tensor2tensor/utils/hparam.py
|
_cast_to_type_if_compatible
|
def _cast_to_type_if_compatible(name, param_type, value):
"""Cast hparam to the provided type, if compatible.
Args:
name: Name of the hparam to be cast.
param_type: The type of the hparam.
value: The value to be cast, if compatible.
Returns:
The result of casting `value` to `param_type`.
Raises:
ValueError: If the type of `value` is not compatible with param_type.
* If `param_type` is a string type, but `value` is not.
* If `param_type` is a boolean, but `value` is not, or vice versa.
* If `param_type` is an integer type, but `value` is not.
* If `param_type` is a float type, but `value` is not a numeric type.
"""
fail_msg = (
"Could not cast hparam '%s' of type '%s' from value %r" %
(name, param_type, value))
# Some callers use None, for which we can't do any casting/checking. :(
if issubclass(param_type, type(None)):
return value
# Avoid converting a non-string type to a string.
if (issubclass(param_type, (six.string_types, six.binary_type)) and
not isinstance(value, (six.string_types, six.binary_type))):
raise ValueError(fail_msg)
# Avoid converting a number or string type to a boolean or vice versa.
if issubclass(param_type, bool) != isinstance(value, bool):
raise ValueError(fail_msg)
# Avoid converting float to an integer (the reverse is fine).
if (issubclass(param_type, numbers.Integral) and
not isinstance(value, numbers.Integral)):
raise ValueError(fail_msg)
# Avoid converting a non-numeric type to a numeric type.
if (issubclass(param_type, numbers.Number) and
not isinstance(value, numbers.Number)):
raise ValueError(fail_msg)
return param_type(value)
|
python
|
def _cast_to_type_if_compatible(name, param_type, value):
"""Cast hparam to the provided type, if compatible.
Args:
name: Name of the hparam to be cast.
param_type: The type of the hparam.
value: The value to be cast, if compatible.
Returns:
The result of casting `value` to `param_type`.
Raises:
ValueError: If the type of `value` is not compatible with param_type.
* If `param_type` is a string type, but `value` is not.
* If `param_type` is a boolean, but `value` is not, or vice versa.
* If `param_type` is an integer type, but `value` is not.
* If `param_type` is a float type, but `value` is not a numeric type.
"""
fail_msg = (
"Could not cast hparam '%s' of type '%s' from value %r" %
(name, param_type, value))
# Some callers use None, for which we can't do any casting/checking. :(
if issubclass(param_type, type(None)):
return value
# Avoid converting a non-string type to a string.
if (issubclass(param_type, (six.string_types, six.binary_type)) and
not isinstance(value, (six.string_types, six.binary_type))):
raise ValueError(fail_msg)
# Avoid converting a number or string type to a boolean or vice versa.
if issubclass(param_type, bool) != isinstance(value, bool):
raise ValueError(fail_msg)
# Avoid converting float to an integer (the reverse is fine).
if (issubclass(param_type, numbers.Integral) and
not isinstance(value, numbers.Integral)):
raise ValueError(fail_msg)
# Avoid converting a non-numeric type to a numeric type.
if (issubclass(param_type, numbers.Number) and
not isinstance(value, numbers.Number)):
raise ValueError(fail_msg)
return param_type(value)
|
[
"def",
"_cast_to_type_if_compatible",
"(",
"name",
",",
"param_type",
",",
"value",
")",
":",
"fail_msg",
"=",
"(",
"\"Could not cast hparam '%s' of type '%s' from value %r\"",
"%",
"(",
"name",
",",
"param_type",
",",
"value",
")",
")",
"# Some callers use None, for which we can't do any casting/checking. :(",
"if",
"issubclass",
"(",
"param_type",
",",
"type",
"(",
"None",
")",
")",
":",
"return",
"value",
"# Avoid converting a non-string type to a string.",
"if",
"(",
"issubclass",
"(",
"param_type",
",",
"(",
"six",
".",
"string_types",
",",
"six",
".",
"binary_type",
")",
")",
"and",
"not",
"isinstance",
"(",
"value",
",",
"(",
"six",
".",
"string_types",
",",
"six",
".",
"binary_type",
")",
")",
")",
":",
"raise",
"ValueError",
"(",
"fail_msg",
")",
"# Avoid converting a number or string type to a boolean or vice versa.",
"if",
"issubclass",
"(",
"param_type",
",",
"bool",
")",
"!=",
"isinstance",
"(",
"value",
",",
"bool",
")",
":",
"raise",
"ValueError",
"(",
"fail_msg",
")",
"# Avoid converting float to an integer (the reverse is fine).",
"if",
"(",
"issubclass",
"(",
"param_type",
",",
"numbers",
".",
"Integral",
")",
"and",
"not",
"isinstance",
"(",
"value",
",",
"numbers",
".",
"Integral",
")",
")",
":",
"raise",
"ValueError",
"(",
"fail_msg",
")",
"# Avoid converting a non-numeric type to a numeric type.",
"if",
"(",
"issubclass",
"(",
"param_type",
",",
"numbers",
".",
"Number",
")",
"and",
"not",
"isinstance",
"(",
"value",
",",
"numbers",
".",
"Number",
")",
")",
":",
"raise",
"ValueError",
"(",
"fail_msg",
")",
"return",
"param_type",
"(",
"value",
")"
] |
Cast hparam to the provided type, if compatible.
Args:
name: Name of the hparam to be cast.
param_type: The type of the hparam.
value: The value to be cast, if compatible.
Returns:
The result of casting `value` to `param_type`.
Raises:
ValueError: If the type of `value` is not compatible with param_type.
* If `param_type` is a string type, but `value` is not.
* If `param_type` is a boolean, but `value` is not, or vice versa.
* If `param_type` is an integer type, but `value` is not.
* If `param_type` is a float type, but `value` is not a numeric type.
|
[
"Cast",
"hparam",
"to",
"the",
"provided",
"type",
"if",
"compatible",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/utils/hparam.py#L138-L183
|
train
|
Casts the value of a hparam to the provided type if compatible with the param_type.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_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tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x32' + chr(1505 - 1453) + chr(0b110010), 35677 - 35669), ehT0Px3KOsy9('\060' + chr(0b1000111 + 0o50) + chr(51), 58685 - 58677), ehT0Px3KOsy9(chr(0b110000) + chr(2714 - 2603) + '\x35' + chr(0b10111 + 0o33), 40224 - 40216), ehT0Px3KOsy9(chr(697 - 649) + chr(0b1101111) + chr(750 - 696) + chr(105 - 53), 0o10), ehT0Px3KOsy9(chr(1383 - 1335) + chr(8212 - 8101) + chr(49) + chr(0b110011) + chr(0b101101 + 0o5), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(1749 - 1698) + '\061' + chr(0b101111 + 0o7), 15303 - 15295), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110010) + chr(0b110100) + chr(0b10001 + 0o41), 8), ehT0Px3KOsy9(chr(48) + chr(10743 - 10632) + chr(0b110010), 0o10), ehT0Px3KOsy9(chr(1107 - 1059) + chr(111) + '\067' + chr(0b101001 + 0o13), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\062' + '\x37' + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(1729 - 1681) + chr(0b1010111 + 0o30) + '\062' + chr(0b110000) + chr(0b100011 + 0o16), 20150 - 20142), ehT0Px3KOsy9('\x30' + '\x6f' + '\x33' + chr(50) + chr(0b110111), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(10524 - 10413) + chr(0b110111) + chr(0b101101 + 0o11), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110001) + chr(1881 - 1829) + chr(2357 - 2303), 0b1000), ehT0Px3KOsy9(chr(1803 - 1755) + chr(7263 - 7152) + '\062' + chr(52), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110010) + chr(0b110000) + chr(49), 8), ehT0Px3KOsy9(chr(832 - 784) + '\157' + '\x31' + '\x33' + '\066', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(1157 - 1046) + chr(1532 - 1480), 0o10), ehT0Px3KOsy9(chr(1662 - 1614) + chr(0b1101111) + chr(2488 - 2437) + chr(1207 - 1152), 0o10), ehT0Px3KOsy9(chr(1096 - 1048) + '\x6f' + '\063' + '\061' + chr(2458 - 2405), 0o10), ehT0Px3KOsy9(chr(1804 - 1756) + chr(5313 - 5202) + chr(0b100 + 0o55) + chr(0b1010 + 0o53) + '\x35', 0o10), ehT0Px3KOsy9(chr(314 - 266) + chr(6847 - 6736) + chr(51) + '\x30' + '\060', 51775 - 51767), ehT0Px3KOsy9('\x30' + '\x6f' + '\x32' + chr(0b110100) + '\066', 0b1000), ehT0Px3KOsy9(chr(1294 - 1246) + chr(5957 - 5846) + chr(0b10001 + 0o40) + chr(0b110011) + chr(0b110011), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(2240 - 2191) + chr(0b111 + 0o53) + chr(0b101010 + 0o7), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(3847 - 3736) + chr(2225 - 2172) + '\x35', 58067 - 58059), ehT0Px3KOsy9('\060' + chr(0b11100 + 0o123) + chr(50) + '\065' + '\062', 0o10), ehT0Px3KOsy9(chr(1271 - 1223) + chr(0b1101111) + chr(0b110 + 0o60) + '\x32', 0b1000), ehT0Px3KOsy9(chr(810 - 762) + '\157' + '\x33' + chr(0b11 + 0o64), 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\062' + chr(0b11100 + 0o31) + chr(0b110000), 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(0b11100 + 0o27) + chr(888 - 839) + '\062', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(4603 - 4492) + '\x31' + chr(573 - 519) + chr(0b110011), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x33' + chr(0b11 + 0o64) + '\065', 0o10), ehT0Px3KOsy9(chr(2226 - 2178) + chr(111) + chr(650 - 599) + chr(1843 - 1789) + chr(51), 64470 - 64462), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110001) + chr(1945 - 1894) + '\x34', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b100011 + 0o114) + chr(0b111 + 0o52) + chr(0b1011 + 0o45) + chr(0b110110), 0b1000), ehT0Px3KOsy9(chr(534 - 486) + chr(0b1101111) + chr(51) + chr(1546 - 1495) + '\066', 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + '\065' + chr(0b110101), 8), ehT0Px3KOsy9('\x30' + '\157' + chr(50) + chr(877 - 828) + chr(48), 0b1000), ehT0Px3KOsy9(chr(0b10010 + 0o36) + '\x6f' + '\x32' + '\x34' + '\x35', 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + chr(111) + '\x35' + chr(48), ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x8c'), chr(469 - 369) + chr(6239 - 6138) + chr(0b100001 + 0o102) + chr(10731 - 10620) + '\144' + chr(1303 - 1202))(chr(0b1110101) + chr(116) + '\x66' + '\055' + '\070') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def VBzBO2ISE9N0(AIvJRzLdDfgF, LYEGMLiiZQHD, QmmgWUB13VCJ):
jqM6bLL6OqDG = xafqLlk3kkUe(SXOLrMavuUCe(b'\xe1l_X>\xee\xccmH\x9c\xe2\xb6M\x124\xe9.em\xac\x00\xe0\x81~"\n\x8a]y\x88\xbe\n\x8d\x96|a\xfb^\xaf\x85\xc4qEYz\xb8\xc3nI\xd9\xa1\xf2L'), chr(7696 - 7596) + '\x65' + chr(2896 - 2797) + '\x6f' + '\x64' + '\x65')('\165' + chr(1825 - 1709) + chr(6454 - 6352) + chr(0b1111 + 0o36) + '\070') % (AIvJRzLdDfgF, LYEGMLiiZQHD, QmmgWUB13VCJ)
if J6u1YyThfhgG(LYEGMLiiZQHD, wmQmyeWBmUpv(None)):
return QmmgWUB13VCJ
if J6u1YyThfhgG(LYEGMLiiZQHD, (xafqLlk3kkUe(sYby0kpfssd4, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd1wX]4\xa9\xfdvE\xcc\xe4\xa4'), chr(0b111 + 0o135) + chr(101) + chr(4764 - 4665) + '\x6f' + chr(0b100 + 0o140) + chr(10027 - 9926))(chr(0b1110101) + chr(7763 - 7647) + chr(0b111100 + 0o52) + '\x2d' + chr(1928 - 1872))), xafqLlk3kkUe(sYby0kpfssd4, xafqLlk3kkUe(SXOLrMavuUCe(b'\xc0jDU(\xb7\xfdvE\xcc\xe4'), chr(0b1100100) + '\145' + '\143' + '\157' + '\x64' + chr(0b1100101))(chr(0b1110 + 0o147) + chr(0b1110100) + chr(2916 - 2814) + chr(0b10 + 0o53) + chr(56))))) and (not PlSM16l2KDPD(QmmgWUB13VCJ, (xafqLlk3kkUe(sYby0kpfssd4, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd1wX]4\xa9\xfdvE\xcc\xe4\xa4'), '\x64' + '\x65' + chr(99) + chr(9754 - 9643) + '\x64' + '\145')(chr(5706 - 5589) + '\164' + '\x66' + chr(0b100101 + 0o10) + chr(56))), xafqLlk3kkUe(sYby0kpfssd4, xafqLlk3kkUe(SXOLrMavuUCe(b'\xc0jDU(\xb7\xfdvE\xcc\xe4'), chr(0b1010011 + 0o21) + '\x65' + chr(0b1010 + 0o131) + chr(9701 - 9590) + '\144' + '\145')('\x75' + chr(461 - 345) + '\146' + chr(45) + '\070'))))):
raise q1QCh3W88sgk(jqM6bLL6OqDG)
if J6u1YyThfhgG(LYEGMLiiZQHD, WbBjf8Y7v9VN) != PlSM16l2KDPD(QmmgWUB13VCJ, WbBjf8Y7v9VN):
raise q1QCh3W88sgk(jqM6bLL6OqDG)
if J6u1YyThfhgG(LYEGMLiiZQHD, xafqLlk3kkUe(uU3ppLOUY_t7, xafqLlk3kkUe(SXOLrMavuUCe(b'\xebm^Q=\xbc\xc3n'), '\144' + '\145' + '\143' + chr(0b1101111) + '\144' + chr(0b1100101))(chr(6260 - 6143) + '\x74' + '\146' + '\x2d' + '\070'))) and (not PlSM16l2KDPD(QmmgWUB13VCJ, xafqLlk3kkUe(uU3ppLOUY_t7, xafqLlk3kkUe(SXOLrMavuUCe(b'\xebm^Q=\xbc\xc3n'), chr(100) + chr(0b1100101) + chr(0b1100011) + chr(8412 - 8301) + chr(100) + chr(0b1100101))('\x75' + '\164' + chr(102) + chr(455 - 410) + '\x38')))):
raise q1QCh3W88sgk(jqM6bLL6OqDG)
if J6u1YyThfhgG(LYEGMLiiZQHD, xafqLlk3kkUe(uU3ppLOUY_t7, xafqLlk3kkUe(SXOLrMavuUCe(b'\xecvGV?\xbc'), chr(6955 - 6855) + chr(0b1100101) + '\143' + chr(7690 - 7579) + '\x64' + chr(0b1001000 + 0o35))(chr(117) + chr(4670 - 4554) + chr(0b1001101 + 0o31) + chr(45) + chr(216 - 160)))) and (not PlSM16l2KDPD(QmmgWUB13VCJ, xafqLlk3kkUe(uU3ppLOUY_t7, xafqLlk3kkUe(SXOLrMavuUCe(b'\xecvGV?\xbc'), '\x64' + chr(0b1100101) + chr(0b1100011) + chr(5150 - 5039) + chr(8811 - 8711) + '\x65')('\165' + chr(3990 - 3874) + '\146' + chr(0b101101) + chr(0b101010 + 0o16))))):
raise q1QCh3W88sgk(jqM6bLL6OqDG)
return LYEGMLiiZQHD(QmmgWUB13VCJ)
|
tensorflow/tensor2tensor
|
tensor2tensor/utils/hparam.py
|
parse_values
|
def parse_values(values, type_map, ignore_unknown=False):
"""Parses hyperparameter values from a string into a python map.
`values` is a string containing comma-separated `name=value` pairs.
For each pair, the value of the hyperparameter named `name` is set to
`value`.
If a hyperparameter name appears multiple times in `values`, a ValueError
is raised (e.g. 'a=1,a=2', 'a[1]=1,a[1]=2').
If a hyperparameter name in both an index assignment and scalar assignment,
a ValueError is raised. (e.g. 'a=[1,2,3],a[0] = 1').
The hyperparameter name may contain '.' symbols, which will result in an
attribute name that is only accessible through the getattr and setattr
functions. (And must be first explicit added through add_hparam.)
WARNING: Use of '.' in your variable names is allowed, but is not well
supported and not recommended.
The `value` in `name=value` must follows the syntax according to the
type of the parameter:
* Scalar integer: A Python-parsable integer point value. E.g.: 1,
100, -12.
* Scalar float: A Python-parsable floating point value. E.g.: 1.0,
-.54e89.
* Boolean: Either true or false.
* Scalar string: A non-empty sequence of characters, excluding comma,
spaces, and square brackets. E.g.: foo, bar_1.
* List: A comma separated list of scalar values of the parameter type
enclosed in square brackets. E.g.: [1,2,3], [1.0,1e-12], [high,low].
When index assignment is used, the corresponding type_map key should be the
list name. E.g. for "arr[1]=0" the type_map must have the key "arr" (not
"arr[1]").
Args:
values: String. Comma separated list of `name=value` pairs where
'value' must follow the syntax described above.
type_map: A dictionary mapping hyperparameter names to types. Note every
parameter name in values must be a key in type_map. The values must
conform to the types indicated, where a value V is said to conform to a
type T if either V has type T, or V is a list of elements of type T.
Hence, for a multidimensional parameter 'x' taking float values,
'x=[0.1,0.2]' will parse successfully if type_map['x'] = float.
ignore_unknown: Bool. Whether values that are missing a type in type_map
should be ignored. If set to True, a ValueError will not be raised for
unknown hyperparameter type.
Returns:
A python map mapping each name to either:
* A scalar value.
* A list of scalar values.
* A dictionary mapping index numbers to scalar values.
(e.g. "x=5,L=[1,2],arr[1]=3" results in {'x':5,'L':[1,2],'arr':{1:3}}")
Raises:
ValueError: If there is a problem with input.
* If `values` cannot be parsed.
* If a list is assigned to a list index (e.g. 'a[1] = [1,2,3]').
* If the same rvalue is assigned two different values (e.g. 'a=1,a=2',
'a[1]=1,a[1]=2', or 'a=1,a=[1]')
"""
results_dictionary = {}
pos = 0
while pos < len(values):
m = PARAM_RE.match(values, pos)
if not m:
raise ValueError('Malformed hyperparameter value: %s' % values[pos:])
# Check that there is a comma between parameters and move past it.
pos = m.end()
# Parse the values.
m_dict = m.groupdict()
name = m_dict['name']
if name not in type_map:
if ignore_unknown:
continue
raise ValueError('Unknown hyperparameter type for %s' % name)
type_ = type_map[name]
# Set up correct parsing function (depending on whether type_ is a bool)
if type_ == bool:
def parse_bool(value):
if value in ['true', 'True']:
return True
elif value in ['false', 'False']:
return False
else:
try:
return bool(int(value))
except ValueError:
_parse_fail(name, type_, value, values)
parse = parse_bool
else:
parse = type_
# If a singe value is provided
if m_dict['val'] is not None:
_process_scalar_value(name, parse, type_, m_dict, values,
results_dictionary)
# If the assigned value is a list:
elif m_dict['vals'] is not None:
_process_list_value(name, parse, type_, m_dict, values,
results_dictionary)
else: # Not assigned a list or value
_parse_fail(name, type_, '', values)
return results_dictionary
|
python
|
def parse_values(values, type_map, ignore_unknown=False):
"""Parses hyperparameter values from a string into a python map.
`values` is a string containing comma-separated `name=value` pairs.
For each pair, the value of the hyperparameter named `name` is set to
`value`.
If a hyperparameter name appears multiple times in `values`, a ValueError
is raised (e.g. 'a=1,a=2', 'a[1]=1,a[1]=2').
If a hyperparameter name in both an index assignment and scalar assignment,
a ValueError is raised. (e.g. 'a=[1,2,3],a[0] = 1').
The hyperparameter name may contain '.' symbols, which will result in an
attribute name that is only accessible through the getattr and setattr
functions. (And must be first explicit added through add_hparam.)
WARNING: Use of '.' in your variable names is allowed, but is not well
supported and not recommended.
The `value` in `name=value` must follows the syntax according to the
type of the parameter:
* Scalar integer: A Python-parsable integer point value. E.g.: 1,
100, -12.
* Scalar float: A Python-parsable floating point value. E.g.: 1.0,
-.54e89.
* Boolean: Either true or false.
* Scalar string: A non-empty sequence of characters, excluding comma,
spaces, and square brackets. E.g.: foo, bar_1.
* List: A comma separated list of scalar values of the parameter type
enclosed in square brackets. E.g.: [1,2,3], [1.0,1e-12], [high,low].
When index assignment is used, the corresponding type_map key should be the
list name. E.g. for "arr[1]=0" the type_map must have the key "arr" (not
"arr[1]").
Args:
values: String. Comma separated list of `name=value` pairs where
'value' must follow the syntax described above.
type_map: A dictionary mapping hyperparameter names to types. Note every
parameter name in values must be a key in type_map. The values must
conform to the types indicated, where a value V is said to conform to a
type T if either V has type T, or V is a list of elements of type T.
Hence, for a multidimensional parameter 'x' taking float values,
'x=[0.1,0.2]' will parse successfully if type_map['x'] = float.
ignore_unknown: Bool. Whether values that are missing a type in type_map
should be ignored. If set to True, a ValueError will not be raised for
unknown hyperparameter type.
Returns:
A python map mapping each name to either:
* A scalar value.
* A list of scalar values.
* A dictionary mapping index numbers to scalar values.
(e.g. "x=5,L=[1,2],arr[1]=3" results in {'x':5,'L':[1,2],'arr':{1:3}}")
Raises:
ValueError: If there is a problem with input.
* If `values` cannot be parsed.
* If a list is assigned to a list index (e.g. 'a[1] = [1,2,3]').
* If the same rvalue is assigned two different values (e.g. 'a=1,a=2',
'a[1]=1,a[1]=2', or 'a=1,a=[1]')
"""
results_dictionary = {}
pos = 0
while pos < len(values):
m = PARAM_RE.match(values, pos)
if not m:
raise ValueError('Malformed hyperparameter value: %s' % values[pos:])
# Check that there is a comma between parameters and move past it.
pos = m.end()
# Parse the values.
m_dict = m.groupdict()
name = m_dict['name']
if name not in type_map:
if ignore_unknown:
continue
raise ValueError('Unknown hyperparameter type for %s' % name)
type_ = type_map[name]
# Set up correct parsing function (depending on whether type_ is a bool)
if type_ == bool:
def parse_bool(value):
if value in ['true', 'True']:
return True
elif value in ['false', 'False']:
return False
else:
try:
return bool(int(value))
except ValueError:
_parse_fail(name, type_, value, values)
parse = parse_bool
else:
parse = type_
# If a singe value is provided
if m_dict['val'] is not None:
_process_scalar_value(name, parse, type_, m_dict, values,
results_dictionary)
# If the assigned value is a list:
elif m_dict['vals'] is not None:
_process_list_value(name, parse, type_, m_dict, values,
results_dictionary)
else: # Not assigned a list or value
_parse_fail(name, type_, '', values)
return results_dictionary
|
[
"def",
"parse_values",
"(",
"values",
",",
"type_map",
",",
"ignore_unknown",
"=",
"False",
")",
":",
"results_dictionary",
"=",
"{",
"}",
"pos",
"=",
"0",
"while",
"pos",
"<",
"len",
"(",
"values",
")",
":",
"m",
"=",
"PARAM_RE",
".",
"match",
"(",
"values",
",",
"pos",
")",
"if",
"not",
"m",
":",
"raise",
"ValueError",
"(",
"'Malformed hyperparameter value: %s'",
"%",
"values",
"[",
"pos",
":",
"]",
")",
"# Check that there is a comma between parameters and move past it.",
"pos",
"=",
"m",
".",
"end",
"(",
")",
"# Parse the values.",
"m_dict",
"=",
"m",
".",
"groupdict",
"(",
")",
"name",
"=",
"m_dict",
"[",
"'name'",
"]",
"if",
"name",
"not",
"in",
"type_map",
":",
"if",
"ignore_unknown",
":",
"continue",
"raise",
"ValueError",
"(",
"'Unknown hyperparameter type for %s'",
"%",
"name",
")",
"type_",
"=",
"type_map",
"[",
"name",
"]",
"# Set up correct parsing function (depending on whether type_ is a bool)",
"if",
"type_",
"==",
"bool",
":",
"def",
"parse_bool",
"(",
"value",
")",
":",
"if",
"value",
"in",
"[",
"'true'",
",",
"'True'",
"]",
":",
"return",
"True",
"elif",
"value",
"in",
"[",
"'false'",
",",
"'False'",
"]",
":",
"return",
"False",
"else",
":",
"try",
":",
"return",
"bool",
"(",
"int",
"(",
"value",
")",
")",
"except",
"ValueError",
":",
"_parse_fail",
"(",
"name",
",",
"type_",
",",
"value",
",",
"values",
")",
"parse",
"=",
"parse_bool",
"else",
":",
"parse",
"=",
"type_",
"# If a singe value is provided",
"if",
"m_dict",
"[",
"'val'",
"]",
"is",
"not",
"None",
":",
"_process_scalar_value",
"(",
"name",
",",
"parse",
",",
"type_",
",",
"m_dict",
",",
"values",
",",
"results_dictionary",
")",
"# If the assigned value is a list:",
"elif",
"m_dict",
"[",
"'vals'",
"]",
"is",
"not",
"None",
":",
"_process_list_value",
"(",
"name",
",",
"parse",
",",
"type_",
",",
"m_dict",
",",
"values",
",",
"results_dictionary",
")",
"else",
":",
"# Not assigned a list or value",
"_parse_fail",
"(",
"name",
",",
"type_",
",",
"''",
",",
"values",
")",
"return",
"results_dictionary"
] |
Parses hyperparameter values from a string into a python map.
`values` is a string containing comma-separated `name=value` pairs.
For each pair, the value of the hyperparameter named `name` is set to
`value`.
If a hyperparameter name appears multiple times in `values`, a ValueError
is raised (e.g. 'a=1,a=2', 'a[1]=1,a[1]=2').
If a hyperparameter name in both an index assignment and scalar assignment,
a ValueError is raised. (e.g. 'a=[1,2,3],a[0] = 1').
The hyperparameter name may contain '.' symbols, which will result in an
attribute name that is only accessible through the getattr and setattr
functions. (And must be first explicit added through add_hparam.)
WARNING: Use of '.' in your variable names is allowed, but is not well
supported and not recommended.
The `value` in `name=value` must follows the syntax according to the
type of the parameter:
* Scalar integer: A Python-parsable integer point value. E.g.: 1,
100, -12.
* Scalar float: A Python-parsable floating point value. E.g.: 1.0,
-.54e89.
* Boolean: Either true or false.
* Scalar string: A non-empty sequence of characters, excluding comma,
spaces, and square brackets. E.g.: foo, bar_1.
* List: A comma separated list of scalar values of the parameter type
enclosed in square brackets. E.g.: [1,2,3], [1.0,1e-12], [high,low].
When index assignment is used, the corresponding type_map key should be the
list name. E.g. for "arr[1]=0" the type_map must have the key "arr" (not
"arr[1]").
Args:
values: String. Comma separated list of `name=value` pairs where
'value' must follow the syntax described above.
type_map: A dictionary mapping hyperparameter names to types. Note every
parameter name in values must be a key in type_map. The values must
conform to the types indicated, where a value V is said to conform to a
type T if either V has type T, or V is a list of elements of type T.
Hence, for a multidimensional parameter 'x' taking float values,
'x=[0.1,0.2]' will parse successfully if type_map['x'] = float.
ignore_unknown: Bool. Whether values that are missing a type in type_map
should be ignored. If set to True, a ValueError will not be raised for
unknown hyperparameter type.
Returns:
A python map mapping each name to either:
* A scalar value.
* A list of scalar values.
* A dictionary mapping index numbers to scalar values.
(e.g. "x=5,L=[1,2],arr[1]=3" results in {'x':5,'L':[1,2],'arr':{1:3}}")
Raises:
ValueError: If there is a problem with input.
* If `values` cannot be parsed.
* If a list is assigned to a list index (e.g. 'a[1] = [1,2,3]').
* If the same rvalue is assigned two different values (e.g. 'a=1,a=2',
'a[1]=1,a[1]=2', or 'a=1,a=[1]')
|
[
"Parses",
"hyperparameter",
"values",
"from",
"a",
"string",
"into",
"a",
"python",
"map",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/utils/hparam.py#L186-L298
|
train
|
Parses a string containing comma - separated name = value pairs into a python map.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlP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dP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110101), 0b1000), ehT0Px3KOsy9(chr(55 - 7) + chr(3536 - 3425) + '\x32' + chr(0b110101 + 0o2), 40369 - 40361), ehT0Px3KOsy9(chr(2294 - 2246) + '\x6f' + chr(0b110010) + '\061' + chr(0b10100 + 0o35), ord("\x08")), ehT0Px3KOsy9(chr(0b101011 + 0o5) + chr(111) + chr(49) + chr(309 - 258) + '\066', 0b1000), ehT0Px3KOsy9(chr(0b1001 + 0o47) + '\x6f' + chr(0b110001) + chr(0b110100) + '\x37', 0o10), ehT0Px3KOsy9(chr(0b101111 + 0o1) + chr(111) + '\062' + chr(0b110000) + '\x33', 5315 - 5307), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110010) + chr(0b11000 + 0o32) + chr(1968 - 1919), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x33' + chr(895 - 846) + chr(0b110001), 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(49) + chr(2063 - 2010) + chr(0b1101 + 0o52), 0b1000), ehT0Px3KOsy9('\060' + '\157' + '\062' + chr(50) + '\066', 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\063' + chr(48), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110001) + chr(0b11111 + 0o27) + chr(0b110110), 0o10), ehT0Px3KOsy9(chr(1080 - 1032) + chr(0b1101111) + chr(2390 - 2340) + chr(0b10110 + 0o34) + chr(0b110101), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(11373 - 11262) + '\x31' + chr(0b1101 + 0o46) + '\x36', 8), ehT0Px3KOsy9(chr(48) + '\x6f' + '\061' + '\064' + chr(55), 8), ehT0Px3KOsy9('\060' + chr(111) + '\x33' + '\066' + chr(0b110000), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(2353 - 2302) + chr(122 - 74) + chr(2279 - 2230), ord("\x08")), ehT0Px3KOsy9(chr(1802 - 1754) + chr(0b10111 + 0o130) + '\x31' + chr(52) + chr(49), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(1337 - 1282) + '\x35', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(4428 - 4317) + '\x33' + '\066' + '\x31', 18398 - 18390), ehT0Px3KOsy9('\060' + chr(2017 - 1906) + '\x33' + '\066' + chr(49), 8), ehT0Px3KOsy9(chr(48) + chr(0b1011011 + 0o24) + chr(199 - 150) + '\x30' + chr(2335 - 2286), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x32' + '\x32', 9181 - 9173), ehT0Px3KOsy9(chr(0b10101 + 0o33) + '\157' + chr(51) + chr(0b101010 + 0o7) + '\x37', 42934 - 42926), ehT0Px3KOsy9(chr(1486 - 1438) + chr(8017 - 7906) + chr(0b10 + 0o61) + '\x30' + chr(0b1 + 0o63), 40727 - 40719), ehT0Px3KOsy9(chr(0b110000) + chr(0b1001011 + 0o44) + chr(1908 - 1857) + chr(0b110000), 8), ehT0Px3KOsy9(chr(0b100000 + 0o20) + chr(0b1101111) + chr(0b110111) + '\065', 8), ehT0Px3KOsy9(chr(2240 - 2192) + chr(111) + chr(1211 - 1160) + chr(0b110001) + '\x31', 8), ehT0Px3KOsy9(chr(2239 - 2191) + '\157' + chr(0b10110 + 0o34) + chr(48) + '\x37', 37358 - 37350), ehT0Px3KOsy9(chr(725 - 677) + '\x6f' + '\x32' + '\x32' + chr(0b110111), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\061' + '\064' + chr(332 - 284), 0b1000), ehT0Px3KOsy9(chr(0b101101 + 0o3) + '\157' + chr(0b10010 + 0o41) + '\x33' + chr(0b100101 + 0o14), 0b1000), ehT0Px3KOsy9(chr(433 - 385) + '\x6f' + chr(0b1010 + 0o47) + chr(0b110010) + '\062', 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110011) + chr(0b1011 + 0o45) + chr(0b101001 + 0o12), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\061' + chr(48) + chr(50), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b10100 + 0o37) + chr(50) + chr(0b101001 + 0o7), 0o10), ehT0Px3KOsy9('\x30' + chr(7506 - 7395) + chr(437 - 387) + chr(0b100111 + 0o20) + chr(2518 - 2467), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(54) + chr(52), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(51) + chr(1171 - 1117), 0o10), ehT0Px3KOsy9(chr(1449 - 1401) + '\157' + chr(0b110001) + chr(0b100100 + 0o22) + chr(0b101110 + 0o2), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + '\x6f' + '\065' + chr(489 - 441), 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'+'), chr(100) + chr(101) + chr(0b1100011) + chr(0b1101111) + '\144' + '\x65')(chr(0b11010 + 0o133) + '\x74' + '\x66' + '\x2d' + chr(3107 - 3051)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def vdq1MCeKb7Lg(SPnCNu54H1db, OUd2MptGD0Z_, Df8YRFzbeBf9=ehT0Px3KOsy9(chr(0b100011 + 0o15) + chr(12107 - 11996) + chr(48), ord("\x08"))):
SRegsHHDvofC = {}
NXd0aqYJd4lK = ehT0Px3KOsy9('\060' + chr(8099 - 7988) + '\x30', 8)
while NXd0aqYJd4lK < c2A0yzQpDQB3(SPnCNu54H1db):
r8ufID9JCHnI = eMXc2rnhVlRU.match(SPnCNu54H1db, NXd0aqYJd4lK)
if not r8ufID9JCHnI:
raise q1QCh3W88sgk(xafqLlk3kkUe(SXOLrMavuUCe(b'Hv\xe58\x08\xf1\xfc\xac\x0b\xb6p\x0f\xe5;\x15\x80\xa0\x13\\\x9c\x945w\xbd\xe4n\\\xa5\xf2\xf2Z\xf9w\xb0'), '\144' + '\x65' + chr(0b1100011) + chr(111) + '\x64' + chr(1321 - 1220))(chr(0b1101011 + 0o12) + chr(0b1110100) + '\x66' + '\055' + '\x38') % SPnCNu54H1db[NXd0aqYJd4lK:])
NXd0aqYJd4lK = r8ufID9JCHnI.whWDZq5_lP01()
owtF381uQ0Ga = r8ufID9JCHnI.groupdict()
AIvJRzLdDfgF = owtF381uQ0Ga[xafqLlk3kkUe(SXOLrMavuUCe(b'kv\xe4;'), chr(0b111110 + 0o46) + chr(101) + chr(8178 - 8079) + chr(11130 - 11019) + chr(0b110100 + 0o60) + chr(0b1100101))(chr(117) + '\164' + chr(5530 - 5428) + chr(45) + '\x38')]
if AIvJRzLdDfgF not in OUd2MptGD0Z_:
if Df8YRFzbeBf9:
continue
raise q1QCh3W88sgk(xafqLlk3kkUe(SXOLrMavuUCe(b'Py\xe20\x08\xf4\xff\xe9\x07\xefh\x13\xe7.\x06\x82\xa0\x0cX\x85\x9432\xbb\xbdhX\xe9\xe1\xf8\x12\xf9w\xb0'), '\x64' + chr(0b1100101) + '\143' + chr(0b100000 + 0o117) + '\144' + chr(0b1100101))('\x75' + '\x74' + chr(3192 - 3090) + chr(0b101101) + chr(0b10101 + 0o43)) % AIvJRzLdDfgF)
wglhj4WQZuCT = OUd2MptGD0Z_[AIvJRzLdDfgF]
if wglhj4WQZuCT == WbBjf8Y7v9VN:
def GNyvpI7ZuV8e(QmmgWUB13VCJ):
if QmmgWUB13VCJ in [xafqLlk3kkUe(SXOLrMavuUCe(b'qe\xfc;'), '\144' + chr(0b1100101) + chr(7424 - 7325) + chr(0b1101111) + '\144' + chr(0b1100101))(chr(117) + '\164' + chr(0b11001 + 0o115) + '\055' + '\x38'), xafqLlk3kkUe(SXOLrMavuUCe(b'Qe\xfc;'), chr(1740 - 1640) + chr(0b1100100 + 0o1) + chr(0b1010110 + 0o15) + chr(0b1101111) + chr(0b1100100) + '\145')(chr(1297 - 1180) + chr(116) + chr(0b111101 + 0o51) + chr(0b11011 + 0o22) + '\x38')]:
return ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110001), 0b1000)
elif QmmgWUB13VCJ in [xafqLlk3kkUe(SXOLrMavuUCe(b'cv\xe5-\x02'), '\x64' + '\x65' + chr(99) + chr(0b1101111) + chr(9352 - 9252) + chr(0b1100101))('\165' + chr(0b1110100) + chr(102) + chr(45) + '\070'), xafqLlk3kkUe(SXOLrMavuUCe(b'Cv\xe5-\x02'), '\144' + chr(101) + chr(6120 - 6021) + chr(111) + '\144' + '\145')(chr(117) + chr(0b1110100) + chr(0b1111 + 0o127) + chr(45) + chr(0b1010 + 0o56))]:
return ehT0Px3KOsy9(chr(48) + '\157' + '\x30', 8)
else:
try:
return WbBjf8Y7v9VN(ehT0Px3KOsy9(QmmgWUB13VCJ))
except q1QCh3W88sgk:
etitvxrZ4RBK(AIvJRzLdDfgF, wglhj4WQZuCT, QmmgWUB13VCJ, SPnCNu54H1db)
d0cNSJFV4IQI = GNyvpI7ZuV8e
else:
d0cNSJFV4IQI = wglhj4WQZuCT
if owtF381uQ0Ga[xafqLlk3kkUe(SXOLrMavuUCe(b'sv\xe5'), '\x64' + '\145' + '\x63' + '\157' + chr(5229 - 5129) + '\x65')('\165' + chr(0b1001111 + 0o45) + '\146' + '\055' + '\x38')] is not None:
s2pVaUlXRqp1(AIvJRzLdDfgF, d0cNSJFV4IQI, wglhj4WQZuCT, owtF381uQ0Ga, SPnCNu54H1db, SRegsHHDvofC)
elif owtF381uQ0Ga[xafqLlk3kkUe(SXOLrMavuUCe(b'sv\xe5-'), chr(3445 - 3345) + chr(0b10001 + 0o124) + '\x63' + chr(0b110011 + 0o74) + '\x64' + '\145')(chr(0b10101 + 0o140) + '\164' + '\146' + chr(45) + chr(56))] is not None:
ilEp5I9h8Mwb(AIvJRzLdDfgF, d0cNSJFV4IQI, wglhj4WQZuCT, owtF381uQ0Ga, SPnCNu54H1db, SRegsHHDvofC)
else:
etitvxrZ4RBK(AIvJRzLdDfgF, wglhj4WQZuCT, xafqLlk3kkUe(SXOLrMavuUCe(b''), chr(0b1100011 + 0o1) + '\x65' + '\x63' + '\157' + '\144' + '\145')(chr(0b100010 + 0o123) + chr(116) + chr(2942 - 2840) + '\x2d' + '\070'), SPnCNu54H1db)
return SRegsHHDvofC
|
tensorflow/tensor2tensor
|
tensor2tensor/utils/hparam.py
|
HParams.add_hparam
|
def add_hparam(self, name, value):
"""Adds {name, value} pair to hyperparameters.
Args:
name: Name of the hyperparameter.
value: Value of the hyperparameter. Can be one of the following types:
int, float, string, int list, float list, or string list.
Raises:
ValueError: if one of the arguments is invalid.
"""
# Keys in kwargs are unique, but 'name' could the name of a pre-existing
# attribute of this object. In that case we refuse to use it as a
# hyperparameter name.
if getattr(self, name, None) is not None:
raise ValueError('Hyperparameter name is reserved: %s' % name)
if isinstance(value, (list, tuple)):
if not value:
raise ValueError(
'Multi-valued hyperparameters cannot be empty: %s' % name)
self._hparam_types[name] = (type(value[0]), True)
else:
self._hparam_types[name] = (type(value), False)
setattr(self, name, value)
|
python
|
def add_hparam(self, name, value):
"""Adds {name, value} pair to hyperparameters.
Args:
name: Name of the hyperparameter.
value: Value of the hyperparameter. Can be one of the following types:
int, float, string, int list, float list, or string list.
Raises:
ValueError: if one of the arguments is invalid.
"""
# Keys in kwargs are unique, but 'name' could the name of a pre-existing
# attribute of this object. In that case we refuse to use it as a
# hyperparameter name.
if getattr(self, name, None) is not None:
raise ValueError('Hyperparameter name is reserved: %s' % name)
if isinstance(value, (list, tuple)):
if not value:
raise ValueError(
'Multi-valued hyperparameters cannot be empty: %s' % name)
self._hparam_types[name] = (type(value[0]), True)
else:
self._hparam_types[name] = (type(value), False)
setattr(self, name, value)
|
[
"def",
"add_hparam",
"(",
"self",
",",
"name",
",",
"value",
")",
":",
"# Keys in kwargs are unique, but 'name' could the name of a pre-existing",
"# attribute of this object. In that case we refuse to use it as a",
"# hyperparameter name.",
"if",
"getattr",
"(",
"self",
",",
"name",
",",
"None",
")",
"is",
"not",
"None",
":",
"raise",
"ValueError",
"(",
"'Hyperparameter name is reserved: %s'",
"%",
"name",
")",
"if",
"isinstance",
"(",
"value",
",",
"(",
"list",
",",
"tuple",
")",
")",
":",
"if",
"not",
"value",
":",
"raise",
"ValueError",
"(",
"'Multi-valued hyperparameters cannot be empty: %s'",
"%",
"name",
")",
"self",
".",
"_hparam_types",
"[",
"name",
"]",
"=",
"(",
"type",
"(",
"value",
"[",
"0",
"]",
")",
",",
"True",
")",
"else",
":",
"self",
".",
"_hparam_types",
"[",
"name",
"]",
"=",
"(",
"type",
"(",
"value",
")",
",",
"False",
")",
"setattr",
"(",
"self",
",",
"name",
",",
"value",
")"
] |
Adds {name, value} pair to hyperparameters.
Args:
name: Name of the hyperparameter.
value: Value of the hyperparameter. Can be one of the following types:
int, float, string, int list, float list, or string list.
Raises:
ValueError: if one of the arguments is invalid.
|
[
"Adds",
"{",
"name",
"value",
"}",
"pair",
"to",
"hyperparameters",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/utils/hparam.py#L418-L441
|
train
|
Adds a { name value pair to the internal list of hyperparameters.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDASQ0Qkq,NL8dtWOpbcjF,_bikzMuRfbJG,sznFqDbNBHlx,ZsDPvpP4xdo3,cW7yQuyEnJ6E,KOHQGQ8qLDWm,NE1Yam2HHroQ,ygAzbDzrvRMh,SBRjvOU1ufVC,hOkXjmluKZfJ,q1QCh3W88sgk,TLbJ60djyws0,rIcPej9ZqMqV,WTxpD_zsEOh2,LgE_IO_tHXv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G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b10100 + 0o35) + '\061', 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110001), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + '\063' + chr(53) + chr(0b110111), 0b1000), ehT0Px3KOsy9(chr(1379 - 1331) + chr(111) + chr(0b100010 + 0o21) + chr(0b110100) + '\x33', 19262 - 19254), ehT0Px3KOsy9(chr(0b100100 + 0o14) + chr(111) + chr(0b110010) + chr(601 - 551) + '\x36', 52462 - 52454), ehT0Px3KOsy9(chr(0b1001 + 0o47) + chr(0b111011 + 0o64) + chr(0b10111 + 0o32) + chr(301 - 251) + chr(0b11101 + 0o30), ord("\x08")), ehT0Px3KOsy9('\060' + chr(6438 - 6327) + '\x33' + '\x36' + '\060', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b101011 + 0o7) + chr(1737 - 1687) + chr(0b11011 + 0o26), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x31' + chr(102 - 52) + chr(0b101010 + 0o12), ord("\x08")), ehT0Px3KOsy9(chr(1664 - 1616) + chr(2329 - 2218) + '\x31' + chr(0b110110) + chr(51), ord("\x08")), ehT0Px3KOsy9(chr(178 - 130) + chr(0b1001010 + 0o45) + chr(49) + chr(1859 - 1811) + chr(48), 45320 - 45312), ehT0Px3KOsy9(chr(1695 - 1647) + chr(111) + chr(1976 - 1923) + chr(0b110110), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1100010 + 0o15) + chr(0b101 + 0o56) + chr(0b11010 + 0o27) + chr(0b10001 + 0o42), 20340 - 20332), ehT0Px3KOsy9(chr(0b101010 + 0o6) + chr(0b1101111) + '\061' + chr(0b100000 + 0o23) + chr(0b1010 + 0o55), 0o10), ehT0Px3KOsy9('\x30' + chr(0b10 + 0o155) + chr(166 - 117) + '\060' + chr(48), 8), ehT0Px3KOsy9('\060' + '\157' + chr(0b10101 + 0o36) + chr(1274 - 1219) + chr(0b100100 + 0o16), 59387 - 59379), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x33' + chr(0b110011) + chr(0b110101 + 0o2), 0b1000), ehT0Px3KOsy9(chr(48) + chr(9771 - 9660) + chr(0b110011) + '\x37' + '\x34', ord("\x08")), ehT0Px3KOsy9(chr(1399 - 1351) + chr(111) + chr(0b1000 + 0o53) + chr(55) + '\x34', 8), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x33' + '\062' + chr(52), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b11000 + 0o32) + chr(2024 - 1969), 0o10), ehT0Px3KOsy9(chr(0b1100 + 0o44) + '\157' + chr(0b101100 + 0o6) + '\x33' + chr(0b101100 + 0o6), 0o10), ehT0Px3KOsy9(chr(0b110 + 0o52) + chr(1567 - 1456) + chr(933 - 882) + chr(716 - 668) + chr(530 - 478), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(49) + '\x31' + chr(0b110110), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1010100 + 0o33) + chr(53), 18870 - 18862), ehT0Px3KOsy9(chr(48) + chr(7880 - 7769) + chr(662 - 613) + chr(51) + chr(2086 - 2035), 0o10), ehT0Px3KOsy9('\060' + chr(2578 - 2467) + chr(0b110011) + '\065' + chr(0b110000), 46816 - 46808), ehT0Px3KOsy9('\x30' + chr(0b111010 + 0o65) + chr(49) + chr(0b110101) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(652 - 604) + '\157' + chr(1434 - 1385) + chr(59 - 8) + chr(54), 50830 - 50822), ehT0Px3KOsy9('\x30' + '\x6f' + '\063' + chr(1160 - 1105) + '\x35', 5760 - 5752), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(925 - 875) + '\066' + chr(55), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x33' + '\x32' + chr(0b10101 + 0o37), 8), ehT0Px3KOsy9('\x30' + chr(9926 - 9815) + chr(1536 - 1487) + chr(0b110111) + chr(0b110111), 30495 - 30487), ehT0Px3KOsy9('\060' + '\x6f' + '\062' + chr(0b110101) + chr(49), 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110001) + '\062' + chr(1079 - 1027), 8), ehT0Px3KOsy9(chr(1364 - 1316) + '\157' + '\x31' + '\x34' + chr(0b110100), 34490 - 34482), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110010) + chr(0b110100) + chr(0b110010), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(1090 - 979) + '\x37' + chr(0b110110), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110010) + chr(66 - 12), 47600 - 47592), ehT0Px3KOsy9(chr(1379 - 1331) + chr(0b1101111) + chr(0b110011) + '\x31' + chr(0b110010 + 0o3), 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110101) + chr(0b10001 + 0o37), ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b"'"), '\144' + chr(0b1000 + 0o135) + chr(0b1100011) + chr(0b1101111) + '\144' + chr(0b1100101))(chr(117) + chr(11621 - 11505) + chr(1595 - 1493) + chr(0b101010 + 0o3) + '\070') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def K4q6MV2KKbKZ(oVre8I6UXc3b, AIvJRzLdDfgF, QmmgWUB13VCJ):
if xafqLlk3kkUe(oVre8I6UXc3b, AIvJRzLdDfgF, None) is not None:
raise q1QCh3W88sgk(xafqLlk3kkUe(SXOLrMavuUCe(b"Ax\x9f\x86\xe4%\x91\xe35\x1e%Z\xae-`\x94\xbe\x91\x99\xf4~\xe9\xe4<`(\x8d\x1d(\x98\xd3\xee_\x8c'"), '\144' + chr(2745 - 2644) + '\x63' + chr(111) + chr(789 - 689) + chr(101))('\x75' + '\x74' + chr(2997 - 2895) + '\x2d' + '\070') % AIvJRzLdDfgF)
if PlSM16l2KDPD(QmmgWUB13VCJ, (YyaZ4tpXu4lf, KNyTy8rYcwji)):
if not QmmgWUB13VCJ:
raise q1QCh3W88sgk(xafqLlk3kkUe(SXOLrMavuUCe(b'Dt\x83\x97\xffx\x86\xf08\x06%J\xeb79\x8a\xba\x8e\x8c\xb5e\xfb\xa9+q>\x9a\x1c~\x9e\xd6\xba\x11\xc6 D\xc0[6\xa8dq\x9b\x9a\xacu\xd5\xe2'), chr(0b110011 + 0o61) + '\x65' + chr(0b1100011) + '\157' + chr(5732 - 5632) + chr(131 - 30))('\x75' + '\164' + '\146' + '\x2d' + '\x38') % AIvJRzLdDfgF)
oVre8I6UXc3b.SoixjuebFHDM[AIvJRzLdDfgF] = (wmQmyeWBmUpv(QmmgWUB13VCJ[ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(48), 0o10)]), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(767 - 718), 8))
else:
oVre8I6UXc3b.SoixjuebFHDM[AIvJRzLdDfgF] = (wmQmyeWBmUpv(QmmgWUB13VCJ), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b101010 + 0o6), 8))
t0rOMsrOC7R_(oVre8I6UXc3b, AIvJRzLdDfgF, QmmgWUB13VCJ)
|
tensorflow/tensor2tensor
|
tensor2tensor/utils/hparam.py
|
HParams.set_hparam
|
def set_hparam(self, name, value):
"""Set the value of an existing hyperparameter.
This function verifies that the type of the value matches the type of the
existing hyperparameter.
Args:
name: Name of the hyperparameter.
value: New value of the hyperparameter.
Raises:
KeyError: If the hyperparameter doesn't exist.
ValueError: If there is a type mismatch.
"""
param_type, is_list = self._hparam_types[name]
if isinstance(value, list):
if not is_list:
raise ValueError(
'Must not pass a list for single-valued parameter: %s' % name)
setattr(self, name, [
_cast_to_type_if_compatible(name, param_type, v) for v in value])
else:
if is_list:
raise ValueError(
'Must pass a list for multi-valued parameter: %s.' % name)
setattr(self, name, _cast_to_type_if_compatible(name, param_type, value))
|
python
|
def set_hparam(self, name, value):
"""Set the value of an existing hyperparameter.
This function verifies that the type of the value matches the type of the
existing hyperparameter.
Args:
name: Name of the hyperparameter.
value: New value of the hyperparameter.
Raises:
KeyError: If the hyperparameter doesn't exist.
ValueError: If there is a type mismatch.
"""
param_type, is_list = self._hparam_types[name]
if isinstance(value, list):
if not is_list:
raise ValueError(
'Must not pass a list for single-valued parameter: %s' % name)
setattr(self, name, [
_cast_to_type_if_compatible(name, param_type, v) for v in value])
else:
if is_list:
raise ValueError(
'Must pass a list for multi-valued parameter: %s.' % name)
setattr(self, name, _cast_to_type_if_compatible(name, param_type, value))
|
[
"def",
"set_hparam",
"(",
"self",
",",
"name",
",",
"value",
")",
":",
"param_type",
",",
"is_list",
"=",
"self",
".",
"_hparam_types",
"[",
"name",
"]",
"if",
"isinstance",
"(",
"value",
",",
"list",
")",
":",
"if",
"not",
"is_list",
":",
"raise",
"ValueError",
"(",
"'Must not pass a list for single-valued parameter: %s'",
"%",
"name",
")",
"setattr",
"(",
"self",
",",
"name",
",",
"[",
"_cast_to_type_if_compatible",
"(",
"name",
",",
"param_type",
",",
"v",
")",
"for",
"v",
"in",
"value",
"]",
")",
"else",
":",
"if",
"is_list",
":",
"raise",
"ValueError",
"(",
"'Must pass a list for multi-valued parameter: %s.'",
"%",
"name",
")",
"setattr",
"(",
"self",
",",
"name",
",",
"_cast_to_type_if_compatible",
"(",
"name",
",",
"param_type",
",",
"value",
")",
")"
] |
Set the value of an existing hyperparameter.
This function verifies that the type of the value matches the type of the
existing hyperparameter.
Args:
name: Name of the hyperparameter.
value: New value of the hyperparameter.
Raises:
KeyError: If the hyperparameter doesn't exist.
ValueError: If there is a type mismatch.
|
[
"Set",
"the",
"value",
"of",
"an",
"existing",
"hyperparameter",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorfl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5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(931 - 883) + '\x6f' + '\x31' + chr(527 - 477) + chr(53), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1 + 0o156) + chr(50) + chr(1796 - 1746) + chr(586 - 533), ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + '\061' + '\x35' + chr(50), 0o10), ehT0Px3KOsy9(chr(242 - 194) + '\x6f' + chr(0b110 + 0o55) + chr(0b110010) + '\x34', 21330 - 21322), ehT0Px3KOsy9('\060' + '\x6f' + chr(1969 - 1918) + chr(0b110000) + chr(0b1000 + 0o52), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1010000 + 0o37) + chr(1657 - 1607) + chr(830 - 778) + '\x31', 0o10), ehT0Px3KOsy9(chr(0b11010 + 0o26) + '\x6f' + chr(0b11 + 0o57) + chr(0b110010) + chr(0b10111 + 0o34), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(11066 - 10955) + '\062' + chr(48) + chr(51), 23617 - 23609), ehT0Px3KOsy9(chr(48) + chr(0b1101101 + 0o2) + chr(0b101101 + 0o5) + chr(0b110100 + 0o2) + chr(0b111 + 0o57), 37131 - 37123), ehT0Px3KOsy9(chr(2115 - 2067) + '\157' + chr(0b11000 + 0o33) + '\065' + chr(0b110000), 12495 - 12487), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\061' + chr(0b0 + 0o60) + chr(51), 26977 - 26969), ehT0Px3KOsy9(chr(0b111 + 0o51) + '\x6f' + chr(1828 - 1779) + chr(0b101 + 0o62) + chr(0b111 + 0o57), 0o10), ehT0Px3KOsy9(chr(48) + chr(7756 - 7645) + '\x33' + chr(0b110011) + '\061', 0o10), ehT0Px3KOsy9(chr(995 - 947) + chr(111) + chr(1988 - 1939) + chr(1854 - 1799) + chr(0b110101), 0o10), ehT0Px3KOsy9(chr(1709 - 1661) + chr(0b1100100 + 0o13) + '\x32' + chr(0b100 + 0o55) + '\061', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1011111 + 0o20) + chr(1179 - 1128) + '\063' + chr(1464 - 1410), 36736 - 36728), ehT0Px3KOsy9(chr(0b101 + 0o53) + chr(0b1101111) + chr(0b110010) + chr(2024 - 1975) + chr(1816 - 1766), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x34' + chr(0b110111), ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + chr(1054 - 1004) + chr(52), 0o10), ehT0Px3KOsy9(chr(0b101011 + 0o5) + chr(0b1101111) + chr(0b110010) + chr(0b110000) + chr(53), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x32' + chr(0b101100 + 0o6) + chr(0b110001), 56190 - 56182), ehT0Px3KOsy9(chr(48) + chr(5025 - 4914) + '\061' + '\066' + '\066', 0o10), ehT0Px3KOsy9(chr(0b100 + 0o54) + '\157' + '\061' + '\061' + '\063', 26514 - 26506), ehT0Px3KOsy9(chr(0b110000) + chr(3337 - 3226) + '\062' + chr(48) + chr(2197 - 2149), ord("\x08")), ehT0Px3KOsy9(chr(2103 - 2055) + chr(111) + chr(0b110101) + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(608 - 560) + '\x6f' + chr(0b11010 + 0o30) + chr(0b10101 + 0o33) + chr(49), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(9770 - 9659) + chr(0b1100 + 0o47) + chr(0b10010 + 0o41) + chr(0b101101 + 0o10), 53386 - 53378), ehT0Px3KOsy9('\060' + chr(111) + chr(0b1011 + 0o50) + chr(222 - 168) + chr(0b110011), 0b1000), ehT0Px3KOsy9(chr(0b10 + 0o56) + chr(0b1101111) + chr(0b100011 + 0o16) + chr(911 - 862), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110011) + chr(0b10 + 0o56) + '\065', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b100011 + 0o17) + '\064' + chr(55), ord("\x08")), ehT0Px3KOsy9(chr(0b11001 + 0o27) + chr(111) + chr(0b10000 + 0o42) + '\x33' + chr(0b100010 + 0o22), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\062' + chr(0b100011 + 0o20) + '\060', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(5871 - 5760) + chr(54) + chr(0b100110 + 0o12), 0b1000), ehT0Px3KOsy9(chr(0b101011 + 0o5) + chr(7373 - 7262) + chr(1005 - 956) + '\x33' + '\067', 23562 - 23554), ehT0Px3KOsy9(chr(0b10101 + 0o33) + chr(0b1101111) + chr(683 - 631) + '\061', 21908 - 21900), ehT0Px3KOsy9(chr(0b110000) + chr(5908 - 5797) + chr(51) + chr(2351 - 2301) + chr(0b100110 + 0o17), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110001) + chr(0b110010), 29672 - 29664), ehT0Px3KOsy9(chr(0b110000) + chr(10241 - 10130) + chr(242 - 191) + chr(338 - 284) + chr(49), ord("\x08")), ehT0Px3KOsy9(chr(133 - 85) + '\157' + chr(0b110011) + chr(2239 - 2189) + chr(882 - 834), 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b1100 + 0o44) + chr(0b1001001 + 0o46) + chr(0b100100 + 0o21) + chr(1587 - 1539), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'{'), chr(100) + chr(0b1100101) + chr(0b11001 + 0o112) + chr(9369 - 9258) + chr(0b1100100) + '\145')('\x75' + chr(116) + chr(102) + chr(0b11 + 0o52) + chr(0b110111 + 0o1)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def qnrSw8qa0k0S(oVre8I6UXc3b, AIvJRzLdDfgF, QmmgWUB13VCJ):
(LYEGMLiiZQHD, LacZWOkwfU42) = oVre8I6UXc3b.SoixjuebFHDM[AIvJRzLdDfgF]
if PlSM16l2KDPD(QmmgWUB13VCJ, YyaZ4tpXu4lf):
if not LacZWOkwfU42:
raise q1QCh3W88sgk(xafqLlk3kkUe(SXOLrMavuUCe(b'\x18\xe0\x19\xa0\xe2\xcf\xfc\xf7\x96\x98"\r\xaa]\xe8\xfe\xe6Ng\xf1\xb1\x10$\xf2\n\xf2\xb4\x9dn\xa9\xc2\xb1\xeeQ3T\xb0n\xd1\xa04\xe7\x0b\xb9\xa7\xd5\xf6\xf1\x8c\xc8f\r'), '\144' + '\x65' + chr(0b1100011) + '\157' + chr(4990 - 4890) + chr(101))(chr(0b1010 + 0o153) + chr(0b1110100) + chr(4046 - 3944) + '\x2d' + '\070') % AIvJRzLdDfgF)
t0rOMsrOC7R_(oVre8I6UXc3b, AIvJRzLdDfgF, [VBzBO2ISE9N0(AIvJRzLdDfgF, LYEGMLiiZQHD, cMbll0QYhULo) for cMbll0QYhULo in QmmgWUB13VCJ])
else:
if LacZWOkwfU42:
raise q1QCh3W88sgk(xafqLlk3kkUe(SXOLrMavuUCe(b'\x18\xe0\x19\xa0\xe2\xd1\xf2\xf0\xc5\xc8"^\xb5\x14\xfa\xaa\xaaA{\xf7\xb1\x1b>\xec^\xe8\xf0\x85h\xa9\xd2\xf9\xfc\x10/@\xa7k\x9c\xb5!\xf0\x18\xee\xe2\x84\xe0\xad'), chr(4475 - 4375) + '\145' + chr(6926 - 6827) + chr(4906 - 4795) + chr(0b1100100) + chr(0b1100101))('\165' + chr(0b100101 + 0o117) + '\x66' + chr(45) + chr(56)) % AIvJRzLdDfgF)
t0rOMsrOC7R_(oVre8I6UXc3b, AIvJRzLdDfgF, VBzBO2ISE9N0(AIvJRzLdDfgF, LYEGMLiiZQHD, QmmgWUB13VCJ))
|
tensorflow/tensor2tensor
|
tensor2tensor/utils/hparam.py
|
HParams.del_hparam
|
def del_hparam(self, name):
"""Removes the hyperparameter with key 'name'.
Does nothing if it isn't present.
Args:
name: Name of the hyperparameter.
"""
if hasattr(self, name):
delattr(self, name)
del self._hparam_types[name]
|
python
|
def del_hparam(self, name):
"""Removes the hyperparameter with key 'name'.
Does nothing if it isn't present.
Args:
name: Name of the hyperparameter.
"""
if hasattr(self, name):
delattr(self, name)
del self._hparam_types[name]
|
[
"def",
"del_hparam",
"(",
"self",
",",
"name",
")",
":",
"if",
"hasattr",
"(",
"self",
",",
"name",
")",
":",
"delattr",
"(",
"self",
",",
"name",
")",
"del",
"self",
".",
"_hparam_types",
"[",
"name",
"]"
] |
Removes the hyperparameter with key 'name'.
Does nothing if it isn't present.
Args:
name: Name of the hyperparameter.
|
[
"Removes",
"the",
"hyperparameter",
"with",
"key",
"name",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/utils/hparam.py#L470-L480
|
train
|
Removes the hyperparameter with key name.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5V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YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(103 - 55) + '\157' + chr(0b110011) + chr(0b110010) + chr(0b110001), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + '\061' + '\062' + chr(54 - 0), 2712 - 2704), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(55) + chr(0b101110 + 0o5), 0b1000), ehT0Px3KOsy9(chr(1387 - 1339) + chr(0b1101111) + chr(924 - 875) + chr(2043 - 1995) + chr(0b0 + 0o65), ord("\x08")), ehT0Px3KOsy9(chr(2160 - 2112) + '\x6f' + chr(0b110001) + chr(0b110101) + chr(50), 46328 - 46320), ehT0Px3KOsy9(chr(0b111 + 0o51) + chr(111) + chr(49) + chr(0b110101) + chr(0b101011 + 0o11), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b100000 + 0o21) + '\066' + chr(0b1100 + 0o51), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110011) + chr(53) + '\067', ord("\x08")), ehT0Px3KOsy9('\060' + chr(8519 - 8408) + chr(0b11110 + 0o27) + chr(0b11101 + 0o23), 59557 - 59549), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(641 - 592) + chr(0b110000 + 0o2), 0o10), ehT0Px3KOsy9(chr(0b101000 + 0o10) + chr(8252 - 8141) + chr(51) + chr(0b110001) + chr(142 - 94), 0b1000), ehT0Px3KOsy9(chr(0b100001 + 0o17) + chr(0b1101111) + chr(2141 - 2092) + '\060' + chr(0b101010 + 0o10), 49292 - 49284), ehT0Px3KOsy9(chr(2270 - 2222) + chr(213 - 102) + '\x31' + '\067' + chr(55), 0b1000), ehT0Px3KOsy9(chr(0b100011 + 0o15) + chr(10334 - 10223) + '\061' + chr(0b110001) + chr(54), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(11608 - 11497) + '\x31' + '\065' + '\063', ord("\x08")), ehT0Px3KOsy9(chr(0b10000 + 0o40) + chr(2864 - 2753) + '\x31' + '\062' + chr(1618 - 1569), 0b1000), ehT0Px3KOsy9(chr(0b11100 + 0o24) + chr(5712 - 5601) + chr(1266 - 1217) + '\x33' + '\x33', 51600 - 51592), ehT0Px3KOsy9(chr(1144 - 1096) + chr(111) + '\x32' + chr(2241 - 2188) + chr(55), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110101) + chr(0b110000), 8), ehT0Px3KOsy9('\x30' + chr(0b110101 + 0o72) + '\x34' + chr(169 - 115), 20477 - 20469), ehT0Px3KOsy9(chr(0b1100 + 0o44) + chr(0b1101111) + chr(51) + chr(0b110101) + chr(0b110011), 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(51) + chr(0b110000) + chr(2038 - 1985), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110011) + chr(51) + chr(0b110001 + 0o5), 0o10), ehT0Px3KOsy9('\060' + chr(0b1 + 0o156) + chr(49) + '\061' + '\063', ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + '\067' + '\064', ord("\x08")), ehT0Px3KOsy9(chr(0b10010 + 0o36) + chr(111) + chr(495 - 445) + '\063' + chr(49), 0o10), ehT0Px3KOsy9(chr(1432 - 1384) + chr(4166 - 4055) + '\062' + '\x30' + chr(1379 - 1329), 8006 - 7998), ehT0Px3KOsy9('\x30' + chr(0b100 + 0o153) + '\064' + '\060', 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(51) + '\x35' + chr(1949 - 1901), 0o10), ehT0Px3KOsy9('\060' + chr(9219 - 9108) + chr(1220 - 1171) + chr(0b101111 + 0o3) + '\067', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(9799 - 9688) + chr(49) + chr(0b110000) + '\x36', 49557 - 49549), ehT0Px3KOsy9(chr(48) + chr(0b101 + 0o152) + chr(392 - 341) + '\066' + chr(996 - 942), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b10100 + 0o35) + chr(52) + chr(0b110001), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + '\062' + chr(49) + chr(0b101000 + 0o15), 0b1000), ehT0Px3KOsy9(chr(0b101010 + 0o6) + chr(0b1101111) + '\x33' + chr(53) + chr(995 - 943), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b110100 + 0o73) + chr(0b110110), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + '\066' + chr(55), 0b1000), ehT0Px3KOsy9(chr(0b101101 + 0o3) + chr(0b1101111) + chr(1276 - 1225) + chr(0b110000) + chr(54), 0b1000), ehT0Px3KOsy9(chr(393 - 345) + chr(12252 - 12141) + chr(49) + '\x30' + '\x36', 8), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110011) + chr(1926 - 1874) + chr(0b11110 + 0o24), 32180 - 32172)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + '\157' + chr(53) + chr(0b110000), 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xff'), chr(100) + '\145' + '\143' + chr(111) + '\144' + chr(101))(chr(4862 - 4745) + '\164' + '\x66' + chr(1959 - 1914) + chr(451 - 395)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def IQvclsl_eHaQ(oVre8I6UXc3b, AIvJRzLdDfgF):
if lot1PSoAwYhj(oVre8I6UXc3b, AIvJRzLdDfgF):
eX02hlZjMfR0(oVre8I6UXc3b, AIvJRzLdDfgF)
del xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x829R=\x00\x19\x10\x8dnB\x8c\x0f'), chr(100) + chr(101) + chr(99) + chr(111) + chr(2974 - 2874) + chr(0b1100101))(chr(0b1110101) + '\x74' + chr(1895 - 1793) + chr(0b101101) + '\x38'))[AIvJRzLdDfgF]
|
tensorflow/tensor2tensor
|
tensor2tensor/utils/hparam.py
|
HParams.parse
|
def parse(self, values):
"""Override existing hyperparameter values, parsing new values from a string.
See parse_values for more detail on the allowed format for values.
Args:
values: String. Comma separated list of `name=value` pairs where 'value'
must follow the syntax described above.
Returns:
The `HParams` instance.
Raises:
ValueError: If `values` cannot be parsed or a hyperparameter in `values`
doesn't exist.
"""
type_map = {}
for name, t in self._hparam_types.items():
param_type, _ = t
type_map[name] = param_type
values_map = parse_values(values, type_map)
return self.override_from_dict(values_map)
|
python
|
def parse(self, values):
"""Override existing hyperparameter values, parsing new values from a string.
See parse_values for more detail on the allowed format for values.
Args:
values: String. Comma separated list of `name=value` pairs where 'value'
must follow the syntax described above.
Returns:
The `HParams` instance.
Raises:
ValueError: If `values` cannot be parsed or a hyperparameter in `values`
doesn't exist.
"""
type_map = {}
for name, t in self._hparam_types.items():
param_type, _ = t
type_map[name] = param_type
values_map = parse_values(values, type_map)
return self.override_from_dict(values_map)
|
[
"def",
"parse",
"(",
"self",
",",
"values",
")",
":",
"type_map",
"=",
"{",
"}",
"for",
"name",
",",
"t",
"in",
"self",
".",
"_hparam_types",
".",
"items",
"(",
")",
":",
"param_type",
",",
"_",
"=",
"t",
"type_map",
"[",
"name",
"]",
"=",
"param_type",
"values_map",
"=",
"parse_values",
"(",
"values",
",",
"type_map",
")",
"return",
"self",
".",
"override_from_dict",
"(",
"values_map",
")"
] |
Override existing hyperparameter values, parsing new values from a string.
See parse_values for more detail on the allowed format for values.
Args:
values: String. Comma separated list of `name=value` pairs where 'value'
must follow the syntax described above.
Returns:
The `HParams` instance.
Raises:
ValueError: If `values` cannot be parsed or a hyperparameter in `values`
doesn't exist.
|
[
"Override",
"existing",
"hyperparameter",
"values",
"parsing",
"new",
"values",
"from",
"a",
"string",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/utils/hparam.py#L482-L504
|
train
|
Override existing hyperparameter values parsing new values from a string.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXw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4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\x30' + '\157' + '\067' + chr(0b100101 + 0o15), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1001000 + 0o47) + chr(0b100111 + 0o14) + chr(0b10011 + 0o41) + '\x37', 0b1000), ehT0Px3KOsy9(chr(1267 - 1219) + chr(0b1101111) + chr(227 - 178) + '\067' + chr(0b110110), 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110010) + '\064' + chr(53), 26388 - 26380), ehT0Px3KOsy9(chr(2288 - 2240) + chr(111) + '\065' + chr(513 - 458), 0o10), ehT0Px3KOsy9(chr(0b11000 + 0o30) + chr(111) + chr(0b110011) + chr(1609 - 1557) + chr(0b11001 + 0o30), 0o10), ehT0Px3KOsy9(chr(744 - 696) + '\x6f' + '\063' + '\x35' + chr(0b110111), 25307 - 25299), ehT0Px3KOsy9(chr(1983 - 1935) + chr(0b1100111 + 0o10) + chr(0b10111 + 0o32) + chr(0b110100) + '\067', 51793 - 51785), ehT0Px3KOsy9(chr(1774 - 1726) + chr(0b10101 + 0o132) + chr(0b110 + 0o61) + chr(49), 0b1000), ehT0Px3KOsy9(chr(0b100011 + 0o15) + '\157' + chr(0b101010 + 0o10) + '\065' + chr(0b110101), 40333 - 40325), ehT0Px3KOsy9(chr(48) + '\157' + chr(1841 - 1791) + '\067' + chr(55), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(49) + chr(52) + chr(476 - 426), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b10101 + 0o132) + chr(0b110101) + '\x37', 8), ehT0Px3KOsy9(chr(0b1001 + 0o47) + chr(0b1101111) + '\062' + chr(51) + '\x34', 0b1000), ehT0Px3KOsy9(chr(1034 - 986) + '\157' + chr(0b0 + 0o62) + chr(0b11111 + 0o25) + '\061', ord("\x08")), ehT0Px3KOsy9(chr(1455 - 1407) + chr(12286 - 12175) + chr(1904 - 1853) + '\x37' + chr(0b110110), 28438 - 28430), ehT0Px3KOsy9('\060' + chr(0b1101001 + 0o6) + chr(0b10100 + 0o37) + '\x36' + '\x37', ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(617 - 567) + chr(0b110110) + '\x31', 16008 - 16000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(1232 - 1182) + chr(0b110011) + '\066', 0o10), ehT0Px3KOsy9(chr(0b10011 + 0o35) + chr(0b111110 + 0o61) + '\063' + chr(54) + chr(49), 0b1000), ehT0Px3KOsy9(chr(1415 - 1367) + '\157' + '\x31' + chr(0b11100 + 0o25) + '\063', 42164 - 42156), ehT0Px3KOsy9('\060' + chr(9224 - 9113) + chr(0b110001) + '\063' + '\060', 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(49) + '\x32' + chr(0b10011 + 0o35), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b1001 + 0o50) + '\066' + '\x34', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\061' + chr(53) + '\064', ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + '\x31' + '\062' + chr(1721 - 1666), 37932 - 37924), ehT0Px3KOsy9('\060' + '\157' + '\x31' + chr(0b110111) + '\x36', 8), ehT0Px3KOsy9(chr(48) + '\157' + '\062' + '\x36' + '\x31', 8), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\061' + '\067' + chr(0b110100), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110001) + chr(715 - 662) + chr(0b101 + 0o62), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(709 - 598) + chr(2407 - 2356) + chr(0b11010 + 0o33) + chr(50), ord("\x08")), ehT0Px3KOsy9(chr(1764 - 1716) + '\x6f' + chr(51) + chr(1311 - 1258), 0b1000), ehT0Px3KOsy9(chr(48) + chr(11751 - 11640) + chr(0b10000 + 0o43) + chr(168 - 118), 0b1000), ehT0Px3KOsy9('\x30' + chr(2203 - 2092) + chr(1463 - 1413) + chr(54) + chr(0b110001), 8), ehT0Px3KOsy9(chr(1008 - 960) + chr(3282 - 3171) + '\x33' + chr(0b11011 + 0o32) + chr(0b10000 + 0o44), 41670 - 41662), ehT0Px3KOsy9(chr(0b1100 + 0o44) + chr(0b1001111 + 0o40) + '\x33' + chr(1002 - 950) + '\x36', 0o10), ehT0Px3KOsy9(chr(888 - 840) + '\157' + chr(49) + chr(0b1110 + 0o51) + chr(52), 8), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110010) + chr(970 - 918) + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + '\x31' + '\x35' + chr(0b110001), 982 - 974), ehT0Px3KOsy9('\x30' + '\157' + chr(1589 - 1538) + chr(54) + '\x30', 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + '\157' + chr(0b110101) + '\060', 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x14'), '\x64' + chr(101) + '\143' + chr(0b1101111) + chr(100) + chr(101))(chr(0b1110011 + 0o2) + chr(5840 - 5724) + chr(0b1000111 + 0o37) + '\055' + '\x38') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def d0cNSJFV4IQI(oVre8I6UXc3b, SPnCNu54H1db):
OUd2MptGD0Z_ = {}
for (AIvJRzLdDfgF, YeT3l7JgTbWR) in xafqLlk3kkUe(oVre8I6UXc3b._hparam_types, xafqLlk3kkUe(SXOLrMavuUCe(b't\x9d\x08\xc0f\xbb\xdc.U\xfe\xf7['), chr(0b1100100) + chr(101) + '\143' + chr(0b10011 + 0o134) + chr(0b1010100 + 0o20) + chr(0b1100101))(chr(117) + chr(116) + chr(0b1100110) + '\055' + chr(56)))():
(LYEGMLiiZQHD, VNGQdHSFPrso) = YeT3l7JgTbWR
OUd2MptGD0Z_[AIvJRzLdDfgF] = LYEGMLiiZQHD
oRa9_8I76Ond = vdq1MCeKb7Lg(SPnCNu54H1db, OUd2MptGD0Z_)
return xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'U\x91\x1b\xd7]\x88\x8b\x02f\xcb\xcd\rB\xc3\xc5\x97\x94\xc5'), chr(4258 - 4158) + chr(0b10000 + 0o125) + '\x63' + '\x6f' + chr(100) + chr(0b111 + 0o136))(chr(0b110110 + 0o77) + chr(116) + chr(0b1100110) + chr(45) + chr(0b110 + 0o62)))(oRa9_8I76Ond)
|
tensorflow/tensor2tensor
|
tensor2tensor/utils/hparam.py
|
HParams.override_from_dict
|
def override_from_dict(self, values_dict):
"""Override existing hyperparameter values, parsing new values from a dictionary.
Args:
values_dict: Dictionary of name:value pairs.
Returns:
The `HParams` instance.
Raises:
KeyError: If a hyperparameter in `values_dict` doesn't exist.
ValueError: If `values_dict` cannot be parsed.
"""
for name, value in values_dict.items():
self.set_hparam(name, value)
return self
|
python
|
def override_from_dict(self, values_dict):
"""Override existing hyperparameter values, parsing new values from a dictionary.
Args:
values_dict: Dictionary of name:value pairs.
Returns:
The `HParams` instance.
Raises:
KeyError: If a hyperparameter in `values_dict` doesn't exist.
ValueError: If `values_dict` cannot be parsed.
"""
for name, value in values_dict.items():
self.set_hparam(name, value)
return self
|
[
"def",
"override_from_dict",
"(",
"self",
",",
"values_dict",
")",
":",
"for",
"name",
",",
"value",
"in",
"values_dict",
".",
"items",
"(",
")",
":",
"self",
".",
"set_hparam",
"(",
"name",
",",
"value",
")",
"return",
"self"
] |
Override existing hyperparameter values, parsing new values from a dictionary.
Args:
values_dict: Dictionary of name:value pairs.
Returns:
The `HParams` instance.
Raises:
KeyError: If a hyperparameter in `values_dict` doesn't exist.
ValueError: If `values_dict` cannot be parsed.
|
[
"Override",
"existing",
"hyperparameter",
"values",
"parsing",
"new",
"values",
"from",
"a",
"dictionary",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/utils/hparam.py#L506-L521
|
train
|
Override existing hyperparameter values parsing new values from a dictionary.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,e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wwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\x30' + chr(0b1111 + 0o140) + '\062' + chr(0b11110 + 0o24), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b110001 + 0o76) + '\067' + chr(0b110001), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110011) + chr(0b110001) + '\062', 36896 - 36888), ehT0Px3KOsy9(chr(1959 - 1911) + chr(0b11 + 0o154) + chr(0b101000 + 0o13) + chr(432 - 380) + chr(175 - 127), 0b1000), ehT0Px3KOsy9(chr(0b111 + 0o51) + chr(0b1000110 + 0o51) + '\062' + '\067' + '\067', 41857 - 41849), ehT0Px3KOsy9(chr(587 - 539) + chr(9433 - 9322) + chr(0b110001) + '\x35', 0o10), ehT0Px3KOsy9(chr(783 - 735) + '\157' + chr(1868 - 1818) + chr(0b110001) + chr(0b110011), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(543 - 494) + '\x30' + chr(0b110010 + 0o1), 0o10), ehT0Px3KOsy9('\x30' + chr(6573 - 6462) + chr(51) + '\x33' + '\064', 0b1000), ehT0Px3KOsy9(chr(0b1011 + 0o45) + chr(111) + chr(2013 - 1962) + chr(48) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9(chr(0b11 + 0o55) + '\x6f' + chr(0b110010) + chr(2823 - 2768) + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(450 - 402) + chr(111) + '\x31' + '\x31' + chr(0b110110), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1000000 + 0o57) + '\061' + chr(877 - 828) + chr(0b11010 + 0o32), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(50) + chr(0b100000 + 0o26) + chr(0b101010 + 0o11), 0o10), ehT0Px3KOsy9('\060' + chr(0b1001000 + 0o47) + chr(0b110010) + '\065' + chr(1334 - 1280), 40027 - 40019), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110010) + chr(0b100101 + 0o15) + chr(53), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\061' + chr(1288 - 1236) + chr(0b100100 + 0o16), 0o10), ehT0Px3KOsy9(chr(0b101010 + 0o6) + chr(0b100111 + 0o110) + chr(0b110010) + chr(0b110001), 15613 - 15605), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(51) + '\x30' + '\x30', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110010) + chr(0b11010 + 0o26) + chr(2143 - 2088), 15461 - 15453), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x31' + chr(1212 - 1160) + '\x30', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110001) + chr(0b101111 + 0o10) + chr(0b101110 + 0o10), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(7436 - 7325) + chr(51) + chr(0b1 + 0o63) + chr(914 - 864), 6884 - 6876), ehT0Px3KOsy9(chr(48) + chr(0b1011011 + 0o24) + chr(0b110001) + chr(768 - 719) + '\060', 60887 - 60879), ehT0Px3KOsy9('\x30' + chr(111) + chr(49) + chr(0b11000 + 0o35) + '\064', ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(53) + chr(388 - 340), 0o10), ehT0Px3KOsy9(chr(0b10011 + 0o35) + chr(111) + chr(0b110100) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(574 - 526) + chr(11135 - 11024) + chr(0b110011) + '\x33', 38205 - 38197), ehT0Px3KOsy9(chr(48) + chr(111) + chr(49) + '\060' + chr(0b110011), 8), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\065' + '\x36', 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b11001 + 0o30) + chr(1193 - 1144) + '\065', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(49) + chr(53) + chr(0b1111 + 0o44), 0b1000), ehT0Px3KOsy9(chr(1353 - 1305) + '\x6f' + '\063' + chr(1054 - 1005) + chr(2426 - 2372), 41244 - 41236), ehT0Px3KOsy9('\x30' + chr(111) + chr(50) + chr(0b110010 + 0o2) + chr(1744 - 1695), 25452 - 25444), ehT0Px3KOsy9(chr(0b100011 + 0o15) + '\157' + chr(49) + '\063' + chr(1086 - 1036), 4945 - 4937), ehT0Px3KOsy9('\060' + '\x6f' + chr(50) + chr(0b11010 + 0o35) + chr(0b11011 + 0o34), 8), ehT0Px3KOsy9(chr(0b110000) + chr(1094 - 983) + chr(0b110010 + 0o4) + '\061', 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x31' + '\x34' + chr(1831 - 1778), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b100001 + 0o21) + '\x34' + '\x31', 8), ehT0Px3KOsy9(chr(0b10000 + 0o40) + chr(111) + chr(1082 - 1032) + chr(0b10101 + 0o33) + chr(0b11 + 0o60), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x35' + chr(48), 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'<'), chr(100) + '\145' + '\143' + '\x6f' + '\x64' + '\145')(chr(117) + chr(0b1110100) + '\146' + chr(0b101 + 0o50) + chr(0b100 + 0o64)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def ir8EZiHDCF7z(oVre8I6UXc3b, TCQqcKXYrL1X):
for (AIvJRzLdDfgF, QmmgWUB13VCJ) in xafqLlk3kkUe(TCQqcKXYrL1X, xafqLlk3kkUe(SXOLrMavuUCe(b'\\C\xbc\x85\xf6W\xb8\n\xb0\x97\xf6w'), chr(0b1100100) + chr(101) + '\x63' + '\x6f' + chr(0b1100100 + 0o0) + '\x65')('\165' + chr(116) + '\x66' + chr(45) + chr(739 - 683)))():
xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'a\\\xbe\xbf\xd7}\xea1\xbd\xa9'), '\144' + chr(0b1100101) + chr(386 - 287) + chr(111) + '\144' + chr(4100 - 3999))(chr(117) + chr(6000 - 5884) + '\146' + '\055' + '\070'))(AIvJRzLdDfgF, QmmgWUB13VCJ)
return oVre8I6UXc3b
|
tensorflow/tensor2tensor
|
tensor2tensor/utils/hparam.py
|
HParams.to_json
|
def to_json(self, indent=None, separators=None, sort_keys=False):
"""Serializes the hyperparameters into JSON.
Args:
indent: If a non-negative integer, JSON array elements and object members
will be pretty-printed with that indent level. An indent level of 0, or
negative, will only insert newlines. `None` (the default) selects the
most compact representation.
separators: Optional `(item_separator, key_separator)` tuple. Default is
`(', ', ': ')`.
sort_keys: If `True`, the output dictionaries will be sorted by key.
Returns:
A JSON string.
"""
def remove_callables(x):
"""Omit callable elements from input with arbitrary nesting."""
if isinstance(x, dict):
return {k: remove_callables(v) for k, v in six.iteritems(x)
if not callable(v)}
elif isinstance(x, list):
return [remove_callables(i) for i in x if not callable(i)]
return x
return json.dumps(
remove_callables(self.values()),
indent=indent,
separators=separators,
sort_keys=sort_keys)
|
python
|
def to_json(self, indent=None, separators=None, sort_keys=False):
"""Serializes the hyperparameters into JSON.
Args:
indent: If a non-negative integer, JSON array elements and object members
will be pretty-printed with that indent level. An indent level of 0, or
negative, will only insert newlines. `None` (the default) selects the
most compact representation.
separators: Optional `(item_separator, key_separator)` tuple. Default is
`(', ', ': ')`.
sort_keys: If `True`, the output dictionaries will be sorted by key.
Returns:
A JSON string.
"""
def remove_callables(x):
"""Omit callable elements from input with arbitrary nesting."""
if isinstance(x, dict):
return {k: remove_callables(v) for k, v in six.iteritems(x)
if not callable(v)}
elif isinstance(x, list):
return [remove_callables(i) for i in x if not callable(i)]
return x
return json.dumps(
remove_callables(self.values()),
indent=indent,
separators=separators,
sort_keys=sort_keys)
|
[
"def",
"to_json",
"(",
"self",
",",
"indent",
"=",
"None",
",",
"separators",
"=",
"None",
",",
"sort_keys",
"=",
"False",
")",
":",
"def",
"remove_callables",
"(",
"x",
")",
":",
"\"\"\"Omit callable elements from input with arbitrary nesting.\"\"\"",
"if",
"isinstance",
"(",
"x",
",",
"dict",
")",
":",
"return",
"{",
"k",
":",
"remove_callables",
"(",
"v",
")",
"for",
"k",
",",
"v",
"in",
"six",
".",
"iteritems",
"(",
"x",
")",
"if",
"not",
"callable",
"(",
"v",
")",
"}",
"elif",
"isinstance",
"(",
"x",
",",
"list",
")",
":",
"return",
"[",
"remove_callables",
"(",
"i",
")",
"for",
"i",
"in",
"x",
"if",
"not",
"callable",
"(",
"i",
")",
"]",
"return",
"x",
"return",
"json",
".",
"dumps",
"(",
"remove_callables",
"(",
"self",
".",
"values",
"(",
")",
")",
",",
"indent",
"=",
"indent",
",",
"separators",
"=",
"separators",
",",
"sort_keys",
"=",
"sort_keys",
")"
] |
Serializes the hyperparameters into JSON.
Args:
indent: If a non-negative integer, JSON array elements and object members
will be pretty-printed with that indent level. An indent level of 0, or
negative, will only insert newlines. `None` (the default) selects the
most compact representation.
separators: Optional `(item_separator, key_separator)` tuple. Default is
`(', ', ': ')`.
sort_keys: If `True`, the output dictionaries will be sorted by key.
Returns:
A JSON string.
|
[
"Serializes",
"the",
"hyperparameters",
"into",
"JSON",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca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e,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b111 + 0o51) + chr(0b1101111) + '\x31' + chr(1984 - 1931) + '\x33', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b0 + 0o157) + '\x31' + chr(0b110100) + chr(50), 268 - 260), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110010) + chr(0b100011 + 0o21) + chr(0b110001), 41802 - 41794), ehT0Px3KOsy9('\060' + chr(0b110110 + 0o71) + chr(1658 - 1608) + '\x36', ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + chr(51) + chr(2151 - 2102) + chr(51), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b101000 + 0o107) + '\065' + chr(0b10100 + 0o40), 5871 - 5863), ehT0Px3KOsy9(chr(1839 - 1791) + chr(7105 - 6994) + '\x33' + chr(218 - 165), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x31' + chr(55) + chr(838 - 785), 0o10), ehT0Px3KOsy9(chr(48) + chr(11817 - 11706) + '\x31' + chr(1132 - 1082) + chr(1548 - 1500), 34328 - 34320), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(795 - 746) + chr(51) + chr(0b110010), 0o10), ehT0Px3KOsy9(chr(48) + chr(2253 - 2142) + chr(0b1110 + 0o45) + chr(0b11001 + 0o32) + chr(0b100001 + 0o20), ord("\x08")), ehT0Px3KOsy9(chr(0b100101 + 0o13) + '\157' + chr(0b110 + 0o54) + '\x34' + chr(0b10001 + 0o43), 0o10), ehT0Px3KOsy9('\060' + chr(6224 - 6113) + '\x35' + chr(54), 44740 - 44732), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b1110 + 0o45) + chr(0b11011 + 0o31) + chr(53), 0b1000), ehT0Px3KOsy9(chr(162 - 114) + chr(111) + chr(1870 - 1821) + chr(2334 - 2284) + chr(2478 - 2426), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + '\063' + '\x35' + '\065', ord("\x08")), ehT0Px3KOsy9(chr(1922 - 1874) + '\x6f' + chr(0b110010) + '\063' + chr(0b11100 + 0o26), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(932 - 882) + chr(0b110101) + chr(0b1 + 0o62), 31015 - 31007), ehT0Px3KOsy9(chr(1277 - 1229) + chr(111) + chr(0b110001) + chr(0b110000) + chr(55), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + '\x31' + chr(0b110011) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(10790 - 10679) + '\065' + '\x36', 8), ehT0Px3KOsy9(chr(0b100110 + 0o12) + chr(0b1101111) + '\x35' + '\x32', 23482 - 23474), ehT0Px3KOsy9(chr(48) + chr(9461 - 9350) + '\x31' + chr(0b110010) + '\x31', 0b1000), ehT0Px3KOsy9(chr(0b100000 + 0o20) + '\157' + chr(0b110001) + chr(0b111 + 0o57) + '\061', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110011) + '\x30' + '\067', 0o10), ehT0Px3KOsy9(chr(949 - 901) + chr(9976 - 9865) + '\x33' + chr(0b10 + 0o63) + '\064', 17796 - 17788), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b100111 + 0o16) + chr(2187 - 2137), 8), ehT0Px3KOsy9(chr(1846 - 1798) + chr(1235 - 1124) + '\x31' + chr(48) + '\065', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(52) + chr(49), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(1106 - 1051) + '\067', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(50) + chr(0b110111) + chr(48), 64311 - 64303), ehT0Px3KOsy9('\060' + chr(111) + chr(49) + chr(0b1111 + 0o44) + chr(0b110110), 21280 - 21272), ehT0Px3KOsy9(chr(323 - 275) + chr(10288 - 10177) + chr(0b110001) + chr(1268 - 1219) + '\x37', 24623 - 24615), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b10100 + 0o37) + chr(55) + '\x31', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(1328 - 1279) + chr(1659 - 1604) + '\066', 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b101011 + 0o12) + chr(52), 8), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x31' + chr(52) + '\061', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(9242 - 9131) + '\062' + '\x37' + '\060', 8), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(50) + chr(0b1011 + 0o47) + '\064', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(661 - 611) + '\x33' + chr(52), 15314 - 15306)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + chr(0b1101111) + '\065' + chr(48), ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'E'), chr(0b1011 + 0o131) + '\145' + '\143' + '\157' + chr(0b1100100) + chr(0b1100101))(chr(0b1110101) + chr(12921 - 12805) + chr(915 - 813) + chr(45) + chr(0b111000)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def KJ7rT4F2o4DB(oVre8I6UXc3b, rxwJk_g4F6Db=None, J8eh2YiVJwCy=None, TdFZImI8hiAJ=ehT0Px3KOsy9('\x30' + chr(0b10100 + 0o133) + chr(0b110000), 0b1000)):
def Dr1mqx8me1e6(OeWW0F1dBPRQ):
if PlSM16l2KDPD(OeWW0F1dBPRQ, wLqBDw8l0eIm):
return {OolUPRJhRaJd: Dr1mqx8me1e6(cMbll0QYhULo) for (OolUPRJhRaJd, cMbll0QYhULo) in xafqLlk3kkUe(sYby0kpfssd4, xafqLlk3kkUe(SXOLrMavuUCe(b'\x02\x16\xc4d\xa2Xx\x10#'), chr(100) + chr(0b10111 + 0o116) + chr(3012 - 2913) + chr(0b1101111) + chr(0b1100100) + '\x65')(chr(117) + '\164' + chr(4563 - 4461) + chr(945 - 900) + chr(0b10000 + 0o50)))(OeWW0F1dBPRQ) if not tzcpInYwBvYW(cMbll0QYhULo)}
elif PlSM16l2KDPD(OeWW0F1dBPRQ, YyaZ4tpXu4lf):
return [Dr1mqx8me1e6(WVxHKyX45z_L) for WVxHKyX45z_L in OeWW0F1dBPRQ if not tzcpInYwBvYW(WVxHKyX45z_L)]
return OeWW0F1dBPRQ
return xafqLlk3kkUe(fXk443epxtd5, xafqLlk3kkUe(SXOLrMavuUCe(b'\x0f\x17\xccf\xb8'), chr(100) + '\x65' + chr(0b1010010 + 0o21) + '\x6f' + chr(0b1001110 + 0o26) + '\145')('\165' + chr(0b1110100) + chr(102) + chr(45) + chr(0b100 + 0o64)))(Dr1mqx8me1e6(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'82\xcfU\x85Y(I\x18k\xbd\xc6'), chr(0b100 + 0o140) + chr(0b110 + 0o137) + chr(0b1100011) + chr(0b101011 + 0o104) + chr(0b1100100) + '\x65')('\x75' + chr(0b1110100) + '\146' + chr(0b101101) + chr(0b111000)))()), indent=rxwJk_g4F6Db, separators=J8eh2YiVJwCy, sort_keys=TdFZImI8hiAJ)
|
tensorflow/tensor2tensor
|
tensor2tensor/utils/hparam.py
|
HParams.parse_json
|
def parse_json(self, values_json):
"""Override existing hyperparameter values, parsing new values from a json object.
Args:
values_json: String containing a json object of name:value pairs.
Returns:
The `HParams` instance.
Raises:
KeyError: If a hyperparameter in `values_json` doesn't exist.
ValueError: If `values_json` cannot be parsed.
"""
values_map = json.loads(values_json)
return self.override_from_dict(values_map)
|
python
|
def parse_json(self, values_json):
"""Override existing hyperparameter values, parsing new values from a json object.
Args:
values_json: String containing a json object of name:value pairs.
Returns:
The `HParams` instance.
Raises:
KeyError: If a hyperparameter in `values_json` doesn't exist.
ValueError: If `values_json` cannot be parsed.
"""
values_map = json.loads(values_json)
return self.override_from_dict(values_map)
|
[
"def",
"parse_json",
"(",
"self",
",",
"values_json",
")",
":",
"values_map",
"=",
"json",
".",
"loads",
"(",
"values_json",
")",
"return",
"self",
".",
"override_from_dict",
"(",
"values_map",
")"
] |
Override existing hyperparameter values, parsing new values from a json object.
Args:
values_json: String containing a json object of name:value pairs.
Returns:
The `HParams` instance.
Raises:
KeyError: If a hyperparameter in `values_json` doesn't exist.
ValueError: If `values_json` cannot be parsed.
|
[
"Override",
"existing",
"hyperparameter",
"values",
"parsing",
"new",
"values",
"from",
"a",
"json",
"object",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/utils/hparam.py#L558-L572
|
train
|
Override existing hyperparameter values parsing new values from a json object.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,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ZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\060' + '\157' + chr(0b101110 + 0o10) + chr(769 - 714), 0b1000), ehT0Px3KOsy9(chr(0b101011 + 0o5) + '\157' + '\063' + chr(0b101001 + 0o7) + chr(878 - 828), 56663 - 56655), ehT0Px3KOsy9(chr(832 - 784) + '\x6f' + chr(51) + '\060' + chr(0b110001 + 0o2), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b100000 + 0o24), 0o10), ehT0Px3KOsy9(chr(1179 - 1131) + '\x6f' + '\x32' + chr(1443 - 1388) + chr(392 - 340), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(1898 - 1848) + chr(246 - 198) + '\x37', 0o10), ehT0Px3KOsy9('\060' + chr(0b100011 + 0o114) + '\x33' + chr(51) + '\x33', 32737 - 32729), ehT0Px3KOsy9(chr(0b10011 + 0o35) + chr(111) + chr(0b110011) + chr(50), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1010101 + 0o32) + '\x33' + chr(0b11111 + 0o24) + '\x33', 8), ehT0Px3KOsy9(chr(1383 - 1335) + chr(0b100 + 0o153) + chr(548 - 499) + chr(0b100010 + 0o23) + '\067', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1 + 0o156) + chr(2369 - 2320) + chr(0b110100) + '\x33', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b11110 + 0o23) + chr(215 - 163) + '\062', 0b1000), ehT0Px3KOsy9('\060' + chr(10137 - 10026) + '\062' + chr(54) + '\x34', ord("\x08")), ehT0Px3KOsy9(chr(861 - 813) + chr(0b1101111) + chr(50) + '\063', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110010) + chr(52) + chr(0b110100), 47889 - 47881), ehT0Px3KOsy9(chr(0b100 + 0o54) + chr(0b1101111) + chr(0b110010) + '\063' + chr(669 - 621), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110010) + chr(0b0 + 0o64) + chr(1490 - 1436), 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110010) + chr(0b100111 + 0o15), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(627 - 576) + chr(0b110001) + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(912 - 864) + chr(0b1101111) + '\x33' + chr(54) + chr(0b100011 + 0o21), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + '\x32' + chr(0b110010) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(1190 - 1139) + '\063', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b110010 + 0o75) + chr(0b11110 + 0o24) + '\x34' + '\067', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(435 - 384) + chr(0b1111 + 0o44) + chr(53), 11776 - 11768), ehT0Px3KOsy9('\x30' + chr(0b1011010 + 0o25) + chr(49) + '\x37' + chr(211 - 160), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(2465 - 2354) + chr(49) + '\x37' + chr(0b10010 + 0o44), 0o10), ehT0Px3KOsy9(chr(85 - 37) + chr(111) + chr(52) + chr(53), 0b1000), ehT0Px3KOsy9(chr(0b11000 + 0o30) + '\157' + '\x31' + chr(55) + chr(0b110 + 0o60), 8), ehT0Px3KOsy9(chr(573 - 525) + chr(9151 - 9040) + chr(0b1101 + 0o44) + chr(2619 - 2566) + chr(53), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101010 + 0o5) + '\062' + chr(49) + chr(48), 51162 - 51154), ehT0Px3KOsy9(chr(0b100110 + 0o12) + chr(0b111010 + 0o65) + chr(51) + chr(0b101100 + 0o11) + '\062', 1510 - 1502), ehT0Px3KOsy9(chr(0b10001 + 0o37) + '\157' + chr(54) + chr(1643 - 1594), 0o10), ehT0Px3KOsy9(chr(1235 - 1187) + chr(0b1101111) + chr(0b110001) + chr(0b110101) + chr(0b10000 + 0o45), 8), ehT0Px3KOsy9(chr(2023 - 1975) + chr(0b1101111) + chr(0b110001) + chr(339 - 291) + '\067', 41979 - 41971), ehT0Px3KOsy9('\060' + chr(9669 - 9558) + chr(50) + chr(1223 - 1175) + chr(0b1 + 0o62), 0b1000), ehT0Px3KOsy9(chr(812 - 764) + chr(3757 - 3646) + '\063' + chr(1258 - 1210) + chr(777 - 726), 8), ehT0Px3KOsy9(chr(48) + chr(111) + chr(51) + chr(0b110111) + chr(48), 0o10), ehT0Px3KOsy9(chr(717 - 669) + chr(11130 - 11019) + chr(50) + '\x32' + chr(55), 0o10), ehT0Px3KOsy9('\x30' + chr(0b111101 + 0o62) + chr(52) + '\063', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b10000 + 0o137) + chr(0b100010 + 0o17) + chr(51) + '\064', 11884 - 11876)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x35' + '\060', ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x19'), '\144' + chr(5455 - 5354) + chr(99) + chr(0b101010 + 0o105) + chr(0b1000110 + 0o36) + '\x65')('\x75' + chr(116) + '\x66' + '\x2d' + chr(1581 - 1525)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def mxADQH9hsI7e(oVre8I6UXc3b, EslsheI9XGkK):
oRa9_8I76Ond = fXk443epxtd5.loads(EslsheI9XGkK)
return xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'X\xb4\xa6v\xce\xee\xbf\x7f\x84\t\x11\r\xd9L\xc0\xf1\xc5`'), chr(3901 - 3801) + chr(695 - 594) + chr(0b1100011) + chr(0b1101111) + chr(0b111100 + 0o50) + chr(0b100100 + 0o101))('\x75' + chr(0b1110100) + chr(0b1100110) + chr(0b101101) + chr(2136 - 2080)))(oRa9_8I76Ond)
|
tensorflow/tensor2tensor
|
tensor2tensor/utils/hparam.py
|
HParams.values
|
def values(self):
"""Return the hyperparameter values as a Python dictionary.
Returns:
A dictionary with hyperparameter names as keys. The values are the
hyperparameter values.
"""
return {n: getattr(self, n) for n in self._hparam_types.keys()}
|
python
|
def values(self):
"""Return the hyperparameter values as a Python dictionary.
Returns:
A dictionary with hyperparameter names as keys. The values are the
hyperparameter values.
"""
return {n: getattr(self, n) for n in self._hparam_types.keys()}
|
[
"def",
"values",
"(",
"self",
")",
":",
"return",
"{",
"n",
":",
"getattr",
"(",
"self",
",",
"n",
")",
"for",
"n",
"in",
"self",
".",
"_hparam_types",
".",
"keys",
"(",
")",
"}"
] |
Return the hyperparameter values as a Python dictionary.
Returns:
A dictionary with hyperparameter names as keys. The values are the
hyperparameter values.
|
[
"Return",
"the",
"hyperparameter",
"values",
"as",
"a",
"Python",
"dictionary",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/utils/hparam.py#L574-L581
|
train
|
Return the hyperparameter values as a Python dictionary.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0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,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b100110 + 0o12) + chr(3004 - 2893) + '\x31' + '\x36' + chr(1135 - 1083), 22390 - 22382), ehT0Px3KOsy9(chr(48) + chr(0b1 + 0o156) + '\063' + chr(54) + chr(0b110010), 0o10), ehT0Px3KOsy9(chr(1334 - 1286) + chr(0b1101111) + '\061' + chr(1059 - 1005) + chr(141 - 87), 32281 - 32273), ehT0Px3KOsy9('\060' + chr(6558 - 6447) + chr(0b10110 + 0o34) + chr(1349 - 1294) + chr(0b101 + 0o62), 12794 - 12786), ehT0Px3KOsy9('\x30' + '\157' + '\063' + '\x30', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110110) + '\063', 23523 - 23515), ehT0Px3KOsy9('\x30' + chr(111) + '\063' + chr(0b11011 + 0o32) + '\067', ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + '\065', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1001011 + 0o44) + chr(49) + chr(0b110100) + chr(0b1 + 0o60), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b10111 + 0o130) + chr(1508 - 1456), 48536 - 48528), ehT0Px3KOsy9(chr(1824 - 1776) + chr(10912 - 10801) + chr(0b110011) + chr(52) + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x35' + chr(0b110111), 64722 - 64714), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b101110 + 0o5) + chr(0b1010 + 0o52) + '\064', 10798 - 10790), ehT0Px3KOsy9(chr(48) + chr(12142 - 12031) + chr(0b1100 + 0o53) + chr(0b10 + 0o65), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b11000 + 0o127) + '\063' + chr(0b110000) + chr(0b0 + 0o67), 0o10), ehT0Px3KOsy9('\x30' + chr(4894 - 4783) + chr(50) + chr(0b110111) + chr(48), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110010) + '\062' + '\067', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + '\064' + '\x32', 29526 - 29518), ehT0Px3KOsy9('\x30' + chr(0b1010110 + 0o31) + chr(0b1001 + 0o50) + chr(2507 - 2456), 0b1000), ehT0Px3KOsy9(chr(0b10011 + 0o35) + '\157' + chr(0b110 + 0o53) + chr(1224 - 1172) + '\064', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b101100 + 0o5) + '\x36' + chr(1671 - 1617), 8), ehT0Px3KOsy9('\x30' + chr(111) + '\x31' + chr(0b110100) + '\065', 0b1000), ehT0Px3KOsy9('\060' + chr(10587 - 10476) + chr(701 - 651) + chr(1047 - 993) + '\x31', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1010000 + 0o37) + chr(0b100110 + 0o13) + chr(49) + chr(0b10111 + 0o31), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(50) + chr(0b110010) + chr(54), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(443 - 392) + '\x36' + '\067', 38297 - 38289), ehT0Px3KOsy9(chr(2001 - 1953) + chr(0b1101111) + chr(0b100101 + 0o22) + chr(55), 8), ehT0Px3KOsy9('\060' + chr(0b110001 + 0o76) + chr(0b110010 + 0o0) + chr(1480 - 1432) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(0b101 + 0o53) + '\x6f' + chr(50) + '\061' + chr(0b1101 + 0o43), 35024 - 35016), ehT0Px3KOsy9(chr(0b11100 + 0o24) + chr(0b1101010 + 0o5) + '\x33' + chr(0b110111) + chr(1278 - 1226), 61821 - 61813), ehT0Px3KOsy9('\060' + chr(6497 - 6386) + '\063' + chr(55) + '\062', 0o10), ehT0Px3KOsy9(chr(977 - 929) + chr(0b1101111) + chr(0b110001) + chr(1977 - 1924) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(0b100000 + 0o21) + '\x33', 8), ehT0Px3KOsy9(chr(48) + chr(7142 - 7031) + '\x32' + chr(51) + chr(0b110010 + 0o5), 51356 - 51348), ehT0Px3KOsy9('\060' + chr(0b10110 + 0o131) + chr(0b110010) + chr(0b110111) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110011) + chr(48) + chr(625 - 571), ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + chr(1827 - 1774) + chr(50), 44172 - 44164), ehT0Px3KOsy9(chr(0b11 + 0o55) + chr(111) + '\x33' + chr(876 - 826) + '\064', 2317 - 2309), ehT0Px3KOsy9('\x30' + '\157' + chr(921 - 871) + chr(2011 - 1963) + '\061', 43325 - 43317), ehT0Px3KOsy9(chr(0b100 + 0o54) + chr(0b1101101 + 0o2) + '\x31' + '\061' + '\066', 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(1878 - 1825) + '\060', ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'Z'), chr(0b1001000 + 0o34) + chr(0b1100101) + '\x63' + chr(6645 - 6534) + '\x64' + chr(101))('\165' + '\x74' + chr(102) + '\055' + '\x38') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def SPnCNu54H1db(oVre8I6UXc3b):
return {m1NkCryOw9Bx: xafqLlk3kkUe(oVre8I6UXc3b, m1NkCryOw9Bx) for m1NkCryOw9Bx in xafqLlk3kkUe(oVre8I6UXc3b._hparam_types, xafqLlk3kkUe(SXOLrMavuUCe(b'\x1f\x97\x0f\xcc'), chr(100) + '\x65' + '\x63' + '\x6f' + chr(0b1100100) + chr(0b1100101))(chr(0b1100010 + 0o23) + chr(0b1110100) + chr(0b1100110) + '\055' + chr(56)))()}
|
tensorflow/tensor2tensor
|
tensor2tensor/utils/hparam.py
|
HParams.get
|
def get(self, key, default=None):
"""Returns the value of `key` if it exists, else `default`."""
if key in self._hparam_types:
# Ensure that default is compatible with the parameter type.
if default is not None:
param_type, is_param_list = self._hparam_types[key]
type_str = 'list<%s>' % param_type if is_param_list else str(param_type)
fail_msg = ("Hparam '%s' of type '%s' is incompatible with "
'default=%s' % (key, type_str, default))
is_default_list = isinstance(default, list)
if is_param_list != is_default_list:
raise ValueError(fail_msg)
try:
if is_default_list:
for value in default:
_cast_to_type_if_compatible(key, param_type, value)
else:
_cast_to_type_if_compatible(key, param_type, default)
except ValueError as e:
raise ValueError('%s. %s' % (fail_msg, e))
return getattr(self, key)
return default
|
python
|
def get(self, key, default=None):
"""Returns the value of `key` if it exists, else `default`."""
if key in self._hparam_types:
# Ensure that default is compatible with the parameter type.
if default is not None:
param_type, is_param_list = self._hparam_types[key]
type_str = 'list<%s>' % param_type if is_param_list else str(param_type)
fail_msg = ("Hparam '%s' of type '%s' is incompatible with "
'default=%s' % (key, type_str, default))
is_default_list = isinstance(default, list)
if is_param_list != is_default_list:
raise ValueError(fail_msg)
try:
if is_default_list:
for value in default:
_cast_to_type_if_compatible(key, param_type, value)
else:
_cast_to_type_if_compatible(key, param_type, default)
except ValueError as e:
raise ValueError('%s. %s' % (fail_msg, e))
return getattr(self, key)
return default
|
[
"def",
"get",
"(",
"self",
",",
"key",
",",
"default",
"=",
"None",
")",
":",
"if",
"key",
"in",
"self",
".",
"_hparam_types",
":",
"# Ensure that default is compatible with the parameter type.",
"if",
"default",
"is",
"not",
"None",
":",
"param_type",
",",
"is_param_list",
"=",
"self",
".",
"_hparam_types",
"[",
"key",
"]",
"type_str",
"=",
"'list<%s>'",
"%",
"param_type",
"if",
"is_param_list",
"else",
"str",
"(",
"param_type",
")",
"fail_msg",
"=",
"(",
"\"Hparam '%s' of type '%s' is incompatible with \"",
"'default=%s'",
"%",
"(",
"key",
",",
"type_str",
",",
"default",
")",
")",
"is_default_list",
"=",
"isinstance",
"(",
"default",
",",
"list",
")",
"if",
"is_param_list",
"!=",
"is_default_list",
":",
"raise",
"ValueError",
"(",
"fail_msg",
")",
"try",
":",
"if",
"is_default_list",
":",
"for",
"value",
"in",
"default",
":",
"_cast_to_type_if_compatible",
"(",
"key",
",",
"param_type",
",",
"value",
")",
"else",
":",
"_cast_to_type_if_compatible",
"(",
"key",
",",
"param_type",
",",
"default",
")",
"except",
"ValueError",
"as",
"e",
":",
"raise",
"ValueError",
"(",
"'%s. %s'",
"%",
"(",
"fail_msg",
",",
"e",
")",
")",
"return",
"getattr",
"(",
"self",
",",
"key",
")",
"return",
"default"
] |
Returns the value of `key` if it exists, else `default`.
|
[
"Returns",
"the",
"value",
"of",
"key",
"if",
"it",
"exists",
"else",
"default",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/utils/hparam.py#L583-L608
|
train
|
Returns the value of key if it exists else default.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,p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UzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\x30' + '\x6f' + '\x33' + '\062' + chr(0b11011 + 0o26), 0o10), ehT0Px3KOsy9(chr(260 - 212) + '\x6f' + '\062' + '\061' + chr(0b1 + 0o61), 0o10), ehT0Px3KOsy9(chr(2176 - 2128) + chr(0b1000011 + 0o54) + chr(325 - 276) + chr(55) + chr(2335 - 2284), 55389 - 55381), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101110 + 0o1) + chr(0b110011) + chr(52), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + '\062' + chr(0b1101 + 0o50), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(51) + chr(2749 - 2695) + '\062', ord("\x08")), ehT0Px3KOsy9(chr(0b11011 + 0o25) + chr(0b1101111) + chr(0b11111 + 0o22) + chr(1750 - 1697) + '\x36', 0o10), ehT0Px3KOsy9('\x30' + chr(0b1100011 + 0o14) + '\062' + chr(0b110001) + chr(0b1001 + 0o50), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110010) + '\063' + '\x32', 0o10), ehT0Px3KOsy9(chr(1366 - 1318) + chr(0b1101111) + chr(0b110010 + 0o0) + chr(0b110011) + chr(599 - 545), 0b1000), ehT0Px3KOsy9(chr(0b101010 + 0o6) + '\157' + chr(0b110011) + chr(0b101000 + 0o15) + '\x33', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(7089 - 6978) + chr(1758 - 1708) + '\x31' + chr(0b110101), 0b1000), ehT0Px3KOsy9(chr(672 - 624) + '\157' + '\061' + '\064' + '\066', 0b1000), ehT0Px3KOsy9('\060' + chr(0b1010001 + 0o36) + chr(789 - 738) + '\x30' + '\x37', 0o10), ehT0Px3KOsy9(chr(622 - 574) + chr(8797 - 8686) + chr(0b110010) + '\x34' + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(688 - 640) + chr(0b1101111) + chr(1823 - 1773) + chr(0b101110 + 0o11), 26378 - 26370), ehT0Px3KOsy9(chr(572 - 524) + '\x6f' + chr(0b11010 + 0o30) + '\x30' + chr(0b101111 + 0o2), 38941 - 38933), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(210 - 160) + '\064' + chr(0b110111), 8), ehT0Px3KOsy9(chr(1787 - 1739) + '\x6f' + chr(52) + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x32' + '\066' + chr(641 - 591), 35026 - 35018), ehT0Px3KOsy9(chr(836 - 788) + chr(8385 - 8274) + chr(51) + chr(55), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(49) + chr(0b110010) + '\065', 10051 - 10043), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(2061 - 2010) + chr(106 - 55) + chr(0b1101 + 0o46), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(1950 - 1899) + chr(0b110100) + '\x30', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110010) + '\067' + chr(2804 - 2749), 0o10), ehT0Px3KOsy9(chr(0b10011 + 0o35) + chr(0b1000001 + 0o56) + chr(0b10011 + 0o40) + chr(48) + chr(51), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1000000 + 0o57) + chr(50) + chr(1845 - 1795) + '\060', 51866 - 51858), ehT0Px3KOsy9('\x30' + chr(198 - 87) + chr(50) + '\x37' + chr(1238 - 1189), 0o10), ehT0Px3KOsy9(chr(0b1110 + 0o42) + chr(7154 - 7043) + chr(0b111 + 0o54) + chr(2164 - 2113), 40216 - 40208), ehT0Px3KOsy9(chr(48) + chr(7376 - 7265) + chr(1563 - 1511) + chr(0b101 + 0o55), 8), ehT0Px3KOsy9(chr(0b110 + 0o52) + chr(8128 - 8017) + chr(0b100101 + 0o15) + chr(0b110010 + 0o5) + chr(49), 8), ehT0Px3KOsy9(chr(2227 - 2179) + chr(0b1010111 + 0o30) + chr(757 - 706) + chr(0b110100) + chr(0b110100), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b110101 + 0o72) + chr(1078 - 1024) + chr(55), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(5032 - 4921) + '\x37' + chr(50), ord("\x08")), ehT0Px3KOsy9(chr(948 - 900) + chr(111) + '\067' + chr(51), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b100100 + 0o17), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110010) + chr(0b110000) + chr(0b111 + 0o56), 46084 - 46076), ehT0Px3KOsy9('\060' + chr(111) + chr(1437 - 1387) + '\x37' + '\064', ord("\x08")), ehT0Px3KOsy9(chr(0b10011 + 0o35) + '\157' + chr(0b10101 + 0o40), 0o10), ehT0Px3KOsy9(chr(48) + chr(5130 - 5019) + '\x31' + chr(51) + chr(0b110000), 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + chr(2199 - 2088) + '\x35' + chr(0b10 + 0o56), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xff'), chr(0b1100100) + chr(101) + chr(0b1100011) + chr(0b1101111) + chr(100) + '\145')('\x75' + '\x74' + chr(7807 - 7705) + chr(0b100010 + 0o13) + '\x38') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def Q8b5UytA0vqH(oVre8I6UXc3b, K3J4ZwSlE0sT, t1v7afVhe01t=None):
if K3J4ZwSlE0sT in xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x82\xe5\x12d\x7f\x87\x0b\xeb\xdc\xd6\xaf\xc0'), chr(0b1100100) + chr(5484 - 5383) + '\143' + chr(0b1101111) + chr(6546 - 6446) + chr(101))(chr(117) + '\x74' + chr(102) + '\x2d' + chr(0b100011 + 0o25))):
if t1v7afVhe01t is not None:
(LYEGMLiiZQHD, SZ7KQPzfpSHF) = oVre8I6UXc3b.SoixjuebFHDM[K3J4ZwSlE0sT]
dSlAMRKOSDl0 = xafqLlk3kkUe(SXOLrMavuUCe(b'\xbd\xe3\x08h)\xd7\x1d\xb7'), '\x64' + chr(0b1011110 + 0o7) + '\x63' + chr(9601 - 9490) + '\144' + chr(0b1100101))(chr(117) + chr(116) + chr(4810 - 4708) + chr(0b100101 + 0o10) + chr(3018 - 2962)) % LYEGMLiiZQHD if SZ7KQPzfpSHF else M8_cKLkHVB2V(LYEGMLiiZQHD)
jqM6bLL6OqDG = xafqLlk3kkUe(SXOLrMavuUCe(b'\x99\xfa\x1ant\x9fN\xae\xbf\xed\xcc\xad\t\xa1\x87c\xf8\xd7G\x928p\xa8\xc7\x9f\xaa\xe3\x99rL\xda\x8bZJZw\xec\xdei=\xf1\xfd\x12h}\xd2\n\xec\xfc\xff\x9e\xe1\x12\xfa\x82d'), '\x64' + '\x65' + '\143' + '\x6f' + '\144' + chr(8627 - 8526))(chr(0b1001 + 0o154) + chr(0b1011011 + 0o31) + chr(0b101011 + 0o73) + chr(0b101101) + chr(56)) % (K3J4ZwSlE0sT, dSlAMRKOSDl0, t1v7afVhe01t)
WF3IIx4culVc = PlSM16l2KDPD(t1v7afVhe01t, YyaZ4tpXu4lf)
if SZ7KQPzfpSHF != WF3IIx4culVc:
raise q1QCh3W88sgk(jqM6bLL6OqDG)
try:
if WF3IIx4culVc:
for QmmgWUB13VCJ in t1v7afVhe01t:
VBzBO2ISE9N0(K3J4ZwSlE0sT, LYEGMLiiZQHD, QmmgWUB13VCJ)
else:
VBzBO2ISE9N0(K3J4ZwSlE0sT, LYEGMLiiZQHD, t1v7afVhe01t)
except q1QCh3W88sgk as GlnVAPeT6CUe:
raise q1QCh3W88sgk(xafqLlk3kkUe(SXOLrMavuUCe(b'\xf4\xf9U<0\x81'), '\144' + chr(0b1100101) + chr(0b1100011) + chr(0b1101111) + chr(0b1011101 + 0o7) + '\145')('\165' + chr(693 - 577) + '\146' + '\055' + '\070') % (jqM6bLL6OqDG, GlnVAPeT6CUe))
return xafqLlk3kkUe(oVre8I6UXc3b, K3J4ZwSlE0sT)
return t1v7afVhe01t
|
tensorflow/tensor2tensor
|
tensor2tensor/utils/hparam.py
|
HParams._get_kind_name
|
def _get_kind_name(param_type, is_list):
"""Returns the field name given parameter type and is_list.
Args:
param_type: Data type of the hparam.
is_list: Whether this is a list.
Returns:
A string representation of the field name.
Raises:
ValueError: If parameter type is not recognized.
"""
if issubclass(param_type, bool):
# This check must happen before issubclass(param_type, six.integer_types),
# since Python considers bool to be a subclass of int.
typename = 'bool'
elif issubclass(param_type, six.integer_types):
# Setting 'int' and 'long' types to be 'int64' to ensure the type is
# compatible with both Python2 and Python3.
typename = 'int64'
elif issubclass(param_type, (six.string_types, six.binary_type)):
# Setting 'string' and 'bytes' types to be 'bytes' to ensure the type is
# compatible with both Python2 and Python3.
typename = 'bytes'
elif issubclass(param_type, float):
typename = 'float'
else:
raise ValueError('Unsupported parameter type: %s' % str(param_type))
suffix = 'list' if is_list else 'value'
return '_'.join([typename, suffix])
|
python
|
def _get_kind_name(param_type, is_list):
"""Returns the field name given parameter type and is_list.
Args:
param_type: Data type of the hparam.
is_list: Whether this is a list.
Returns:
A string representation of the field name.
Raises:
ValueError: If parameter type is not recognized.
"""
if issubclass(param_type, bool):
# This check must happen before issubclass(param_type, six.integer_types),
# since Python considers bool to be a subclass of int.
typename = 'bool'
elif issubclass(param_type, six.integer_types):
# Setting 'int' and 'long' types to be 'int64' to ensure the type is
# compatible with both Python2 and Python3.
typename = 'int64'
elif issubclass(param_type, (six.string_types, six.binary_type)):
# Setting 'string' and 'bytes' types to be 'bytes' to ensure the type is
# compatible with both Python2 and Python3.
typename = 'bytes'
elif issubclass(param_type, float):
typename = 'float'
else:
raise ValueError('Unsupported parameter type: %s' % str(param_type))
suffix = 'list' if is_list else 'value'
return '_'.join([typename, suffix])
|
[
"def",
"_get_kind_name",
"(",
"param_type",
",",
"is_list",
")",
":",
"if",
"issubclass",
"(",
"param_type",
",",
"bool",
")",
":",
"# This check must happen before issubclass(param_type, six.integer_types),",
"# since Python considers bool to be a subclass of int.",
"typename",
"=",
"'bool'",
"elif",
"issubclass",
"(",
"param_type",
",",
"six",
".",
"integer_types",
")",
":",
"# Setting 'int' and 'long' types to be 'int64' to ensure the type is",
"# compatible with both Python2 and Python3.",
"typename",
"=",
"'int64'",
"elif",
"issubclass",
"(",
"param_type",
",",
"(",
"six",
".",
"string_types",
",",
"six",
".",
"binary_type",
")",
")",
":",
"# Setting 'string' and 'bytes' types to be 'bytes' to ensure the type is",
"# compatible with both Python2 and Python3.",
"typename",
"=",
"'bytes'",
"elif",
"issubclass",
"(",
"param_type",
",",
"float",
")",
":",
"typename",
"=",
"'float'",
"else",
":",
"raise",
"ValueError",
"(",
"'Unsupported parameter type: %s'",
"%",
"str",
"(",
"param_type",
")",
")",
"suffix",
"=",
"'list'",
"if",
"is_list",
"else",
"'value'",
"return",
"'_'",
".",
"join",
"(",
"[",
"typename",
",",
"suffix",
"]",
")"
] |
Returns the field name given parameter type and is_list.
Args:
param_type: Data type of the hparam.
is_list: Whether this is a list.
Returns:
A string representation of the field name.
Raises:
ValueError: If parameter type is not recognized.
|
[
"Returns",
"the",
"field",
"name",
"given",
"parameter",
"type",
"and",
"is_list",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/utils/hparam.py#L620-L651
|
train
|
Returns the field name given the parameter type and is_list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UMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b10011 + 0o35) + '\x6f' + chr(51) + chr(0b10 + 0o64) + '\060', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1011110 + 0o21) + chr(0b10010 + 0o37) + chr(50) + chr(1401 - 1353), 0b1000), ehT0Px3KOsy9(chr(1661 - 1613) + '\157' + chr(50) + chr(51), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(50) + chr(0b110011) + '\x36', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(4624 - 4513) + '\065' + '\x33', 0b1000), ehT0Px3KOsy9(chr(2168 - 2120) + '\157' + '\061' + '\x31' + '\067', 17995 - 17987), ehT0Px3KOsy9(chr(0b1 + 0o57) + '\x6f' + chr(0b110011) + chr(0b110 + 0o60) + chr(54), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + '\061' + chr(70 - 20) + chr(2334 - 2284), 0o10), ehT0Px3KOsy9('\x30' + chr(3344 - 3233) + chr(0b110101) + chr(52), 49630 - 49622), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x33' + chr(0b111 + 0o54), ord("\x08")), ehT0Px3KOsy9(chr(0b101110 + 0o2) + '\x6f' + chr(0b110000 + 0o2) + '\x36' + chr(48), 0o10), ehT0Px3KOsy9(chr(0b11 + 0o55) + '\157' + '\x33' + chr(0b11011 + 0o33) + chr(53), 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(273 - 224) + chr(1537 - 1486) + chr(0b110011), 0b1000), ehT0Px3KOsy9(chr(0b101000 + 0o10) + chr(0b11100 + 0o123) + '\062' + chr(55) + '\061', ord("\x08")), ehT0Px3KOsy9(chr(0b0 + 0o60) + chr(0b1011010 + 0o25) + '\x33' + '\066' + chr(1490 - 1440), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(8596 - 8485) + chr(0b10001 + 0o41) + '\062' + '\065', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1001100 + 0o43) + chr(50) + chr(0b110011) + chr(2666 - 2614), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110011) + chr(50) + chr(0b110110), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(49) + '\x32', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x30', 44138 - 44130), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\063' + chr(1722 - 1668) + chr(0b101011 + 0o12), 8), ehT0Px3KOsy9(chr(48) + chr(0b110000 + 0o77) + '\x33' + chr(0b110010) + '\064', 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110010) + chr(1014 - 959) + chr(0b110101), 0b1000), ehT0Px3KOsy9(chr(0b100000 + 0o20) + chr(7950 - 7839) + chr(0b110001) + chr(0b110010) + chr(54), 24284 - 24276), ehT0Px3KOsy9(chr(1145 - 1097) + chr(2668 - 2557) + chr(0b100111 + 0o14) + chr(0b1011 + 0o45) + chr(48), 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(49) + '\062' + chr(1024 - 974), 8), ehT0Px3KOsy9(chr(48) + chr(1305 - 1194) + chr(0b110010) + chr(772 - 719) + '\062', 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111 + 0o0) + chr(0b110110) + chr(0b101100 + 0o7), 62269 - 62261), ehT0Px3KOsy9(chr(48) + chr(10284 - 10173) + chr(0b110010) + chr(0b1111 + 0o47) + chr(951 - 902), ord("\x08")), ehT0Px3KOsy9(chr(0b101 + 0o53) + chr(0b1101110 + 0o1) + chr(0b10000 + 0o41) + chr(0b11001 + 0o32) + '\061', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1000010 + 0o55) + chr(51) + chr(0b100 + 0o56) + chr(1617 - 1565), 8), ehT0Px3KOsy9(chr(48) + chr(111) + '\x31' + chr(2117 - 2063), 22740 - 22732), ehT0Px3KOsy9(chr(1006 - 958) + chr(0b1101011 + 0o4) + chr(0b110010) + '\x32' + '\062', 0b1000), ehT0Px3KOsy9(chr(1005 - 957) + chr(0b1101111) + '\x31' + '\060' + chr(1996 - 1941), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(672 - 618) + '\x30', 26107 - 26099), ehT0Px3KOsy9(chr(0b110000) + chr(0b1010011 + 0o34) + '\x36' + chr(1013 - 958), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(11432 - 11321) + chr(2263 - 2208) + chr(467 - 414), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b100100 + 0o113) + '\062' + chr(114 - 64) + chr(0b10010 + 0o42), 0o10), ehT0Px3KOsy9('\060' + '\157' + '\067' + chr(1127 - 1077), 0b1000), ehT0Px3KOsy9(chr(0b10011 + 0o35) + chr(111) + chr(0b110011) + chr(0b100011 + 0o16) + chr(0b10010 + 0o45), 52808 - 52800)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(2445 - 2392) + '\060', 14487 - 14479)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xde'), chr(0b1001000 + 0o34) + chr(0b1100101) + chr(2708 - 2609) + chr(6176 - 6065) + chr(0b1001 + 0o133) + chr(0b1001011 + 0o32))('\165' + chr(5567 - 5451) + chr(5972 - 5870) + chr(0b101101) + chr(1380 - 1324)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def o10ymQL9eeu1(LYEGMLiiZQHD, LacZWOkwfU42):
if J6u1YyThfhgG(LYEGMLiiZQHD, WbBjf8Y7v9VN):
_THI3yzfNyu7 = xafqLlk3kkUe(SXOLrMavuUCe(b'\x92?|\xf2'), '\x64' + chr(3483 - 3382) + chr(0b1001011 + 0o30) + chr(0b1101111) + chr(0b11001 + 0o113) + chr(0b1100101))(chr(0b1110101) + chr(116) + chr(0b1011011 + 0o13) + chr(871 - 826) + chr(0b111000))
elif J6u1YyThfhgG(LYEGMLiiZQHD, xafqLlk3kkUe(sYby0kpfssd4, xafqLlk3kkUe(SXOLrMavuUCe(b'\x99>g\xfbL*\x84\rXb\xc0\x90('), '\144' + chr(101) + chr(9615 - 9516) + '\157' + '\144' + chr(9930 - 9829))(chr(4638 - 4521) + chr(116) + chr(3874 - 3772) + chr(0b100 + 0o51) + '\x38'))):
_THI3yzfNyu7 = xafqLlk3kkUe(SXOLrMavuUCe(b'\x99>g\xa8\x1f'), chr(0b1100100) + chr(101) + chr(0b110110 + 0o55) + chr(0b111100 + 0o63) + chr(0b1100100) + '\145')(chr(0b1110101) + chr(116) + '\x66' + chr(45) + chr(0b100101 + 0o23))
elif J6u1YyThfhgG(LYEGMLiiZQHD, (xafqLlk3kkUe(sYby0kpfssd4, xafqLlk3kkUe(SXOLrMavuUCe(b'\x83$a\xf7E(\xa9&Uk\xd5\x86'), chr(0b11001 + 0o113) + chr(3597 - 3496) + chr(99) + chr(111) + chr(100) + chr(101))(chr(0b1110101) + chr(7351 - 7235) + chr(7716 - 7614) + chr(2001 - 1956) + '\x38')), xafqLlk3kkUe(sYby0kpfssd4, xafqLlk3kkUe(SXOLrMavuUCe(b'\x929}\xffY6\xa9&Uk\xd5'), chr(100) + '\145' + chr(99) + '\x6f' + '\144' + '\x65')(chr(0b1110101) + chr(116) + chr(0b1101 + 0o131) + '\x2d' + '\x38')))):
_THI3yzfNyu7 = xafqLlk3kkUe(SXOLrMavuUCe(b'\x92)g\xfbX'), chr(0b110 + 0o136) + chr(0b1010101 + 0o20) + chr(0b1001011 + 0o30) + chr(111) + chr(100) + chr(0b1010010 + 0o23))(chr(117) + '\164' + '\x66' + '\055' + chr(56))
elif J6u1YyThfhgG(LYEGMLiiZQHD, kkSX4ccExqw4):
_THI3yzfNyu7 = xafqLlk3kkUe(SXOLrMavuUCe(b'\x96<|\xff_'), chr(0b110010 + 0o62) + chr(101) + chr(7374 - 7275) + '\x6f' + chr(1555 - 1455) + chr(0b1100101))('\165' + chr(0b11 + 0o161) + chr(0b1001001 + 0o35) + '\055' + '\x38')
else:
raise q1QCh3W88sgk(xafqLlk3kkUe(SXOLrMavuUCe(b'\xa5>`\xeb[?\x99 X~\xd4\xd5+\xd8\x80\xf4\xf1\xb3~e\x87\xf4\xc9/\xb07\x90\x13\x94*'), chr(0b1000 + 0o134) + chr(3759 - 3658) + '\143' + '\157' + '\x64' + chr(0b1100101))(chr(117) + '\164' + '\146' + '\x2d' + '\x38') % M8_cKLkHVB2V(LYEGMLiiZQHD))
YhhkyMvxPIjH = xafqLlk3kkUe(SXOLrMavuUCe(b'\x9c9`\xea'), chr(0b1100100) + '\x65' + chr(9081 - 8982) + '\x6f' + chr(0b1100100) + '\x65')(chr(0b1001101 + 0o50) + chr(0b1010110 + 0o36) + chr(0b1011011 + 0o13) + chr(355 - 310) + chr(56)) if LacZWOkwfU42 else xafqLlk3kkUe(SXOLrMavuUCe(b'\x861\x7f\xebN'), chr(100) + chr(0b10100 + 0o121) + chr(0b1010001 + 0o22) + '\x6f' + chr(2935 - 2835) + chr(3309 - 3208))(chr(0b10010 + 0o143) + '\164' + chr(0b1100110) + chr(45) + chr(0b100 + 0o64))
return xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'\xaf'), chr(100) + '\145' + chr(99) + '\157' + chr(0b1100100) + chr(101))(chr(10072 - 9955) + chr(0b101110 + 0o106) + '\146' + '\055' + '\x38'), xafqLlk3kkUe(SXOLrMavuUCe(b'\x9a?z\xf0'), '\x64' + '\x65' + '\x63' + chr(12239 - 12128) + '\x64' + chr(0b1100101))(chr(0b1110101) + chr(116) + chr(0b1100110) + chr(45) + chr(1471 - 1415)))([_THI3yzfNyu7, YhhkyMvxPIjH])
|
tensorflow/tensor2tensor
|
tensor2tensor/insights/transformer_model.py
|
TransformerModel.process
|
def process(self, query):
"""Returns the visualizations for query.
Args:
query: The query to process.
Returns:
A dictionary of results with processing and graph visualizations.
"""
tf.logging.info("Processing new query [%s]" %query)
# Create the new TFDBG hook directory.
hook_dir = "/tmp/t2t_server_dump/request_%d" %int(time.time())
os.makedirs(hook_dir)
hooks = [tfdbg.DumpingDebugHook(hook_dir, watch_fn=topk_watch_fn)]
# TODO(kstevens): This is extremely hacky and slow for responding to
# queries. Figure out a reasonable way to pre-load the model weights before
# forking and run queries through the estimator quickly.
def server_input_fn():
"""Generator that returns just the current query."""
for _ in range(1):
input_ids = self.source_vocab.encode(query)
input_ids.append(text_encoder.EOS_ID)
x = [1, 100, len(input_ids)] + input_ids
x += [0] * (self.const_array_size - len(x))
d = {
"inputs": np.array(x).astype(np.int32),
}
yield d
def input_fn():
"""Generator that returns just the current query."""
gen_fn = decoding.make_input_fn_from_generator(server_input_fn())
example = gen_fn()
# TODO(kstevens): Make this method public
# pylint: disable=protected-access
return decoding._interactive_input_tensor_to_features_dict(
example, self.hparams)
# Make the prediction for the current query.
result_iter = self.estimator.predict(input_fn, hooks=hooks)
result = None
for result in result_iter:
break
# Extract the beam search information by reading the dumped TFDBG event
# tensors. We first read and record the per step beam sequences then record
# the beam scores. Afterwards we align the two sets of values to create the
# full graph vertices and edges.
decoding_graph = graph.Graph()
run_dirs = sorted(glob.glob(os.path.join(hook_dir, "run_*")))
for run_dir in run_dirs:
# Record the different completed and active beam sequence ids.
alive_sequences = deque()
finished_sequences = deque()
# Make the root vertex since it always needs to exist.
decoding_graph.get_vertex(sequence_key([0]))
# Create the initial vertices and edges for the active and finished
# sequences. We uniquely define each vertex using it's full sequence path
# as a string to ensure there's no collisions when the same step has two
# instances of an output id.
dump_dir = tfdbg.DebugDumpDir(run_dir, validate=False)
seq_datums = dump_dir.find(predicate=seq_filter)
for seq_datum in seq_datums:
sequences = np.array(seq_datum.get_tensor()).astype(int)[0]
if "alive" in seq_datum.node_name:
alive_sequences.append(sequences)
if "finished" in seq_datum.node_name:
finished_sequences.append(sequences)
for sequence in sequences:
pieces = self.targets_vocab.decode_list(sequence)
index = sequence[-1]
if index == 0:
continue
parent = decoding_graph.get_vertex(sequence_key(sequence[:-1]))
current = decoding_graph.get_vertex(sequence_key(sequence))
edge = decoding_graph.add_edge(parent, current)
edge.data["label"] = pieces[-1]
edge.data["label_id"] = index
# Coerce the type to be a python bool. Numpy bools can't be easily
# converted to JSON.
edge.data["completed"] = bool(index == 1)
# Examine the score results and store the scores with the associated edges
# in the graph. We fetch the vertices (and relevant edges) by looking
# into the saved beam sequences stored above.
score_datums = dump_dir.find(predicate=scores_filter)
for score_datum in score_datums:
if "alive" in score_datum.node_name:
sequences = alive_sequences.popleft()
if "finished" in score_datum.node_name:
sequences = finished_sequences.popleft()
scores = np.array(score_datum.get_tensor()).astype(float)[0]
for i, score in enumerate(scores):
sequence = sequences[i]
if sequence[-1] == 0:
continue
vertex = decoding_graph.get_vertex(sequence_key(sequence))
edge = decoding_graph.edges[vertex.in_edges[0]]
edge.data["score"] = score
edge.data["log_probability"] = score
edge.data["total_log_probability"] = score
# Delete the hook dir to save disk space
shutil.rmtree(hook_dir)
# Create the graph visualization data structure.
graph_vis = {
"visualization_name": "graph",
"title": "Graph",
"name": "graph",
"search_graph": decoding_graph.to_dict(),
}
# Create the processing visualization data structure.
# TODO(kstevens): Make this method public
# pylint: disable=protected-access
output_ids = decoding._save_until_eos(result["outputs"].flatten(), False)
output_pieces = self.targets_vocab.decode_list(output_ids)
output_token = [{"text": piece} for piece in output_pieces]
output = self.targets_vocab.decode(output_ids)
source_steps = [{
"step_name": "Initial",
"segment": [{
"text": query
}],
}]
target_steps = [{
"step_name": "Initial",
"segment": output_token,
}, {
"step_name": "Final",
"segment": [{
"text": output
}],
}]
processing_vis = {
"visualization_name": "processing",
"title": "Processing",
"name": "processing",
"query_processing": {
"source_processing": source_steps,
"target_processing": target_steps,
},
}
return {
"result": [processing_vis, graph_vis],
}
|
python
|
def process(self, query):
"""Returns the visualizations for query.
Args:
query: The query to process.
Returns:
A dictionary of results with processing and graph visualizations.
"""
tf.logging.info("Processing new query [%s]" %query)
# Create the new TFDBG hook directory.
hook_dir = "/tmp/t2t_server_dump/request_%d" %int(time.time())
os.makedirs(hook_dir)
hooks = [tfdbg.DumpingDebugHook(hook_dir, watch_fn=topk_watch_fn)]
# TODO(kstevens): This is extremely hacky and slow for responding to
# queries. Figure out a reasonable way to pre-load the model weights before
# forking and run queries through the estimator quickly.
def server_input_fn():
"""Generator that returns just the current query."""
for _ in range(1):
input_ids = self.source_vocab.encode(query)
input_ids.append(text_encoder.EOS_ID)
x = [1, 100, len(input_ids)] + input_ids
x += [0] * (self.const_array_size - len(x))
d = {
"inputs": np.array(x).astype(np.int32),
}
yield d
def input_fn():
"""Generator that returns just the current query."""
gen_fn = decoding.make_input_fn_from_generator(server_input_fn())
example = gen_fn()
# TODO(kstevens): Make this method public
# pylint: disable=protected-access
return decoding._interactive_input_tensor_to_features_dict(
example, self.hparams)
# Make the prediction for the current query.
result_iter = self.estimator.predict(input_fn, hooks=hooks)
result = None
for result in result_iter:
break
# Extract the beam search information by reading the dumped TFDBG event
# tensors. We first read and record the per step beam sequences then record
# the beam scores. Afterwards we align the two sets of values to create the
# full graph vertices and edges.
decoding_graph = graph.Graph()
run_dirs = sorted(glob.glob(os.path.join(hook_dir, "run_*")))
for run_dir in run_dirs:
# Record the different completed and active beam sequence ids.
alive_sequences = deque()
finished_sequences = deque()
# Make the root vertex since it always needs to exist.
decoding_graph.get_vertex(sequence_key([0]))
# Create the initial vertices and edges for the active and finished
# sequences. We uniquely define each vertex using it's full sequence path
# as a string to ensure there's no collisions when the same step has two
# instances of an output id.
dump_dir = tfdbg.DebugDumpDir(run_dir, validate=False)
seq_datums = dump_dir.find(predicate=seq_filter)
for seq_datum in seq_datums:
sequences = np.array(seq_datum.get_tensor()).astype(int)[0]
if "alive" in seq_datum.node_name:
alive_sequences.append(sequences)
if "finished" in seq_datum.node_name:
finished_sequences.append(sequences)
for sequence in sequences:
pieces = self.targets_vocab.decode_list(sequence)
index = sequence[-1]
if index == 0:
continue
parent = decoding_graph.get_vertex(sequence_key(sequence[:-1]))
current = decoding_graph.get_vertex(sequence_key(sequence))
edge = decoding_graph.add_edge(parent, current)
edge.data["label"] = pieces[-1]
edge.data["label_id"] = index
# Coerce the type to be a python bool. Numpy bools can't be easily
# converted to JSON.
edge.data["completed"] = bool(index == 1)
# Examine the score results and store the scores with the associated edges
# in the graph. We fetch the vertices (and relevant edges) by looking
# into the saved beam sequences stored above.
score_datums = dump_dir.find(predicate=scores_filter)
for score_datum in score_datums:
if "alive" in score_datum.node_name:
sequences = alive_sequences.popleft()
if "finished" in score_datum.node_name:
sequences = finished_sequences.popleft()
scores = np.array(score_datum.get_tensor()).astype(float)[0]
for i, score in enumerate(scores):
sequence = sequences[i]
if sequence[-1] == 0:
continue
vertex = decoding_graph.get_vertex(sequence_key(sequence))
edge = decoding_graph.edges[vertex.in_edges[0]]
edge.data["score"] = score
edge.data["log_probability"] = score
edge.data["total_log_probability"] = score
# Delete the hook dir to save disk space
shutil.rmtree(hook_dir)
# Create the graph visualization data structure.
graph_vis = {
"visualization_name": "graph",
"title": "Graph",
"name": "graph",
"search_graph": decoding_graph.to_dict(),
}
# Create the processing visualization data structure.
# TODO(kstevens): Make this method public
# pylint: disable=protected-access
output_ids = decoding._save_until_eos(result["outputs"].flatten(), False)
output_pieces = self.targets_vocab.decode_list(output_ids)
output_token = [{"text": piece} for piece in output_pieces]
output = self.targets_vocab.decode(output_ids)
source_steps = [{
"step_name": "Initial",
"segment": [{
"text": query
}],
}]
target_steps = [{
"step_name": "Initial",
"segment": output_token,
}, {
"step_name": "Final",
"segment": [{
"text": output
}],
}]
processing_vis = {
"visualization_name": "processing",
"title": "Processing",
"name": "processing",
"query_processing": {
"source_processing": source_steps,
"target_processing": target_steps,
},
}
return {
"result": [processing_vis, graph_vis],
}
|
[
"def",
"process",
"(",
"self",
",",
"query",
")",
":",
"tf",
".",
"logging",
".",
"info",
"(",
"\"Processing new query [%s]\"",
"%",
"query",
")",
"# Create the new TFDBG hook directory.",
"hook_dir",
"=",
"\"/tmp/t2t_server_dump/request_%d\"",
"%",
"int",
"(",
"time",
".",
"time",
"(",
")",
")",
"os",
".",
"makedirs",
"(",
"hook_dir",
")",
"hooks",
"=",
"[",
"tfdbg",
".",
"DumpingDebugHook",
"(",
"hook_dir",
",",
"watch_fn",
"=",
"topk_watch_fn",
")",
"]",
"# TODO(kstevens): This is extremely hacky and slow for responding to",
"# queries. Figure out a reasonable way to pre-load the model weights before",
"# forking and run queries through the estimator quickly.",
"def",
"server_input_fn",
"(",
")",
":",
"\"\"\"Generator that returns just the current query.\"\"\"",
"for",
"_",
"in",
"range",
"(",
"1",
")",
":",
"input_ids",
"=",
"self",
".",
"source_vocab",
".",
"encode",
"(",
"query",
")",
"input_ids",
".",
"append",
"(",
"text_encoder",
".",
"EOS_ID",
")",
"x",
"=",
"[",
"1",
",",
"100",
",",
"len",
"(",
"input_ids",
")",
"]",
"+",
"input_ids",
"x",
"+=",
"[",
"0",
"]",
"*",
"(",
"self",
".",
"const_array_size",
"-",
"len",
"(",
"x",
")",
")",
"d",
"=",
"{",
"\"inputs\"",
":",
"np",
".",
"array",
"(",
"x",
")",
".",
"astype",
"(",
"np",
".",
"int32",
")",
",",
"}",
"yield",
"d",
"def",
"input_fn",
"(",
")",
":",
"\"\"\"Generator that returns just the current query.\"\"\"",
"gen_fn",
"=",
"decoding",
".",
"make_input_fn_from_generator",
"(",
"server_input_fn",
"(",
")",
")",
"example",
"=",
"gen_fn",
"(",
")",
"# TODO(kstevens): Make this method public",
"# pylint: disable=protected-access",
"return",
"decoding",
".",
"_interactive_input_tensor_to_features_dict",
"(",
"example",
",",
"self",
".",
"hparams",
")",
"# Make the prediction for the current query.",
"result_iter",
"=",
"self",
".",
"estimator",
".",
"predict",
"(",
"input_fn",
",",
"hooks",
"=",
"hooks",
")",
"result",
"=",
"None",
"for",
"result",
"in",
"result_iter",
":",
"break",
"# Extract the beam search information by reading the dumped TFDBG event",
"# tensors. We first read and record the per step beam sequences then record",
"# the beam scores. Afterwards we align the two sets of values to create the",
"# full graph vertices and edges.",
"decoding_graph",
"=",
"graph",
".",
"Graph",
"(",
")",
"run_dirs",
"=",
"sorted",
"(",
"glob",
".",
"glob",
"(",
"os",
".",
"path",
".",
"join",
"(",
"hook_dir",
",",
"\"run_*\"",
")",
")",
")",
"for",
"run_dir",
"in",
"run_dirs",
":",
"# Record the different completed and active beam sequence ids.",
"alive_sequences",
"=",
"deque",
"(",
")",
"finished_sequences",
"=",
"deque",
"(",
")",
"# Make the root vertex since it always needs to exist.",
"decoding_graph",
".",
"get_vertex",
"(",
"sequence_key",
"(",
"[",
"0",
"]",
")",
")",
"# Create the initial vertices and edges for the active and finished",
"# sequences. We uniquely define each vertex using it's full sequence path",
"# as a string to ensure there's no collisions when the same step has two",
"# instances of an output id.",
"dump_dir",
"=",
"tfdbg",
".",
"DebugDumpDir",
"(",
"run_dir",
",",
"validate",
"=",
"False",
")",
"seq_datums",
"=",
"dump_dir",
".",
"find",
"(",
"predicate",
"=",
"seq_filter",
")",
"for",
"seq_datum",
"in",
"seq_datums",
":",
"sequences",
"=",
"np",
".",
"array",
"(",
"seq_datum",
".",
"get_tensor",
"(",
")",
")",
".",
"astype",
"(",
"int",
")",
"[",
"0",
"]",
"if",
"\"alive\"",
"in",
"seq_datum",
".",
"node_name",
":",
"alive_sequences",
".",
"append",
"(",
"sequences",
")",
"if",
"\"finished\"",
"in",
"seq_datum",
".",
"node_name",
":",
"finished_sequences",
".",
"append",
"(",
"sequences",
")",
"for",
"sequence",
"in",
"sequences",
":",
"pieces",
"=",
"self",
".",
"targets_vocab",
".",
"decode_list",
"(",
"sequence",
")",
"index",
"=",
"sequence",
"[",
"-",
"1",
"]",
"if",
"index",
"==",
"0",
":",
"continue",
"parent",
"=",
"decoding_graph",
".",
"get_vertex",
"(",
"sequence_key",
"(",
"sequence",
"[",
":",
"-",
"1",
"]",
")",
")",
"current",
"=",
"decoding_graph",
".",
"get_vertex",
"(",
"sequence_key",
"(",
"sequence",
")",
")",
"edge",
"=",
"decoding_graph",
".",
"add_edge",
"(",
"parent",
",",
"current",
")",
"edge",
".",
"data",
"[",
"\"label\"",
"]",
"=",
"pieces",
"[",
"-",
"1",
"]",
"edge",
".",
"data",
"[",
"\"label_id\"",
"]",
"=",
"index",
"# Coerce the type to be a python bool. Numpy bools can't be easily",
"# converted to JSON.",
"edge",
".",
"data",
"[",
"\"completed\"",
"]",
"=",
"bool",
"(",
"index",
"==",
"1",
")",
"# Examine the score results and store the scores with the associated edges",
"# in the graph. We fetch the vertices (and relevant edges) by looking",
"# into the saved beam sequences stored above.",
"score_datums",
"=",
"dump_dir",
".",
"find",
"(",
"predicate",
"=",
"scores_filter",
")",
"for",
"score_datum",
"in",
"score_datums",
":",
"if",
"\"alive\"",
"in",
"score_datum",
".",
"node_name",
":",
"sequences",
"=",
"alive_sequences",
".",
"popleft",
"(",
")",
"if",
"\"finished\"",
"in",
"score_datum",
".",
"node_name",
":",
"sequences",
"=",
"finished_sequences",
".",
"popleft",
"(",
")",
"scores",
"=",
"np",
".",
"array",
"(",
"score_datum",
".",
"get_tensor",
"(",
")",
")",
".",
"astype",
"(",
"float",
")",
"[",
"0",
"]",
"for",
"i",
",",
"score",
"in",
"enumerate",
"(",
"scores",
")",
":",
"sequence",
"=",
"sequences",
"[",
"i",
"]",
"if",
"sequence",
"[",
"-",
"1",
"]",
"==",
"0",
":",
"continue",
"vertex",
"=",
"decoding_graph",
".",
"get_vertex",
"(",
"sequence_key",
"(",
"sequence",
")",
")",
"edge",
"=",
"decoding_graph",
".",
"edges",
"[",
"vertex",
".",
"in_edges",
"[",
"0",
"]",
"]",
"edge",
".",
"data",
"[",
"\"score\"",
"]",
"=",
"score",
"edge",
".",
"data",
"[",
"\"log_probability\"",
"]",
"=",
"score",
"edge",
".",
"data",
"[",
"\"total_log_probability\"",
"]",
"=",
"score",
"# Delete the hook dir to save disk space",
"shutil",
".",
"rmtree",
"(",
"hook_dir",
")",
"# Create the graph visualization data structure.",
"graph_vis",
"=",
"{",
"\"visualization_name\"",
":",
"\"graph\"",
",",
"\"title\"",
":",
"\"Graph\"",
",",
"\"name\"",
":",
"\"graph\"",
",",
"\"search_graph\"",
":",
"decoding_graph",
".",
"to_dict",
"(",
")",
",",
"}",
"# Create the processing visualization data structure.",
"# TODO(kstevens): Make this method public",
"# pylint: disable=protected-access",
"output_ids",
"=",
"decoding",
".",
"_save_until_eos",
"(",
"result",
"[",
"\"outputs\"",
"]",
".",
"flatten",
"(",
")",
",",
"False",
")",
"output_pieces",
"=",
"self",
".",
"targets_vocab",
".",
"decode_list",
"(",
"output_ids",
")",
"output_token",
"=",
"[",
"{",
"\"text\"",
":",
"piece",
"}",
"for",
"piece",
"in",
"output_pieces",
"]",
"output",
"=",
"self",
".",
"targets_vocab",
".",
"decode",
"(",
"output_ids",
")",
"source_steps",
"=",
"[",
"{",
"\"step_name\"",
":",
"\"Initial\"",
",",
"\"segment\"",
":",
"[",
"{",
"\"text\"",
":",
"query",
"}",
"]",
",",
"}",
"]",
"target_steps",
"=",
"[",
"{",
"\"step_name\"",
":",
"\"Initial\"",
",",
"\"segment\"",
":",
"output_token",
",",
"}",
",",
"{",
"\"step_name\"",
":",
"\"Final\"",
",",
"\"segment\"",
":",
"[",
"{",
"\"text\"",
":",
"output",
"}",
"]",
",",
"}",
"]",
"processing_vis",
"=",
"{",
"\"visualization_name\"",
":",
"\"processing\"",
",",
"\"title\"",
":",
"\"Processing\"",
",",
"\"name\"",
":",
"\"processing\"",
",",
"\"query_processing\"",
":",
"{",
"\"source_processing\"",
":",
"source_steps",
",",
"\"target_processing\"",
":",
"target_steps",
",",
"}",
",",
"}",
"return",
"{",
"\"result\"",
":",
"[",
"processing_vis",
",",
"graph_vis",
"]",
",",
"}"
] |
Returns the visualizations for query.
Args:
query: The query to process.
Returns:
A dictionary of results with processing and graph visualizations.
|
[
"Returns",
"the",
"visualizations",
"for",
"query",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/insights/transformer_model.py#L141-L301
|
train
|
Returns the visualizations for the current query.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHO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w68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\x30' + chr(0b1001100 + 0o43) + chr(571 - 520) + '\066' + '\061', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b110010 + 0o75) + chr(49) + chr(0b110100) + '\066', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x31' + '\x34' + chr(1792 - 1741), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(683 - 572) + chr(0b101 + 0o56) + '\065' + chr(1522 - 1471), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b1010 + 0o51) + chr(0b101011 + 0o6) + chr(0b110000), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1011000 + 0o27) + chr(0b110011) + chr(0b100100 + 0o21) + chr(0b1111 + 0o41), 46476 - 46468), ehT0Px3KOsy9('\x30' + '\x6f' + chr(326 - 277) + '\065' + chr(0b1011 + 0o45), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110 + 0o55) + chr(0b11110 + 0o25) + chr(0b110110), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110101) + chr(251 - 202), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110101) + '\060', 0b1000), ehT0Px3KOsy9(chr(0b110 + 0o52) + '\x6f' + '\061' + '\x34' + chr(0b111 + 0o55), 0b1000), ehT0Px3KOsy9(chr(2195 - 2147) + chr(6109 - 5998) + chr(0b110001) + chr(0b110010) + chr(0b110010), 0b1000), ehT0Px3KOsy9('\060' + chr(7552 - 7441) + chr(50) + chr(1856 - 1805) + '\067', 24711 - 24703), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x31' + '\062', 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b11110 + 0o25) + chr(0b110111) + '\x36', 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110010) + '\067' + chr(50), 3794 - 3786), ehT0Px3KOsy9(chr(48) + chr(6476 - 6365) + chr(510 - 460) + chr(0b1000 + 0o55) + '\x30', ord("\x08")), ehT0Px3KOsy9(chr(2231 - 2183) + chr(111) + '\067' + '\062', 0b1000), ehT0Px3KOsy9(chr(0b11 + 0o55) + chr(111) + chr(0b110001) + chr(504 - 452) + chr(50), 37043 - 37035), ehT0Px3KOsy9('\060' + chr(0b1010001 + 0o36) + chr(2376 - 2327) + '\061' + chr(52), 0o10), ehT0Px3KOsy9(chr(0b1001 + 0o47) + chr(2115 - 2004) + '\066' + '\x32', 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(50) + chr(0b110100) + '\x33', 0b1000), ehT0Px3KOsy9('\060' + chr(111) + '\061' + '\066', 0o10), ehT0Px3KOsy9('\060' + chr(4566 - 4455) + '\x31' + '\x34', 48796 - 48788), ehT0Px3KOsy9(chr(677 - 629) + chr(0b1101100 + 0o3) + chr(1908 - 1857) + chr(49) + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(1075 - 964) + chr(0b110001) + chr(0b11001 + 0o31) + chr(48), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + '\063' + chr(0b11010 + 0o35) + '\x34', 199 - 191), ehT0Px3KOsy9(chr(0b110000) + chr(0b100111 + 0o110) + chr(0b10010 + 0o40) + chr(1485 - 1432) + '\065', 0o10), ehT0Px3KOsy9('\x30' + '\157' + '\x33' + chr(176 - 126) + '\x35', 0b1000), ehT0Px3KOsy9(chr(0b101101 + 0o3) + chr(111) + chr(55) + '\x30', 24810 - 24802), ehT0Px3KOsy9(chr(1167 - 1119) + chr(9626 - 9515) + '\063' + '\x35' + '\061', ord("\x08")), ehT0Px3KOsy9(chr(0b11110 + 0o22) + chr(0b1101111) + chr(0b110011) + chr(1757 - 1706) + chr(50), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(49) + chr(54) + '\x32', 0o10), ehT0Px3KOsy9(chr(0b1111 + 0o41) + chr(0b1010000 + 0o37) + '\061' + chr(0b110000) + '\x36', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(8156 - 8045) + '\061' + chr(0b1011 + 0o47) + chr(0b111 + 0o54), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110011) + '\x30' + chr(0b110000), 37638 - 37630), ehT0Px3KOsy9(chr(1018 - 970) + '\x6f' + chr(0b10010 + 0o40) + chr(54) + '\067', 0o10), ehT0Px3KOsy9(chr(0b101000 + 0o10) + chr(7951 - 7840) + chr(51) + chr(0b11000 + 0o36) + '\x36', 0b1000), ehT0Px3KOsy9(chr(0b10 + 0o56) + chr(3139 - 3028) + chr(1988 - 1938) + chr(48) + '\x31', 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b101011 + 0o11) + chr(2195 - 2143), 54730 - 54722)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + chr(0b1010100 + 0o33) + chr(53) + '\x30', 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xdf'), '\x64' + chr(9610 - 9509) + '\x63' + chr(0b111100 + 0o63) + chr(0b110000 + 0o64) + chr(0b1100101))('\x75' + chr(0b1110100) + chr(0b1100110) + chr(1623 - 1578) + chr(1108 - 1052)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def ZaphbO0J_dPn(oVre8I6UXc3b, MgmdEYXEleNe):
xafqLlk3kkUe(IDJ2eXGCBCDu.logging, xafqLlk3kkUe(SXOLrMavuUCe(b'\xa2Q+\x93\xbd\x8b\x0f\xe9CD>9'), '\x64' + chr(101) + chr(0b1011001 + 0o12) + chr(0b11000 + 0o127) + chr(0b10110 + 0o116) + chr(0b100011 + 0o102))('\x75' + '\164' + chr(0b1100110) + chr(1526 - 1481) + chr(0b111000)))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xa1\x14\x0c\x88\xad\x9b\x1b\xb7GOD<\xfa}\xde\xcb\xdd_\x105\x12\xf8+\x7f\x90'), chr(0b1100100) + chr(101) + chr(0b1100011) + '\x6f' + chr(982 - 882) + chr(101))(chr(0b100101 + 0o120) + '\164' + chr(0b111100 + 0o52) + chr(0b101101) + chr(0b101100 + 0o14)) % MgmdEYXEleNe)
k4Zm3Zgd6Y0D = xafqLlk3kkUe(SXOLrMavuUCe(b'\xde\x12\x0e\x9b\xe7\x9cZ\xaav[\x01 \xe9o\x8c\xe5\xccO\x0f<\x1d\xd1k}\xb85\x8f\xd9\x8a\x1d\x8d'), '\x64' + '\145' + chr(99) + chr(0b1101111) + '\x64' + '\x65')(chr(0b1110101) + chr(0b1110100) + '\146' + chr(105 - 60) + '\x38') % ehT0Px3KOsy9(ltvhPP4VhXre.time())
xafqLlk3kkUe(oqhJDdMJfuwx, xafqLlk3kkUe(SXOLrMavuUCe(b'\x9c\x07\x08\x8e\xac\x81\x1a\xad'), '\x64' + chr(0b1100101) + chr(2388 - 2289) + '\x6f' + chr(0b1100100) + chr(0b1100101))(chr(0b1110101) + chr(0b1110100) + chr(102) + chr(0b101101) + chr(2239 - 2183)))(k4Zm3Zgd6Y0D)
rxW1_nsw8u9L = [bGb61p33zkki.DumpingDebugHook(k4Zm3Zgd6Y0D, watch_fn=Tx8JzhyJLB18)]
def muu2PuGBceZi():
for VNGQdHSFPrso in vQr8gNKaIaWE(ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b1111 + 0o42), 0b1000)):
CyiZkgWrlgA9 = oVre8I6UXc3b.source_vocab.encode(MgmdEYXEleNe)
xafqLlk3kkUe(CyiZkgWrlgA9, xafqLlk3kkUe(SXOLrMavuUCe(b'\x90\x16\x13\x8e\xa6\x8c'), '\x64' + '\x65' + '\143' + '\157' + chr(0b11010 + 0o112) + chr(0b1001100 + 0o31))('\x75' + '\x74' + '\146' + '\x2d' + '\070'))(xafqLlk3kkUe(nCRDzZ_Is9fz, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb4)0\xb4\x81\xac'), chr(100) + '\145' + '\x63' + chr(111) + chr(0b1100100) + chr(0b1100101))('\165' + chr(4750 - 4634) + '\x66' + '\055' + chr(0b111000))))
OeWW0F1dBPRQ = [ehT0Px3KOsy9(chr(0b110000) + '\157' + '\061', 8), ehT0Px3KOsy9('\x30' + chr(0b111110 + 0o61) + '\061' + chr(0b10011 + 0o41) + chr(52), 8), c2A0yzQpDQB3(CyiZkgWrlgA9)] + CyiZkgWrlgA9
OeWW0F1dBPRQ += [ehT0Px3KOsy9('\x30' + chr(0b110001 + 0o76) + chr(0b110000), 0b1000)] * (oVre8I6UXc3b.const_array_size - c2A0yzQpDQB3(OeWW0F1dBPRQ))
pd3lxn9vqWxp = {xafqLlk3kkUe(SXOLrMavuUCe(b'\x98\x08\x13\x9e\xbc\x9b'), '\x64' + '\x65' + chr(0b1100011) + chr(149 - 38) + chr(0b1001 + 0o133) + chr(0b1100101))(chr(0b111100 + 0o71) + chr(116) + '\146' + '\055' + chr(56)): WqUC3KWvYVup.array(OeWW0F1dBPRQ).astype(WqUC3KWvYVup.int32)}
yield pd3lxn9vqWxp
def MVwQV4Upte2X():
R6_MYqV8djOL = jyVHS0IYLm_8.make_input_fn_from_generator(muu2PuGBceZi())
kP4qaKv0ZkGv = R6_MYqV8djOL()
return xafqLlk3kkUe(jyVHS0IYLm_8, xafqLlk3kkUe(SXOLrMavuUCe(b'\xae\x0f\r\x9f\xad\x9a\t\xbd]A\x127\xc0c\x90\xca\xddN=8W\xcd}c\xbf\x0f\x88\xc2\x8a^\x8c\xbb\x063!\xa5\xc4\xa9\xe5M\x92\x12'), chr(0b1001000 + 0o34) + chr(101) + chr(0b100000 + 0o103) + chr(0b11100 + 0o123) + chr(100) + chr(101))(chr(677 - 560) + chr(0b1001000 + 0o54) + '\x66' + chr(0b101101) + chr(56)))(kP4qaKv0ZkGv, xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x9fR\x0f\x81\xbd\x89Z\xb9@\x194 '), chr(3288 - 3188) + '\x65' + '\143' + chr(111) + '\144' + '\x65')(chr(117) + chr(0b1110100) + '\x66' + '\x2d' + chr(0b1001 + 0o57))))
VRSPKYG7TaoE = oVre8I6UXc3b.estimator.POyImYQwg5VB(MVwQV4Upte2X, hooks=rxW1_nsw8u9L)
ShZmEKfTkAOZ = None
for ShZmEKfTkAOZ in VRSPKYG7TaoE:
break
MDFW2xEFHo2o = H9yw8tZKkKME.Graph()
YeaDBUunqjhh = vUlqIvNSaRMa(jt2o3b6QEdP_.glob(oqhJDdMJfuwx.path.join(k4Zm3Zgd6Y0D, xafqLlk3kkUe(SXOLrMavuUCe(b'\x83\x13\r\xb4\xe2'), chr(0b1100100) + '\145' + chr(99) + chr(0b1101111) + chr(0b1100100) + '\145')(chr(117) + chr(0b1110000 + 0o4) + chr(9955 - 9853) + chr(0b101101) + chr(56)))))
for uOfzMGyEY7NM in YeaDBUunqjhh:
KHi0hagPlkAG = FfAR6H7udAds()
vTaXW1XKM8_m = FfAR6H7udAds()
xafqLlk3kkUe(MDFW2xEFHo2o, xafqLlk3kkUe(SXOLrMavuUCe(b'\x96\x03\x17\xb4\xbe\x8d\x1a\xaaLP'), chr(0b1100100) + '\145' + chr(0b100110 + 0o75) + chr(0b1101111) + chr(0b100000 + 0o104) + chr(936 - 835))(chr(5278 - 5161) + '\x74' + '\x66' + '\055' + '\070'))(QfS2PVPc1XkH([ehT0Px3KOsy9('\060' + chr(0b11110 + 0o121) + '\x30', 8)]))
LbQFKrKaKJze = bGb61p33zkki.DebugDumpDir(uOfzMGyEY7NM, validate=ehT0Px3KOsy9(chr(0b101011 + 0o5) + chr(0b1101111) + chr(2051 - 2003), 8))
ydPRoFpTCDPU = LbQFKrKaKJze.find(predicate=KGEwURBJQ9CT)
for wuhAHR8emu3M in ydPRoFpTCDPU:
wsAG9QSgV2xG = WqUC3KWvYVup.array(wuhAHR8emu3M.get_tensor()).astype(ehT0Px3KOsy9)[ehT0Px3KOsy9(chr(1883 - 1835) + chr(0b1101111) + chr(2090 - 2042), 8)]
if xafqLlk3kkUe(SXOLrMavuUCe(b'\x90\n\n\x9d\xad'), chr(100) + chr(0b11011 + 0o112) + chr(742 - 643) + '\x6f' + chr(0b100000 + 0o104) + chr(101))(chr(9688 - 9571) + chr(10427 - 10311) + chr(102) + chr(0b11111 + 0o16) + '\070') in xafqLlk3kkUe(wuhAHR8emu3M, xafqLlk3kkUe(SXOLrMavuUCe(b'\x9f\t\x07\x8e\x97\x86\t\xb3L'), chr(0b10000 + 0o124) + '\x65' + chr(99) + '\x6f' + chr(2842 - 2742) + chr(0b11011 + 0o112))(chr(117) + '\164' + chr(1907 - 1805) + '\x2d' + chr(2183 - 2127))):
xafqLlk3kkUe(KHi0hagPlkAG, xafqLlk3kkUe(SXOLrMavuUCe(b'\x90\x16\x13\x8e\xa6\x8c'), '\144' + chr(0b10000 + 0o125) + chr(3757 - 3658) + '\x6f' + '\144' + chr(101))(chr(0b11001 + 0o134) + chr(0b110 + 0o156) + '\146' + chr(1801 - 1756) + chr(56)))(wsAG9QSgV2xG)
if xafqLlk3kkUe(SXOLrMavuUCe(b'\x97\x0f\r\x82\xbb\x80\r\xba'), chr(100) + '\x65' + chr(1365 - 1266) + chr(3863 - 3752) + chr(100) + chr(0b1100101))('\165' + '\164' + chr(3163 - 3061) + chr(0b101101) + chr(56)) in xafqLlk3kkUe(wuhAHR8emu3M, xafqLlk3kkUe(SXOLrMavuUCe(b'\x9f\t\x07\x8e\x97\x86\t\xb3L'), '\144' + chr(1823 - 1722) + chr(0b10101 + 0o116) + '\157' + '\144' + chr(0b1001001 + 0o34))(chr(0b101100 + 0o111) + '\x74' + '\146' + '\x2d' + chr(0b111000))):
xafqLlk3kkUe(vTaXW1XKM8_m, xafqLlk3kkUe(SXOLrMavuUCe(b'\x90\x16\x13\x8e\xa6\x8c'), '\x64' + chr(9541 - 9440) + '\143' + '\x6f' + '\144' + '\145')('\165' + chr(7164 - 7048) + '\146' + chr(0b10110 + 0o27) + chr(56)))(wsAG9QSgV2xG)
for blgtMYjOOQgD in wsAG9QSgV2xG:
X3b3u1PDVdmt = oVre8I6UXc3b.targets_vocab.decode_list(blgtMYjOOQgD)
XdowRbJKZWL9 = blgtMYjOOQgD[-ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\061', 8)]
if XdowRbJKZWL9 == ehT0Px3KOsy9(chr(48) + '\157' + chr(48), 8):
continue
KojYgxZ3VIQZ = MDFW2xEFHo2o.get_vertex(QfS2PVPc1XkH(blgtMYjOOQgD[:-ehT0Px3KOsy9(chr(0b100110 + 0o12) + chr(0b11111 + 0o120) + chr(0b110001), 8)]))
xs6XOz6fvaCq = MDFW2xEFHo2o.get_vertex(QfS2PVPc1XkH(blgtMYjOOQgD))
HyOf7FQDoph3 = MDFW2xEFHo2o.add_edge(KojYgxZ3VIQZ, xs6XOz6fvaCq)
HyOf7FQDoph3.ULnjp6D6efFH[xafqLlk3kkUe(SXOLrMavuUCe(b'\x9d\x07\x01\x8e\xa4'), chr(0b1100100) + '\x65' + chr(2575 - 2476) + chr(0b1101111) + chr(0b101010 + 0o72) + chr(0b110000 + 0o65))('\x75' + chr(116) + '\146' + '\055' + chr(0b111000))] = X3b3u1PDVdmt[-ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110001), 8)]
HyOf7FQDoph3.ULnjp6D6efFH[xafqLlk3kkUe(SXOLrMavuUCe(b'\x9d\x07\x01\x8e\xa4\xb7\x01\xba'), chr(0b1000110 + 0o36) + '\x65' + '\143' + chr(111) + chr(0b111101 + 0o47) + chr(0b1100101))('\165' + chr(116) + chr(9548 - 9446) + chr(0b10111 + 0o26) + '\x38')] = XdowRbJKZWL9
HyOf7FQDoph3.ULnjp6D6efFH[xafqLlk3kkUe(SXOLrMavuUCe(b'\x92\t\x0e\x9b\xa4\x8d\x1c\xbbM'), chr(0b1100100) + '\145' + chr(602 - 503) + chr(0b1011010 + 0o25) + chr(831 - 731) + chr(0b1100101))(chr(0b101010 + 0o113) + chr(116) + chr(102) + chr(1857 - 1812) + chr(0b1100 + 0o54))] = WbBjf8Y7v9VN(XdowRbJKZWL9 == ehT0Px3KOsy9(chr(48) + chr(527 - 416) + chr(0b0 + 0o61), 8))
FybreSNC2GkB = LbQFKrKaKJze.find(predicate=f_jvISbM7cPD)
for pRexqh6yoYZp in FybreSNC2GkB:
if xafqLlk3kkUe(SXOLrMavuUCe(b'\x90\n\n\x9d\xad'), chr(0b1100100) + chr(101) + chr(2769 - 2670) + chr(0b1100100 + 0o13) + chr(0b1100100) + '\145')('\x75' + '\x74' + '\146' + chr(0b101101) + chr(588 - 532)) in xafqLlk3kkUe(pRexqh6yoYZp, xafqLlk3kkUe(SXOLrMavuUCe(b'\x9f\t\x07\x8e\x97\x86\t\xb3L'), chr(0b1100100) + '\x65' + '\143' + chr(0b1101111) + '\144' + '\145')(chr(0b1110101) + chr(7543 - 7427) + '\146' + chr(0b10100 + 0o31) + chr(348 - 292))):
wsAG9QSgV2xG = KHi0hagPlkAG.popleft()
if xafqLlk3kkUe(SXOLrMavuUCe(b'\x97\x0f\r\x82\xbb\x80\r\xba'), chr(100) + chr(0b1100101) + chr(3261 - 3162) + chr(111) + chr(4831 - 4731) + '\x65')(chr(0b1100000 + 0o25) + chr(0b1011011 + 0o31) + chr(0b1100110 + 0o0) + chr(288 - 243) + '\070') in xafqLlk3kkUe(pRexqh6yoYZp, xafqLlk3kkUe(SXOLrMavuUCe(b'\x9f\t\x07\x8e\x97\x86\t\xb3L'), chr(0b1100100) + '\x65' + chr(7821 - 7722) + chr(9862 - 9751) + chr(0b1100100) + chr(101))(chr(117) + chr(116) + chr(102) + chr(45) + chr(0b111000))):
wsAG9QSgV2xG = vTaXW1XKM8_m.popleft()
b8rpGniBNUPr = WqUC3KWvYVup.array(pRexqh6yoYZp.get_tensor()).astype(kkSX4ccExqw4)[ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(684 - 636), 8)]
for (WVxHKyX45z_L, n9fd4FsgoqFs) in YlkZvXL8qwsX(b8rpGniBNUPr):
blgtMYjOOQgD = wsAG9QSgV2xG[WVxHKyX45z_L]
if blgtMYjOOQgD[-ehT0Px3KOsy9(chr(48) + chr(111) + '\061', 8)] == ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110000), 8):
continue
CNW4RmckVAZZ = MDFW2xEFHo2o.get_vertex(QfS2PVPc1XkH(blgtMYjOOQgD))
HyOf7FQDoph3 = MDFW2xEFHo2o.edges[CNW4RmckVAZZ.in_edges[ehT0Px3KOsy9(chr(0b1101 + 0o43) + '\157' + '\060', 8)]]
HyOf7FQDoph3.ULnjp6D6efFH[xafqLlk3kkUe(SXOLrMavuUCe(b'\x82\x05\x0c\x99\xad'), chr(100) + chr(5778 - 5677) + chr(0b1100011) + chr(0b1101 + 0o142) + chr(0b1100100) + '\x65')('\165' + chr(0b1110100) + chr(0b1100110) + chr(0b101101) + '\070')] = n9fd4FsgoqFs
HyOf7FQDoph3.ULnjp6D6efFH[xafqLlk3kkUe(SXOLrMavuUCe(b'\x9d\t\x04\xb4\xb8\x9a\x07\xbcHJ\r>\xf6~\x87'), '\144' + '\x65' + chr(0b110100 + 0o57) + '\157' + chr(100) + '\145')(chr(0b1110101) + chr(0b1110100) + '\x66' + '\x2d' + chr(56))] = n9fd4FsgoqFs
HyOf7FQDoph3.ULnjp6D6efFH[xafqLlk3kkUe(SXOLrMavuUCe(b'\x85\t\x17\x8a\xa4\xb7\x04\xb1Nw\x14 \xf0h\x9f\xd8\xc1V\x0b8K'), '\x64' + chr(0b1100101) + chr(99) + '\x6f' + '\144' + '\145')('\165' + '\164' + '\146' + '\055' + '\x38')] = n9fd4FsgoqFs
xafqLlk3kkUe(DSLq_IS6e6IX, xafqLlk3kkUe(SXOLrMavuUCe(b'\x83\x0b\x17\x99\xad\x8d'), '\144' + chr(8981 - 8880) + '\143' + chr(7939 - 7828) + '\144' + chr(101))(chr(3773 - 3656) + chr(116) + chr(0b1100110) + chr(0b11000 + 0o25) + chr(1520 - 1464)))(k4Zm3Zgd6Y0D)
XCJ5PvZk7vy3 = {xafqLlk3kkUe(SXOLrMavuUCe(b'\x87\x0f\x10\x9e\xa9\x84\x01\xa4H\\\r=\xf1U\x90\xdb\xc5_'), chr(0b1100100) + chr(0b1100101) + chr(99) + chr(0b1101111) + chr(100) + chr(0b1000101 + 0o40))(chr(117) + chr(116) + '\146' + chr(0b101 + 0o50) + chr(0b1100 + 0o54)): xafqLlk3kkUe(SXOLrMavuUCe(b'\x96\x14\x02\x9b\xa0'), chr(0b111000 + 0o54) + '\x65' + chr(0b100101 + 0o76) + chr(0b1011011 + 0o24) + chr(0b100011 + 0o101) + '\145')(chr(0b1110101) + chr(0b111001 + 0o73) + '\146' + chr(0b100111 + 0o6) + '\x38'), xafqLlk3kkUe(SXOLrMavuUCe(b'\x85\x0f\x17\x87\xad'), chr(0b1100100) + '\145' + chr(7659 - 7560) + chr(0b1101111) + chr(0b1100100) + '\x65')('\165' + '\164' + chr(0b1011 + 0o133) + '\055' + chr(802 - 746)): xafqLlk3kkUe(SXOLrMavuUCe(b'\xb6\x14\x02\x9b\xa0'), '\144' + '\x65' + chr(0b1100011) + '\x6f' + chr(2089 - 1989) + '\145')(chr(504 - 387) + chr(0b1 + 0o163) + chr(102) + '\055' + '\x38'), xafqLlk3kkUe(SXOLrMavuUCe(b'\x9f\x07\x0e\x8e'), chr(0b1100100) + chr(101) + '\143' + chr(111) + chr(100) + chr(4414 - 4313))(chr(0b1001111 + 0o46) + '\x74' + '\x66' + chr(0b101101) + chr(420 - 364)): xafqLlk3kkUe(SXOLrMavuUCe(b'\x96\x14\x02\x9b\xa0'), chr(3261 - 3161) + chr(0b10111 + 0o116) + '\x63' + chr(5787 - 5676) + chr(100) + chr(0b1001 + 0o134))(chr(0b11111 + 0o126) + '\x74' + chr(0b1100110) + chr(0b101000 + 0o5) + chr(56)), xafqLlk3kkUe(SXOLrMavuUCe(b'\x82\x03\x02\x99\xab\x807\xb9[I\x14:'), chr(0b110000 + 0o64) + '\x65' + chr(6582 - 6483) + chr(0b110111 + 0o70) + '\144' + '\145')('\x75' + chr(174 - 58) + chr(0b1101 + 0o131) + chr(0b1000 + 0o45) + '\x38'): MDFW2xEFHo2o.to_dict()}
uFR3Tktx7IP_ = jyVHS0IYLm_8._save_until_eos(ShZmEKfTkAOZ[xafqLlk3kkUe(SXOLrMavuUCe(b'\x9e\x13\x17\x9b\xbd\x9c\x1b'), chr(0b1100100) + chr(4042 - 3941) + chr(0b1100011) + chr(699 - 588) + chr(4614 - 4514) + '\145')(chr(2921 - 2804) + '\164' + chr(0b1001001 + 0o35) + chr(45) + chr(0b100001 + 0o27))].flatten(), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\060', 8))
ky5hnGEwrFei = oVre8I6UXc3b.targets_vocab.decode_list(uFR3Tktx7IP_)
ukDrmu6Rq8Ai = [{xafqLlk3kkUe(SXOLrMavuUCe(b'\x85\x03\x1b\x9f'), '\144' + chr(101) + chr(3628 - 3529) + '\x6f' + chr(100) + '\145')(chr(3308 - 3191) + chr(0b1011011 + 0o31) + chr(0b1100000 + 0o6) + chr(0b11001 + 0o24) + chr(1862 - 1806)): N0fpDLYvEEVW} for N0fpDLYvEEVW in ky5hnGEwrFei]
e1jVqMSBZ01Y = oVre8I6UXc3b.targets_vocab.decode(uFR3Tktx7IP_)
UulyQkVoN8wG = [{xafqLlk3kkUe(SXOLrMavuUCe(b'\x82\x12\x06\x9b\x97\x86\t\xb3L'), '\144' + chr(0b1011 + 0o132) + chr(0b11011 + 0o110) + chr(9631 - 9520) + '\x64' + '\x65')('\165' + chr(0b1110100) + chr(102) + '\x2d' + '\070'): xafqLlk3kkUe(SXOLrMavuUCe(b'\xb8\x08\n\x9f\xa1\x89\x04'), chr(0b1100100) + '\145' + chr(0b11101 + 0o106) + chr(0b1101111) + '\144' + chr(0b1011011 + 0o12))('\x75' + chr(0b1110100) + '\146' + chr(1487 - 1442) + chr(56)), xafqLlk3kkUe(SXOLrMavuUCe(b'\x82\x03\x04\x86\xad\x86\x1c'), '\144' + '\145' + chr(0b1100011) + '\x6f' + '\144' + '\x65')('\165' + chr(0b1110100) + '\x66' + '\055' + chr(56)): [{xafqLlk3kkUe(SXOLrMavuUCe(b'\x85\x03\x1b\x9f'), chr(1026 - 926) + chr(0b10101 + 0o120) + chr(1752 - 1653) + '\157' + chr(0b1100100) + '\x65')('\x75' + chr(0b1110100) + chr(0b1100110) + chr(45) + chr(56)): MgmdEYXEleNe}]}]
VaVdxwYFMhS4 = [{xafqLlk3kkUe(SXOLrMavuUCe(b'\x82\x12\x06\x9b\x97\x86\t\xb3L'), chr(0b1100100) + chr(101) + chr(99) + chr(0b11110 + 0o121) + chr(0b1100100) + chr(0b1100101))(chr(0b1000010 + 0o63) + chr(0b1110100) + '\146' + '\x2d' + chr(2695 - 2639)): xafqLlk3kkUe(SXOLrMavuUCe(b'\xb8\x08\n\x9f\xa1\x89\x04'), chr(100) + chr(4422 - 4321) + '\x63' + chr(2314 - 2203) + chr(5560 - 5460) + chr(9185 - 9084))('\165' + chr(0b1110100) + '\146' + chr(0b101101) + chr(56)), xafqLlk3kkUe(SXOLrMavuUCe(b'\x82\x03\x04\x86\xad\x86\x1c'), chr(100) + chr(0b11010 + 0o113) + chr(7317 - 7218) + chr(0b10110 + 0o131) + chr(100) + '\145')(chr(117) + chr(482 - 366) + '\x66' + '\x2d' + chr(0b111000)): ukDrmu6Rq8Ai}, {xafqLlk3kkUe(SXOLrMavuUCe(b'\x82\x12\x06\x9b\x97\x86\t\xb3L'), '\144' + '\x65' + chr(0b1100011) + chr(6803 - 6692) + chr(4412 - 4312) + '\145')('\165' + chr(12242 - 12126) + chr(0b101110 + 0o70) + chr(45) + '\x38'): xafqLlk3kkUe(SXOLrMavuUCe(b'\xb7\x0f\r\x8a\xa4'), chr(0b1100100) + chr(101) + '\x63' + '\x6f' + chr(0b1011 + 0o131) + '\x65')(chr(0b1110101) + '\164' + '\146' + chr(45) + chr(0b111000)), xafqLlk3kkUe(SXOLrMavuUCe(b'\x82\x03\x04\x86\xad\x86\x1c'), '\144' + chr(1747 - 1646) + '\143' + '\157' + '\144' + chr(6218 - 6117))(chr(0b1110101) + chr(2815 - 2699) + chr(102) + chr(45) + '\070'): [{xafqLlk3kkUe(SXOLrMavuUCe(b'\x85\x03\x1b\x9f'), chr(0b1100100) + chr(101) + chr(6166 - 6067) + chr(0b1101111) + chr(100) + chr(6797 - 6696))('\165' + chr(3836 - 3720) + chr(0b110100 + 0o62) + '\x2d' + chr(56)): e1jVqMSBZ01Y}]}]
nFqmKRHYWs5S = {xafqLlk3kkUe(SXOLrMavuUCe(b'\x87\x0f\x10\x9e\xa9\x84\x01\xa4H\\\r=\xf1U\x90\xdb\xc5_'), '\x64' + '\145' + chr(0b1100011) + chr(111) + chr(0b1011011 + 0o11) + chr(101))(chr(10775 - 10658) + chr(116) + chr(0b1100110) + '\x2d' + chr(0b111000)): xafqLlk3kkUe(SXOLrMavuUCe(b'\x81\x14\x0c\x88\xad\x9b\x1b\xb7GO'), chr(0b1001011 + 0o31) + chr(101) + chr(0b1100011) + chr(0b1101111) + '\x64' + chr(0b101000 + 0o75))(chr(7760 - 7643) + '\164' + chr(0b10111 + 0o117) + '\055' + chr(56)), xafqLlk3kkUe(SXOLrMavuUCe(b'\x85\x0f\x17\x87\xad'), '\x64' + chr(0b1010010 + 0o23) + chr(0b10110 + 0o115) + '\157' + '\144' + '\x65')(chr(117) + chr(4847 - 4731) + chr(8194 - 8092) + chr(0b100110 + 0o7) + chr(56)): xafqLlk3kkUe(SXOLrMavuUCe(b'\xa1\x14\x0c\x88\xad\x9b\x1b\xb7GO'), chr(0b1100100) + '\x65' + chr(0b1010100 + 0o17) + chr(10441 - 10330) + chr(100) + chr(8541 - 8440))(chr(0b1110101) + chr(1802 - 1686) + chr(0b100110 + 0o100) + chr(45) + chr(0b111000)), xafqLlk3kkUe(SXOLrMavuUCe(b'\x9f\x07\x0e\x8e'), chr(100) + chr(7258 - 7157) + chr(0b100001 + 0o102) + chr(3612 - 3501) + chr(100) + chr(10028 - 9927))(chr(0b1000101 + 0o60) + '\164' + chr(0b1100110) + chr(45) + chr(807 - 751)): xafqLlk3kkUe(SXOLrMavuUCe(b'\x81\x14\x0c\x88\xad\x9b\x1b\xb7GO'), '\144' + chr(0b1100101) + '\x63' + chr(0b1100011 + 0o14) + chr(100) + chr(101))(chr(0b1100001 + 0o24) + chr(0b1000110 + 0o56) + chr(102) + chr(45) + chr(0b111000)), xafqLlk3kkUe(SXOLrMavuUCe(b'\x80\x13\x06\x99\xb1\xb7\x18\xacFK\x01!\xecc\x90\xdd'), '\144' + '\145' + chr(99) + '\157' + chr(0b1100100) + chr(101))(chr(117) + chr(116) + chr(102) + chr(45) + chr(56)): {xafqLlk3kkUe(SXOLrMavuUCe(b'\x82\t\x16\x99\xab\x8d7\xae[G\x077\xecy\x97\xd4\xcf'), chr(100) + chr(0b1010010 + 0o23) + chr(99) + '\x6f' + '\144' + '\145')(chr(3460 - 3343) + chr(7751 - 7635) + chr(5318 - 5216) + chr(0b101 + 0o50) + chr(2708 - 2652)): UulyQkVoN8wG, xafqLlk3kkUe(SXOLrMavuUCe(b'\x85\x07\x11\x8c\xad\x9c7\xae[G\x077\xecy\x97\xd4\xcf'), chr(8082 - 7982) + '\x65' + chr(0b100 + 0o137) + '\x6f' + '\144' + chr(0b1100101))(chr(8200 - 8083) + '\x74' + chr(102) + chr(45) + '\070'): VaVdxwYFMhS4}}
return {xafqLlk3kkUe(SXOLrMavuUCe(b'\x83\x03\x10\x9e\xa4\x9c'), chr(0b111 + 0o135) + chr(9674 - 9573) + chr(0b1000011 + 0o40) + chr(716 - 605) + chr(0b1100100) + chr(101))(chr(0b101010 + 0o113) + chr(4305 - 4189) + '\146' + chr(0b11011 + 0o22) + chr(56)): [nFqmKRHYWs5S, XCJ5PvZk7vy3]}
|
tensorflow/tensor2tensor
|
tensor2tensor/trax/trainer.py
|
_default_output_dir
|
def _default_output_dir():
"""Default output directory."""
try:
dataset_name = gin.query_parameter("inputs.dataset_name")
except ValueError:
dataset_name = "random"
dir_name = "{model_name}_{dataset_name}_{timestamp}".format(
model_name=gin.query_parameter("train.model").configurable.name,
dataset_name=dataset_name,
timestamp=datetime.datetime.now().strftime("%Y%m%d_%H%M"),
)
dir_path = os.path.join("~", "trax", dir_name)
print()
trax.log("No --output_dir specified")
return dir_path
|
python
|
def _default_output_dir():
"""Default output directory."""
try:
dataset_name = gin.query_parameter("inputs.dataset_name")
except ValueError:
dataset_name = "random"
dir_name = "{model_name}_{dataset_name}_{timestamp}".format(
model_name=gin.query_parameter("train.model").configurable.name,
dataset_name=dataset_name,
timestamp=datetime.datetime.now().strftime("%Y%m%d_%H%M"),
)
dir_path = os.path.join("~", "trax", dir_name)
print()
trax.log("No --output_dir specified")
return dir_path
|
[
"def",
"_default_output_dir",
"(",
")",
":",
"try",
":",
"dataset_name",
"=",
"gin",
".",
"query_parameter",
"(",
"\"inputs.dataset_name\"",
")",
"except",
"ValueError",
":",
"dataset_name",
"=",
"\"random\"",
"dir_name",
"=",
"\"{model_name}_{dataset_name}_{timestamp}\"",
".",
"format",
"(",
"model_name",
"=",
"gin",
".",
"query_parameter",
"(",
"\"train.model\"",
")",
".",
"configurable",
".",
"name",
",",
"dataset_name",
"=",
"dataset_name",
",",
"timestamp",
"=",
"datetime",
".",
"datetime",
".",
"now",
"(",
")",
".",
"strftime",
"(",
"\"%Y%m%d_%H%M\"",
")",
",",
")",
"dir_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"\"~\"",
",",
"\"trax\"",
",",
"dir_name",
")",
"print",
"(",
")",
"trax",
".",
"log",
"(",
"\"No --output_dir specified\"",
")",
"return",
"dir_path"
] |
Default output directory.
|
[
"Default",
"output",
"directory",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/trax/trainer.py#L48-L62
|
train
|
Default output directory.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM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ebP,QC9iu2kLpS8s,QOfmzcVJsrp8,tzcpInYwBvYW,iDQ_gSK8V7h0,Rurm1zTRfSmY,reqGiMiVQ77y,bsS9P6_LpdIe,sbGAZlkZOtyh,Cf_Qef15s3_F,eX02hlZjMfR0,wLqBDw8l0eIm,g1Uy6IV0tyJQ,f9CsFWzvg0Vq,YlkZvXL8qwsX,MCqssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\x30' + chr(0b100111 + 0o110) + chr(54) + '\064', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110001) + chr(0b10000 + 0o47) + '\060', 0b1000), ehT0Px3KOsy9(chr(2275 - 2227) + chr(5023 - 4912) + chr(0b110111) + chr(1468 - 1415), ord("\x08")), ehT0Px3KOsy9(chr(0b101000 + 0o10) + chr(0b1011 + 0o144) + chr(1435 - 1386) + chr(0b110101) + '\067', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b100001 + 0o21) + chr(0b1 + 0o60) + '\x35', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1011010 + 0o25) + chr(0b110101) + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(996 - 948) + chr(10883 - 10772) + '\x31' + chr(0b101110 + 0o5) + chr(0b10100 + 0o41), 41034 - 41026), ehT0Px3KOsy9('\060' + '\x6f' + '\x33' + chr(0b110101) + chr(0b110001), 0o10), ehT0Px3KOsy9(chr(0b100000 + 0o20) + '\x6f' + chr(0b110010) + chr(53) + chr(0b110000), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b100111 + 0o110) + '\x36' + '\060', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110010) + chr(48) + chr(0b110011), 0o10), ehT0Px3KOsy9(chr(1338 - 1290) + chr(10124 - 10013) + chr(0b110001) + '\065' + chr(48), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b101011 + 0o104) + chr(0b110011) + '\065' + '\062', 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + '\x32' + chr(53) + '\063', 0b1000), ehT0Px3KOsy9(chr(0b101010 + 0o6) + '\157' + chr(281 - 226) + '\x37', 0o10), ehT0Px3KOsy9(chr(0b111 + 0o51) + '\157' + chr(0b110010) + '\x30', 0b1000), ehT0Px3KOsy9('\x30' + chr(11350 - 11239) + chr(49) + chr(0b110010) + '\x36', 14061 - 14053), ehT0Px3KOsy9(chr(907 - 859) + chr(0b1101111 + 0o0) + chr(51) + '\x30' + '\x37', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(51) + '\062' + '\x36', 38648 - 38640), ehT0Px3KOsy9('\060' + chr(3919 - 3808) + chr(0b101 + 0o56) + '\066' + '\x30', 0o10), ehT0Px3KOsy9(chr(0b1111 + 0o41) + chr(0b111001 + 0o66) + '\061' + chr(682 - 627) + '\x30', 8), ehT0Px3KOsy9(chr(948 - 900) + chr(0b10010 + 0o135) + chr(51) + '\065' + chr(0b110001), 8), ehT0Px3KOsy9(chr(0b110000) + chr(7148 - 7037) + '\x32' + chr(0b110110) + '\x37', 0o10), ehT0Px3KOsy9(chr(1278 - 1230) + chr(0b1100010 + 0o15) + chr(0b10100 + 0o40), 50575 - 50567), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110011) + chr(0b10000 + 0o45) + '\x33', 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + '\x31' + chr(0b10110 + 0o40) + chr(1232 - 1180), 0b1000), ehT0Px3KOsy9(chr(1858 - 1810) + chr(0b1001110 + 0o41) + '\x33' + chr(48) + '\066', 25350 - 25342), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110110) + '\066', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b101110 + 0o3), 269 - 261), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\062' + chr(0b110100 + 0o3), 0o10), ehT0Px3KOsy9(chr(0b101001 + 0o7) + chr(0b1 + 0o156) + chr(2688 - 2633) + chr(0b10001 + 0o43), 39528 - 39520), ehT0Px3KOsy9('\060' + chr(111) + chr(2034 - 1984) + '\061' + chr(0b100000 + 0o27), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(51) + chr(0b100001 + 0o17) + chr(0b110 + 0o54), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1010010 + 0o35) + '\x32', 17916 - 17908), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110001) + chr(0b110100) + chr(2893 - 2839), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110011) + chr(53) + chr(49), 8), ehT0Px3KOsy9(chr(0b101101 + 0o3) + '\157' + chr(120 - 70) + chr(0b110111) + chr(54), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\066' + chr(55), 11740 - 11732), ehT0Px3KOsy9(chr(1786 - 1738) + chr(0b1101001 + 0o6) + chr(0b110101), 0b1000), ehT0Px3KOsy9(chr(0b100001 + 0o17) + '\x6f' + '\061' + chr(53), ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + '\x6f' + chr(0b0 + 0o65) + chr(0b10111 + 0o31), 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x1a'), '\144' + '\x65' + chr(99) + '\x6f' + '\x64' + chr(0b1100101))(chr(2113 - 1996) + chr(116) + chr(102) + chr(0b101010 + 0o3) + '\070') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def yqhiJpi9i4jC():
try:
p_vJ076GqAjR = WpThBfI19lUe.query_parameter(xafqLlk3kkUe(SXOLrMavuUCe(b']\x16M\x1a\xf9[s\x8d\xc9D\xe2\x1b\x8f\xdf`~7\xaa\xb3'), chr(100) + chr(101) + chr(8604 - 8505) + chr(111) + chr(100) + chr(101))('\x75' + '\x74' + chr(0b1000000 + 0o46) + '\055' + chr(767 - 711)))
except q1QCh3W88sgk:
p_vJ076GqAjR = xafqLlk3kkUe(SXOLrMavuUCe(b'F\x19S\x0b\xe2E'), chr(0b1000011 + 0o41) + '\x65' + chr(99) + chr(0b1001110 + 0o41) + chr(0b1100100) + '\x65')('\x75' + '\x74' + chr(102) + chr(556 - 511) + chr(0b111000))
iAm9284i4LwH = xafqLlk3kkUe(SXOLrMavuUCe(b'O\x15R\x0b\xe8D\x02\x87\xc9]\xe6\x15\xb5\xd0[q"\xa6\xa5\x95\x0c\xb6\xd9e\x86\x11\xbbizcU\xe2\xa7q\x12\x88\xd3Gx'), '\x64' + chr(0b111001 + 0o54) + chr(0b1100011) + chr(0b1101111) + '\144' + chr(0b1100101))(chr(117) + chr(116) + '\x66' + '\055' + chr(56)).V4roHaS3Ppej(model_name=WpThBfI19lUe.query_parameter(xafqLlk3kkUe(SXOLrMavuUCe(b'@\n\\\x06\xe3\x060\x86\xccU\xef'), '\144' + chr(1627 - 1526) + '\x63' + chr(111) + '\x64' + '\145')(chr(0b1110101) + '\164' + chr(0b10 + 0o144) + '\x2d' + '\070')).configurable.AIvJRzLdDfgF, dataset_name=p_vJ076GqAjR, timestamp=zKdiQFzuryNR.datetime.now().strftime(xafqLlk3kkUe(SXOLrMavuUCe(b'\x11!\x18\x02\xa8L\x02\xcc\xe0\x15\xce'), '\x64' + '\145' + chr(0b1100011) + chr(111) + chr(931 - 831) + chr(0b1010110 + 0o17))(chr(0b110 + 0o157) + chr(5515 - 5399) + chr(3363 - 3261) + chr(0b101101) + '\x38')))
C9jCy1kb8j4P = oqhJDdMJfuwx.path.join(xafqLlk3kkUe(SXOLrMavuUCe(b'J'), '\144' + chr(101) + '\x63' + chr(0b11001 + 0o126) + chr(3479 - 3379) + '\145')(chr(117) + '\164' + chr(4201 - 4099) + chr(582 - 537) + '\x38'), xafqLlk3kkUe(SXOLrMavuUCe(b'@\n\\\x17'), '\x64' + '\x65' + chr(0b0 + 0o143) + '\157' + '\x64' + '\x65')(chr(0b1000101 + 0o60) + '\164' + chr(0b111101 + 0o51) + chr(0b101101) + '\x38'), iAm9284i4LwH)
zLUzGokYBM2Z()
xafqLlk3kkUe(n9W_OR7vTgpr, xafqLlk3kkUe(SXOLrMavuUCe(b'X\x17Z'), chr(100) + '\x65' + chr(99) + chr(11559 - 11448) + chr(100) + '\x65')(chr(12672 - 12555) + chr(116) + chr(9273 - 9171) + chr(364 - 319) + chr(0b111000)))(xafqLlk3kkUe(SXOLrMavuUCe(b'z\x17\x1dB\xa0G(\x9d\xd8E\xf77\x8e\xc2M0%\xb7\xb3\x93\x11\x8f\xdea\x8f'), '\144' + chr(0b1011110 + 0o7) + chr(8148 - 8049) + chr(10874 - 10763) + '\x64' + chr(6323 - 6222))(chr(0b1110101) + chr(116) + '\x66' + chr(0b11101 + 0o20) + chr(883 - 827)))
return C9jCy1kb8j4P
|
tensorflow/tensor2tensor
|
tensor2tensor/trax/trainer.py
|
_setup_gin
|
def _setup_gin():
"""Setup gin configuration."""
# Imports for configurables
# pylint: disable=g-import-not-at-top,unused-import,g-bad-import-order,reimported,unused-variable
from tensor2tensor.trax import models as _trax_models
from tensor2tensor.trax import optimizers as _trax_opt
# pylint: disable=g-import-not-at-top,unused-import,g-bad-import-order,reimported,unused-variable
configs = FLAGS.config or []
# Override with --dataset and --model
if FLAGS.dataset:
configs.append("inputs.dataset_name='%s'" % FLAGS.dataset)
if FLAGS.data_dir:
configs.append("inputs.data_dir='%s'" % FLAGS.data_dir)
if FLAGS.model:
configs.append("train.model=@trax.models.%s" % FLAGS.model)
gin.parse_config_files_and_bindings(FLAGS.config_file, configs)
|
python
|
def _setup_gin():
"""Setup gin configuration."""
# Imports for configurables
# pylint: disable=g-import-not-at-top,unused-import,g-bad-import-order,reimported,unused-variable
from tensor2tensor.trax import models as _trax_models
from tensor2tensor.trax import optimizers as _trax_opt
# pylint: disable=g-import-not-at-top,unused-import,g-bad-import-order,reimported,unused-variable
configs = FLAGS.config or []
# Override with --dataset and --model
if FLAGS.dataset:
configs.append("inputs.dataset_name='%s'" % FLAGS.dataset)
if FLAGS.data_dir:
configs.append("inputs.data_dir='%s'" % FLAGS.data_dir)
if FLAGS.model:
configs.append("train.model=@trax.models.%s" % FLAGS.model)
gin.parse_config_files_and_bindings(FLAGS.config_file, configs)
|
[
"def",
"_setup_gin",
"(",
")",
":",
"# Imports for configurables",
"# pylint: disable=g-import-not-at-top,unused-import,g-bad-import-order,reimported,unused-variable",
"from",
"tensor2tensor",
".",
"trax",
"import",
"models",
"as",
"_trax_models",
"from",
"tensor2tensor",
".",
"trax",
"import",
"optimizers",
"as",
"_trax_opt",
"# pylint: disable=g-import-not-at-top,unused-import,g-bad-import-order,reimported,unused-variable",
"configs",
"=",
"FLAGS",
".",
"config",
"or",
"[",
"]",
"# Override with --dataset and --model",
"if",
"FLAGS",
".",
"dataset",
":",
"configs",
".",
"append",
"(",
"\"inputs.dataset_name='%s'\"",
"%",
"FLAGS",
".",
"dataset",
")",
"if",
"FLAGS",
".",
"data_dir",
":",
"configs",
".",
"append",
"(",
"\"inputs.data_dir='%s'\"",
"%",
"FLAGS",
".",
"data_dir",
")",
"if",
"FLAGS",
".",
"model",
":",
"configs",
".",
"append",
"(",
"\"train.model=@trax.models.%s\"",
"%",
"FLAGS",
".",
"model",
")",
"gin",
".",
"parse_config_files_and_bindings",
"(",
"FLAGS",
".",
"config_file",
",",
"configs",
")"
] |
Setup gin configuration.
|
[
"Setup",
"gin",
"configuration",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/trax/trainer.py#L65-L81
|
train
|
Setup gin configuration.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d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DQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\x30' + '\157' + '\066' + chr(48), 47748 - 47740), ehT0Px3KOsy9(chr(1023 - 975) + chr(0b1101111) + chr(256 - 206) + '\062' + '\063', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(50) + chr(0b110010) + chr(54), 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(0b101001 + 0o11) + '\064' + chr(0b110000), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + '\062' + '\x36' + chr(0b110111), 19533 - 19525), ehT0Px3KOsy9('\x30' + '\x6f' + chr(49) + chr(0b110011) + chr(0b11000 + 0o30), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(10783 - 10672) + chr(0b100011 + 0o15), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1011001 + 0o26) + chr(0b11 + 0o56) + chr(1592 - 1537) + chr(0b11001 + 0o34), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110001) + chr(0b1101 + 0o47) + '\063', 0o10), ehT0Px3KOsy9(chr(578 - 530) + chr(0b110 + 0o151) + chr(0b110010) + '\x33' + chr(55), 39451 - 39443), ehT0Px3KOsy9(chr(48) + '\157' + chr(52) + '\x35', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b111101 + 0o62) + '\x33' + chr(0b10010 + 0o41) + chr(52), 56675 - 56667), ehT0Px3KOsy9('\x30' + chr(0b1010100 + 0o33) + chr(0b110010) + chr(2573 - 2522), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b101 + 0o61) + chr(456 - 406), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b11100 + 0o25) + '\x34' + chr(0b1100 + 0o45), 56438 - 56430), ehT0Px3KOsy9(chr(0b100 + 0o54) + '\157' + '\062' + chr(2447 - 2395) + chr(51), 0o10), ehT0Px3KOsy9('\060' + chr(8328 - 8217) + chr(998 - 949) + '\066' + chr(0b11001 + 0o36), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(49) + chr(51) + '\x33', 0o10), ehT0Px3KOsy9(chr(48) + chr(8629 - 8518) + chr(0b10100 + 0o36) + chr(718 - 669) + chr(0b110000), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(7259 - 7148) + chr(1196 - 1145) + chr(54), 29978 - 29970), ehT0Px3KOsy9(chr(48) + '\157' + chr(51) + '\x34' + '\x31', ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + '\x32' + chr(53) + '\064', ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(568 - 517) + chr(0b100111 + 0o15) + chr(51), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b111000 + 0o67) + chr(885 - 832) + chr(2053 - 2000), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\061' + chr(720 - 667) + '\x33', ord("\x08")), ehT0Px3KOsy9(chr(1034 - 986) + chr(111) + '\x31' + chr(0b110110) + chr(0b100001 + 0o23), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x37' + '\065', 0b1000), ehT0Px3KOsy9('\x30' + '\157' + '\064' + '\x36', 0o10), ehT0Px3KOsy9(chr(158 - 110) + chr(0b1101111) + '\x31' + chr(0b101100 + 0o6) + chr(2073 - 2021), 0b1000), ehT0Px3KOsy9(chr(0b10100 + 0o34) + '\157' + '\x34', 0b1000), ehT0Px3KOsy9(chr(1067 - 1019) + chr(0b1101111) + chr(0b110010) + chr(0b110100) + chr(2333 - 2284), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b10001 + 0o41) + '\x30' + chr(0b11 + 0o55), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b100100 + 0o113) + chr(0b1111 + 0o43) + chr(0b110001) + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(367 - 319) + chr(0b1101111) + '\x33' + chr(0b110010) + chr(0b110001), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(55), 0o10), ehT0Px3KOsy9(chr(486 - 438) + '\x6f' + chr(201 - 152) + chr(0b10110 + 0o34), 33743 - 33735), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110010) + chr(2510 - 2455) + chr(0b110111), 5902 - 5894), ehT0Px3KOsy9(chr(0b11000 + 0o30) + chr(111) + chr(0b100 + 0o57) + chr(662 - 607) + '\x33', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\063' + chr(0b1101 + 0o50) + chr(753 - 702), 11182 - 11174), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(213 - 159) + chr(266 - 214), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + '\157' + '\x35' + chr(508 - 460), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x1e'), '\144' + chr(101) + chr(99) + chr(111) + '\144' + chr(4325 - 4224))(chr(0b1110101) + chr(9342 - 9226) + '\x66' + chr(57 - 12) + chr(0b111000)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def RUxQAxTufo02():
(f9iNU24O7Zur,) = (xafqLlk3kkUe(xafqLlk3kkUe(NPPHb59961Bv(xafqLlk3kkUe(SXOLrMavuUCe(b'D\xf6\xf8\xd3\xd8*2\t\x06\xf1V\xb3a\x1c\x15\xd1\x16#'), chr(0b1001010 + 0o32) + '\x65' + '\143' + '\x6f' + chr(100) + '\145')(chr(0b110 + 0o157) + chr(0b1110100) + chr(102) + chr(0b101101) + chr(0b101111 + 0o11)), xafqLlk3kkUe(SXOLrMavuUCe(b']\xfc\xf2\xc5\xdb+'), '\x64' + chr(101) + chr(4150 - 4051) + chr(0b1101111) + '\x64' + chr(0b1100101))(chr(6111 - 5994) + '\x74' + '\146' + chr(1792 - 1747) + chr(56))), xafqLlk3kkUe(SXOLrMavuUCe(b'D\xe1\xf7\xd8'), chr(1243 - 1143) + chr(0b111000 + 0o55) + chr(0b111011 + 0o50) + chr(0b1101111) + '\x64' + chr(0b111010 + 0o53))(chr(0b111 + 0o156) + chr(0b111011 + 0o71) + '\x66' + '\055' + chr(0b111000))), xafqLlk3kkUe(SXOLrMavuUCe(b']\xfc\xf2\xc5\xdb+'), chr(1478 - 1378) + '\145' + chr(0b1100011) + chr(111) + chr(0b10010 + 0o122) + '\x65')(chr(0b1100000 + 0o25) + '\164' + chr(8496 - 8394) + chr(1256 - 1211) + chr(0b101100 + 0o14))),)
(sw1FY2g7N5_6,) = (xafqLlk3kkUe(xafqLlk3kkUe(NPPHb59961Bv(xafqLlk3kkUe(SXOLrMavuUCe(b'D\xf6\xf8\xd3\xd8*2\t\x06\xf1V\xb3a\x1c\x15\xd1\x16#'), '\144' + '\145' + chr(99) + '\157' + chr(0b1001011 + 0o31) + chr(101))(chr(0b1110001 + 0o4) + chr(0b1001000 + 0o54) + '\x66' + chr(45) + chr(0b110111 + 0o1)), xafqLlk3kkUe(SXOLrMavuUCe(b'_\xe3\xe2\xc9\xda1z\x18\x11\xec'), chr(0b1100100) + chr(101) + chr(0b1011011 + 0o10) + chr(9455 - 9344) + chr(0b1100100) + chr(1935 - 1834))(chr(117) + '\x74' + chr(0b1100100 + 0o2) + chr(698 - 653) + chr(56))), xafqLlk3kkUe(SXOLrMavuUCe(b'D\xe1\xf7\xd8'), chr(0b1011100 + 0o10) + '\x65' + '\x63' + chr(111) + '\x64' + chr(101))(chr(3352 - 3235) + chr(0b10000 + 0o144) + chr(102) + '\055' + chr(0b1111 + 0o51))), xafqLlk3kkUe(SXOLrMavuUCe(b'_\xe3\xe2\xc9\xda1z\x18\x11\xec'), chr(5405 - 5305) + '\145' + chr(6354 - 6255) + chr(0b1011000 + 0o27) + chr(0b111001 + 0o53) + chr(6778 - 6677))(chr(9580 - 9463) + '\x74' + chr(102) + chr(0b101101) + chr(56))),)
Ul237bcSbP6V = vUTZFbqN0o8F.jAj7S20Ct06o or []
if xafqLlk3kkUe(vUTZFbqN0o8F, xafqLlk3kkUe(SXOLrMavuUCe(b'T\xf2\xe2\xc1\xc4=t'), chr(0b1011111 + 0o5) + chr(8543 - 8442) + '\143' + '\157' + '\x64' + chr(101))('\x75' + chr(13204 - 13088) + chr(102) + chr(45) + chr(0b111000))):
xafqLlk3kkUe(Ul237bcSbP6V, xafqLlk3kkUe(SXOLrMavuUCe(b'Q\xe3\xe6\xc5\xd9<'), chr(100) + chr(0b1100101) + chr(0b110111 + 0o54) + chr(0b1000 + 0o147) + '\144' + chr(0b111011 + 0o52))('\x75' + chr(0b1110 + 0o146) + '\146' + chr(0b101001 + 0o4) + chr(56)))(xafqLlk3kkUe(SXOLrMavuUCe(b'Y\xfd\xe6\xd5\xc3+.\x19\x02\xebD\xafvF>\xcd\x166\xed#\xc6\x89\x90\n'), chr(3498 - 3398) + chr(6177 - 6076) + '\143' + chr(0b1101111) + chr(0b1100100) + chr(101))('\165' + '\x74' + chr(0b1101 + 0o131) + '\055' + chr(0b111000)) % xafqLlk3kkUe(vUTZFbqN0o8F, xafqLlk3kkUe(SXOLrMavuUCe(b'T\xf2\xe2\xc1\xc4=t'), chr(0b1011000 + 0o14) + chr(0b101000 + 0o75) + chr(99) + '\157' + chr(8118 - 8018) + chr(101))(chr(117) + chr(116) + '\146' + chr(0b101101) + chr(0b100111 + 0o21))))
if xafqLlk3kkUe(vUTZFbqN0o8F, xafqLlk3kkUe(SXOLrMavuUCe(b'[\xc5\xd0\xf2\xf3m4I\x0b\xf6z\xed'), chr(100) + '\145' + chr(0b11001 + 0o112) + chr(0b1101111) + chr(0b1100100) + chr(0b11011 + 0o112))(chr(11446 - 11329) + '\164' + chr(0b1011100 + 0o12) + chr(45) + '\070')):
xafqLlk3kkUe(Ul237bcSbP6V, xafqLlk3kkUe(SXOLrMavuUCe(b'Q\xe3\xe6\xc5\xd9<'), chr(0b111100 + 0o50) + '\145' + chr(2343 - 2244) + chr(111) + chr(0b1000011 + 0o41) + chr(0b1100101))(chr(0b1110101) + chr(2246 - 2130) + chr(0b1011011 + 0o13) + '\055' + chr(0b111000)))(xafqLlk3kkUe(SXOLrMavuUCe(b'Y\xfd\xe6\xd5\xc3+.\x19\x02\xebD\x83w[\x13\x9eP~\xfb9'), chr(0b100111 + 0o75) + chr(101) + chr(0b1100011) + chr(7075 - 6964) + '\x64' + '\145')(chr(8197 - 8080) + chr(116) + '\x66' + '\055' + '\x38') % xafqLlk3kkUe(vUTZFbqN0o8F, xafqLlk3kkUe(SXOLrMavuUCe(b'[\xc5\xd0\xf2\xf3m4I\x0b\xf6z\xed'), '\x64' + '\x65' + '\x63' + '\157' + chr(9499 - 9399) + '\145')(chr(7146 - 7029) + chr(0b110011 + 0o101) + '\146' + chr(963 - 918) + chr(726 - 670))))
if xafqLlk3kkUe(vUTZFbqN0o8F, xafqLlk3kkUe(SXOLrMavuUCe(b'v\xd8\xa6\xd6\xc6"ZH\x04\xcfk\xea'), chr(0b1100100) + '\145' + chr(0b1100011) + '\x6f' + chr(2658 - 2558) + chr(0b1001000 + 0o35))('\165' + '\x74' + '\146' + chr(0b101101) + chr(56))):
xafqLlk3kkUe(Ul237bcSbP6V, xafqLlk3kkUe(SXOLrMavuUCe(b'Q\xe3\xe6\xc5\xd9<'), chr(0b101111 + 0o65) + '\145' + chr(0b1100011) + chr(0b1100011 + 0o14) + chr(100) + '\145')('\x75' + chr(7915 - 7799) + '\146' + chr(1042 - 997) + chr(0b111000)))(xafqLlk3kkUe(SXOLrMavuUCe(b'D\xe1\xf7\xc9\xd9vm\x12\x07\xfaI\xe1SF\x13\xc2\x0fu\xe5q\x85\xc9\x8f^EQN'), chr(5688 - 5588) + chr(1343 - 1242) + '\143' + chr(0b1101111) + '\144' + chr(101))('\x75' + '\x74' + chr(102) + '\055' + chr(692 - 636)) % xafqLlk3kkUe(vUTZFbqN0o8F, xafqLlk3kkUe(SXOLrMavuUCe(b'v\xd8\xa6\xd6\xc6"ZH\x04\xcfk\xea'), chr(0b1001100 + 0o30) + chr(0b1100101) + '\143' + '\x6f' + chr(100) + '\x65')('\165' + chr(0b111 + 0o155) + chr(3686 - 3584) + chr(45) + chr(56))))
xafqLlk3kkUe(WpThBfI19lUe, xafqLlk3kkUe(SXOLrMavuUCe(b'@\xf2\xe4\xd3\xd2\x07c\x12\r\xf9L\xbbLT\x08\xcf\x12(\xd7\x7f\x8f\xc8\xbcO\x02\x1aYO:c\xd2'), '\x64' + chr(0b101010 + 0o73) + '\143' + chr(0b111000 + 0o67) + '\144' + chr(7847 - 7746))(chr(0b1110101) + chr(0b111101 + 0o67) + chr(102) + chr(0b101101) + chr(0b111000)))(xafqLlk3kkUe(vUTZFbqN0o8F, xafqLlk3kkUe(SXOLrMavuUCe(b'S\xfc\xf8\xc6\xde?_\x1b\n\xf3@'), '\144' + chr(0b1100101) + '\143' + chr(4413 - 4302) + chr(9443 - 9343) + chr(0b1100101))(chr(11073 - 10956) + '\x74' + '\x66' + chr(0b1010 + 0o43) + '\070')), Ul237bcSbP6V)
|
tensorflow/tensor2tensor
|
tensor2tensor/v2/t2t.py
|
train_and_eval_dataset
|
def train_and_eval_dataset(dataset_name, data_dir):
"""Return train and evaluation datasets, feature info and supervised keys.
Args:
dataset_name: a string, the name of the dataset; if it starts with "v1_"
then we'll search T2T Problem registry for it, otherwise we assume it
is a dataset from TFDS and load it from there.
data_dir: directory where the data is located.
Returns:
a 4-tuple consisting of:
* the train tf.data.Dataset
* the eval tf.data.Dataset
* information about features: a python dictionary with feature names
as keys and an object as value that provides .shape and .num_classes.
* supervised_keys: information what's the input and what's the target,
ie., a pair of lists with input and target feature names.
"""
if dataset_name.startswith("v1_"):
return _train_and_eval_dataset_v1(dataset_name[3:], data_dir)
dataset_builder = tfds.builder(dataset_name, data_dir=data_dir)
info = dataset_builder.info
splits = dataset_builder.info.splits
if tfds.Split.TRAIN not in splits:
raise ValueError("To train we require a train split in the dataset.")
if tfds.Split.VALIDATION not in splits and "test" not in splits:
raise ValueError("We require a validation or test split in the dataset.")
eval_split = tfds.Split.VALIDATION
if tfds.Split.VALIDATION not in splits:
eval_split = tfds.Split.TEST
train, valid = tfds.load(
name=dataset_name, split=[tfds.Split.TRAIN, eval_split])
keys = None
if info.supervised_keys:
keys = ([info.supervised_keys[0]], [info.supervised_keys[1]])
return train, valid, info.features, keys
|
python
|
def train_and_eval_dataset(dataset_name, data_dir):
"""Return train and evaluation datasets, feature info and supervised keys.
Args:
dataset_name: a string, the name of the dataset; if it starts with "v1_"
then we'll search T2T Problem registry for it, otherwise we assume it
is a dataset from TFDS and load it from there.
data_dir: directory where the data is located.
Returns:
a 4-tuple consisting of:
* the train tf.data.Dataset
* the eval tf.data.Dataset
* information about features: a python dictionary with feature names
as keys and an object as value that provides .shape and .num_classes.
* supervised_keys: information what's the input and what's the target,
ie., a pair of lists with input and target feature names.
"""
if dataset_name.startswith("v1_"):
return _train_and_eval_dataset_v1(dataset_name[3:], data_dir)
dataset_builder = tfds.builder(dataset_name, data_dir=data_dir)
info = dataset_builder.info
splits = dataset_builder.info.splits
if tfds.Split.TRAIN not in splits:
raise ValueError("To train we require a train split in the dataset.")
if tfds.Split.VALIDATION not in splits and "test" not in splits:
raise ValueError("We require a validation or test split in the dataset.")
eval_split = tfds.Split.VALIDATION
if tfds.Split.VALIDATION not in splits:
eval_split = tfds.Split.TEST
train, valid = tfds.load(
name=dataset_name, split=[tfds.Split.TRAIN, eval_split])
keys = None
if info.supervised_keys:
keys = ([info.supervised_keys[0]], [info.supervised_keys[1]])
return train, valid, info.features, keys
|
[
"def",
"train_and_eval_dataset",
"(",
"dataset_name",
",",
"data_dir",
")",
":",
"if",
"dataset_name",
".",
"startswith",
"(",
"\"v1_\"",
")",
":",
"return",
"_train_and_eval_dataset_v1",
"(",
"dataset_name",
"[",
"3",
":",
"]",
",",
"data_dir",
")",
"dataset_builder",
"=",
"tfds",
".",
"builder",
"(",
"dataset_name",
",",
"data_dir",
"=",
"data_dir",
")",
"info",
"=",
"dataset_builder",
".",
"info",
"splits",
"=",
"dataset_builder",
".",
"info",
".",
"splits",
"if",
"tfds",
".",
"Split",
".",
"TRAIN",
"not",
"in",
"splits",
":",
"raise",
"ValueError",
"(",
"\"To train we require a train split in the dataset.\"",
")",
"if",
"tfds",
".",
"Split",
".",
"VALIDATION",
"not",
"in",
"splits",
"and",
"\"test\"",
"not",
"in",
"splits",
":",
"raise",
"ValueError",
"(",
"\"We require a validation or test split in the dataset.\"",
")",
"eval_split",
"=",
"tfds",
".",
"Split",
".",
"VALIDATION",
"if",
"tfds",
".",
"Split",
".",
"VALIDATION",
"not",
"in",
"splits",
":",
"eval_split",
"=",
"tfds",
".",
"Split",
".",
"TEST",
"train",
",",
"valid",
"=",
"tfds",
".",
"load",
"(",
"name",
"=",
"dataset_name",
",",
"split",
"=",
"[",
"tfds",
".",
"Split",
".",
"TRAIN",
",",
"eval_split",
"]",
")",
"keys",
"=",
"None",
"if",
"info",
".",
"supervised_keys",
":",
"keys",
"=",
"(",
"[",
"info",
".",
"supervised_keys",
"[",
"0",
"]",
"]",
",",
"[",
"info",
".",
"supervised_keys",
"[",
"1",
"]",
"]",
")",
"return",
"train",
",",
"valid",
",",
"info",
".",
"features",
",",
"keys"
] |
Return train and evaluation datasets, feature info and supervised keys.
Args:
dataset_name: a string, the name of the dataset; if it starts with "v1_"
then we'll search T2T Problem registry for it, otherwise we assume it
is a dataset from TFDS and load it from there.
data_dir: directory where the data is located.
Returns:
a 4-tuple consisting of:
* the train tf.data.Dataset
* the eval tf.data.Dataset
* information about features: a python dictionary with feature names
as keys and an object as value that provides .shape and .num_classes.
* supervised_keys: information what's the input and what's the target,
ie., a pair of lists with input and target feature names.
|
[
"Return",
"train",
"and",
"evaluation",
"datasets",
"feature",
"info",
"and",
"supervised",
"keys",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/v2/t2t.py#L48-L83
|
train
|
Returns train and evaluation datasets for the specified dataset.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoV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Lo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(268 - 220) + chr(111) + chr(0b110011) + chr(0b11110 + 0o25) + chr(0b110101), 0b1000), ehT0Px3KOsy9(chr(1485 - 1437) + '\157' + '\x33' + chr(1731 - 1683) + chr(0b101110 + 0o6), 0o10), ehT0Px3KOsy9(chr(0b11111 + 0o21) + chr(0b1101111) + chr(0b110011) + '\062' + '\061', 48892 - 48884), ehT0Px3KOsy9('\060' + chr(4148 - 4037) + chr(1637 - 1586) + chr(0b1011 + 0o54) + chr(0b101100 + 0o4), 27269 - 27261), ehT0Px3KOsy9(chr(0b1101 + 0o43) + '\x6f' + chr(49) + '\066' + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(1626 - 1578) + chr(111) + chr(52) + chr(0b110001), 0o10), ehT0Px3KOsy9(chr(0b111 + 0o51) + chr(1745 - 1634) + chr(50) + chr(52) + '\063', 30937 - 30929), ehT0Px3KOsy9(chr(48) + chr(7757 - 7646) + chr(53) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + '\060', 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + '\061' + '\x36' + '\x34', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b111010 + 0o65) + '\061' + chr(1753 - 1698) + '\065', 18448 - 18440), ehT0Px3KOsy9('\060' + chr(111) + chr(335 - 286) + '\066' + chr(734 - 686), 50130 - 50122), ehT0Px3KOsy9(chr(48) + chr(0b1101010 + 0o5) + chr(54), ord("\x08")), ehT0Px3KOsy9('\060' + chr(5195 - 5084) + chr(0b110011) + chr(49) + '\065', 0b1000), ehT0Px3KOsy9('\x30' + chr(8376 - 8265) + chr(51) + '\x34' + chr(52), 0o10), ehT0Px3KOsy9(chr(1130 - 1082) + '\x6f' + chr(151 - 99) + chr(0b1010 + 0o55), 8266 - 8258), ehT0Px3KOsy9(chr(0b100010 + 0o16) + '\x6f' + '\x36', 8), ehT0Px3KOsy9(chr(0b1001 + 0o47) + chr(0b1010011 + 0o34) + chr(1348 - 1297) + chr(49) + chr(49), 32619 - 32611), ehT0Px3KOsy9(chr(48) + chr(0b110011 + 0o74) + chr(52) + '\x37', 8), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b11101 + 0o25) + '\067' + chr(0b100110 + 0o17), 0b1000), ehT0Px3KOsy9(chr(1529 - 1481) + chr(0b1101111) + chr(0b10101 + 0o36) + '\067' + '\065', 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(51) + chr(0b110010) + chr(0b1101 + 0o47), 55562 - 55554), ehT0Px3KOsy9(chr(48) + '\157' + '\x32' + chr(0b110111) + '\064', 42815 - 42807), ehT0Px3KOsy9('\x30' + '\157' + '\x31' + chr(0b110011) + chr(53), 0o10), ehT0Px3KOsy9(chr(494 - 446) + chr(111) + chr(723 - 673) + chr(50), 0o10), ehT0Px3KOsy9('\060' + chr(0b110010 + 0o75) + '\x33' + '\x32' + chr(2527 - 2474), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x32' + chr(51) + chr(485 - 434), 39820 - 39812), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\062' + chr(2387 - 2337) + '\x33', 31069 - 31061), ehT0Px3KOsy9(chr(0b111 + 0o51) + chr(0b101101 + 0o102) + chr(49) + '\x37' + chr(52), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101010 + 0o5) + '\062' + chr(0b1 + 0o64) + chr(0b110000), 63708 - 63700), ehT0Px3KOsy9('\060' + chr(3982 - 3871) + '\x33' + '\061', ord("\x08")), ehT0Px3KOsy9('\060' + chr(10789 - 10678) + chr(0b11010 + 0o30) + '\061', ord("\x08")), ehT0Px3KOsy9(chr(0b101010 + 0o6) + '\x6f' + '\061' + chr(0b110101) + chr(54), 0b1000), ehT0Px3KOsy9(chr(0b100001 + 0o17) + chr(0b1101111) + '\061' + chr(51) + '\064', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b10001 + 0o136) + chr(2047 - 1995) + '\066', 23154 - 23146), ehT0Px3KOsy9('\060' + '\157' + chr(49) + chr(2687 - 2634) + chr(53), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1011011 + 0o24) + chr(0b11100 + 0o26) + '\066' + chr(48), 38407 - 38399), ehT0Px3KOsy9(chr(48) + '\157' + chr(50) + chr(0b110000) + chr(0b110000), 21945 - 21937), ehT0Px3KOsy9('\060' + '\x6f' + '\x33' + '\x34', 0b1000), ehT0Px3KOsy9(chr(78 - 30) + chr(0b1101111) + '\x33' + chr(0b110000) + '\066', ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9(chr(76 - 28) + '\x6f' + '\065' + chr(0b10110 + 0o32), 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xf3'), chr(100) + chr(0b1100101) + '\143' + chr(0b1011 + 0o144) + chr(100) + chr(101))('\x75' + chr(0b1011 + 0o151) + chr(0b1100110) + chr(321 - 276) + chr(0b111000)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def cA_PIO9aKoOR(p_vJ076GqAjR, kVFRD544hi_1):
if xafqLlk3kkUe(p_vJ076GqAjR, xafqLlk3kkUe(SXOLrMavuUCe(b'\xae\xb0\xb0\x8a\x02R\xd4Et\x1c'), '\144' + chr(101) + chr(0b111101 + 0o46) + chr(0b101100 + 0o103) + chr(5872 - 5772) + chr(0b1001111 + 0o26))(chr(7428 - 7311) + chr(0b0 + 0o164) + chr(0b10000 + 0o126) + '\055' + chr(0b111000)))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xab\xf5\x8e'), chr(100) + '\145' + chr(99) + chr(0b1000011 + 0o54) + chr(0b11010 + 0o112) + '\x65')('\x75' + chr(10357 - 10241) + '\146' + chr(0b100111 + 0o6) + chr(0b100000 + 0o30))):
return xTaEeUNS_uJ6(p_vJ076GqAjR[ehT0Px3KOsy9('\060' + chr(111) + chr(0b110011), 60548 - 60540):], kVFRD544hi_1)
Q0Gl9fAG8fw0 = gPhLUExQYf8r.builder(p_vJ076GqAjR, data_dir=kVFRD544hi_1)
S7Hxucg7jlZk = Q0Gl9fAG8fw0.S7Hxucg7jlZk
uSBCRSw0LUmo = Q0Gl9fAG8fw0.info.splits
if xafqLlk3kkUe(gPhLUExQYf8r.Split, xafqLlk3kkUe(SXOLrMavuUCe(b'\x89\x96\x90\xb18'), chr(0b1100100) + chr(0b1100101) + chr(0b110101 + 0o56) + chr(11888 - 11777) + chr(0b1100100) + chr(9564 - 9463))(chr(117) + '\x74' + '\x66' + chr(1368 - 1323) + chr(0b1001 + 0o57))) not in uSBCRSw0LUmo:
raise q1QCh3W88sgk(xafqLlk3kkUe(SXOLrMavuUCe(b'\x89\xab\xf1\x8c\x04@\xcaB \x03\x18Pt\xa8\x95Ro\xbbB\x9d\x9c\xf4\xc8/s\xbc\xf5\xb3\x0f\xd8ux\x1a|O\x03\x90\xf4t\xa3\xfd\xa0\xb0\x8c\x17R\xc6X.'), chr(0b11111 + 0o105) + chr(0b101111 + 0o66) + chr(0b1010 + 0o131) + chr(111) + chr(0b1100100) + chr(7296 - 7195))(chr(117) + chr(116) + chr(6922 - 6820) + chr(0b1100 + 0o41) + chr(56)))
if xafqLlk3kkUe(gPhLUExQYf8r.Split, xafqLlk3kkUe(SXOLrMavuUCe(b'\x8b\x85\x9d\xb12`\xf7eO:'), chr(100) + chr(0b1100101) + chr(0b1100011) + chr(1631 - 1520) + chr(100) + chr(0b1100101))('\x75' + chr(0b1110100) + '\x66' + '\x2d' + '\070')) not in uSBCRSw0LUmo and xafqLlk3kkUe(SXOLrMavuUCe(b'\xa9\xa1\xa2\x8c'), chr(100) + '\145' + chr(99) + '\x6f' + '\144' + '\145')('\165' + chr(116) + '\146' + '\055' + chr(0b11110 + 0o32)) not in uSBCRSw0LUmo:
raise q1QCh3W88sgk(xafqLlk3kkUe(SXOLrMavuUCe(b'\x8a\xa1\xf1\x8a\x13P\xd6Er\x11]\x11&\xbb\x85Ko\xadF\xc9\x94\xbb\xd2}}\xa7\xbb\xe7\x19\xdbm1\x1d,J\x04\xc4\xa0u\xa8\xfd\xb0\xb9\x9dVE\xc2Xa\x07\x18\x04('), chr(100) + chr(101) + chr(0b1100011) + chr(896 - 785) + chr(0b1100100) + '\145')(chr(13007 - 12890) + chr(6629 - 6513) + '\x66' + '\055' + '\070'))
Fp2qGERAnnCb = gPhLUExQYf8r.Split.VALIDATION
if xafqLlk3kkUe(gPhLUExQYf8r.Split, xafqLlk3kkUe(SXOLrMavuUCe(b'\x8b\x85\x9d\xb12`\xf7eO:'), '\x64' + chr(0b1000111 + 0o36) + '\x63' + '\x6f' + chr(100) + '\145')(chr(0b1100101 + 0o20) + '\x74' + chr(7107 - 7005) + chr(1019 - 974) + chr(0b10001 + 0o47))) not in uSBCRSw0LUmo:
Fp2qGERAnnCb = gPhLUExQYf8r.Split.TEST
(e80gRioCjdat, BZPR0lwTzWO8) = gPhLUExQYf8r.mxtdQMeiwJZJ(name=p_vJ076GqAjR, split=[gPhLUExQYf8r.Split.TRAIN, Fp2qGERAnnCb])
w8H8C9ec5BO1 = None
if xafqLlk3kkUe(S7Hxucg7jlZk, xafqLlk3kkUe(SXOLrMavuUCe(b'\xae\xb1\xa1\x9d\x04W\xca_e\x10"\x1bc\xb4\x97'), chr(0b1100100 + 0o0) + '\x65' + chr(8052 - 7953) + chr(111) + chr(100) + chr(7384 - 7283))(chr(117) + chr(8727 - 8611) + '\x66' + chr(0b101101) + chr(0b10011 + 0o45))):
w8H8C9ec5BO1 = ([S7Hxucg7jlZk.supervised_keys[ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110000), 8)]], [S7Hxucg7jlZk.supervised_keys[ehT0Px3KOsy9('\x30' + '\157' + chr(0b100111 + 0o12), 30615 - 30607)]])
return (e80gRioCjdat, BZPR0lwTzWO8, xafqLlk3kkUe(S7Hxucg7jlZk, xafqLlk3kkUe(SXOLrMavuUCe(b'\xbb\xa1\xb0\x8c\x03S\xc6_'), '\x64' + chr(0b111 + 0o136) + chr(0b1100011) + chr(0b1111 + 0o140) + chr(3665 - 3565) + chr(0b1100001 + 0o4))(chr(0b1110101) + '\x74' + chr(102) + chr(45) + '\x38')), w8H8C9ec5BO1)
|
tensorflow/tensor2tensor
|
tensor2tensor/v2/t2t.py
|
_make_info
|
def _make_info(shape_list, num_classes):
"""Create an info-like tuple for feature given some shapes and vocab size."""
feature_info = collections.namedtuple("FeatureInfo", ["shape", "num_classes"])
cur_shape = list(shape_list[0])
# We need to merge the provided shapes, put None where they disagree.
for shape in shape_list:
if len(shape) != len(cur_shape):
raise ValueError("Shapes need to have the same number of dimensions.")
for i in range(len(shape)):
if cur_shape[i] is not None:
if shape[i] != cur_shape[i]:
cur_shape[i] = None
return feature_info(cur_shape, num_classes)
|
python
|
def _make_info(shape_list, num_classes):
"""Create an info-like tuple for feature given some shapes and vocab size."""
feature_info = collections.namedtuple("FeatureInfo", ["shape", "num_classes"])
cur_shape = list(shape_list[0])
# We need to merge the provided shapes, put None where they disagree.
for shape in shape_list:
if len(shape) != len(cur_shape):
raise ValueError("Shapes need to have the same number of dimensions.")
for i in range(len(shape)):
if cur_shape[i] is not None:
if shape[i] != cur_shape[i]:
cur_shape[i] = None
return feature_info(cur_shape, num_classes)
|
[
"def",
"_make_info",
"(",
"shape_list",
",",
"num_classes",
")",
":",
"feature_info",
"=",
"collections",
".",
"namedtuple",
"(",
"\"FeatureInfo\"",
",",
"[",
"\"shape\"",
",",
"\"num_classes\"",
"]",
")",
"cur_shape",
"=",
"list",
"(",
"shape_list",
"[",
"0",
"]",
")",
"# We need to merge the provided shapes, put None where they disagree.",
"for",
"shape",
"in",
"shape_list",
":",
"if",
"len",
"(",
"shape",
")",
"!=",
"len",
"(",
"cur_shape",
")",
":",
"raise",
"ValueError",
"(",
"\"Shapes need to have the same number of dimensions.\"",
")",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"shape",
")",
")",
":",
"if",
"cur_shape",
"[",
"i",
"]",
"is",
"not",
"None",
":",
"if",
"shape",
"[",
"i",
"]",
"!=",
"cur_shape",
"[",
"i",
"]",
":",
"cur_shape",
"[",
"i",
"]",
"=",
"None",
"return",
"feature_info",
"(",
"cur_shape",
",",
"num_classes",
")"
] |
Create an info-like tuple for feature given some shapes and vocab size.
|
[
"Create",
"an",
"info",
"-",
"like",
"tuple",
"for",
"feature",
"given",
"some",
"shapes",
"and",
"vocab",
"size",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/v2/t2t.py#L86-L98
|
train
|
Create an info - like tuple for feature given some shapes and vocab size.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0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eIm,g1Uy6IV0tyJQ,f9CsFWzvg0Vq,YlkZvXL8qwsX,MCqssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\060' + chr(9584 - 9473) + chr(0b110001) + chr(55) + chr(1278 - 1224), 0b1000), ehT0Px3KOsy9('\060' + chr(0b111000 + 0o67) + chr(49) + chr(2052 - 1998) + chr(0b10000 + 0o42), 55302 - 55294), ehT0Px3KOsy9('\060' + '\x6f' + '\061' + chr(0b110001) + '\x30', 0o10), ehT0Px3KOsy9(chr(0b11100 + 0o24) + chr(0b100001 + 0o116) + '\063' + '\062' + chr(0b110101), 0b1000), ehT0Px3KOsy9('\060' + chr(0b110001 + 0o76) + chr(51) + chr(0b110110) + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(227 - 179) + chr(111) + chr(50) + chr(0b110101), 53326 - 53318), ehT0Px3KOsy9(chr(1934 - 1886) + chr(404 - 293) + chr(270 - 218) + chr(1276 - 1227), 0o10), ehT0Px3KOsy9(chr(285 - 237) + '\157' + chr(0b11001 + 0o30) + chr(0b101010 + 0o10) + chr(0b11111 + 0o22), 9777 - 9769), ehT0Px3KOsy9(chr(0b101101 + 0o3) + chr(0b1011011 + 0o24) + chr(49) + chr(55) + chr(971 - 922), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110001) + '\066', 23746 - 23738), ehT0Px3KOsy9(chr(1575 - 1527) + chr(6959 - 6848) + chr(0b110010) + '\x34' + chr(0b110100), 11064 - 11056), ehT0Px3KOsy9(chr(0b110000) + chr(7708 - 7597) + chr(50) + '\066' + '\x34', 30232 - 30224), ehT0Px3KOsy9('\060' + chr(0b1001110 + 0o41) + chr(1721 - 1671) + chr(52) + chr(51), 37048 - 37040), ehT0Px3KOsy9(chr(0b110000) + chr(6201 - 6090) + chr(0b110011) + '\x35' + '\x35', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x33' + chr(1676 - 1626) + chr(50), 0o10), ehT0Px3KOsy9(chr(997 - 949) + chr(0b1000010 + 0o55) + chr(0b110011) + chr(585 - 536), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + '\062' + chr(2460 - 2406) + chr(0b110111), 550 - 542), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b1 + 0o66) + '\x32', 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110001) + chr(49) + chr(0b110010), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110001) + chr(0b110001 + 0o5) + chr(820 - 766), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b100010 + 0o115) + chr(1353 - 1298) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(317 - 269) + chr(0b101110 + 0o101) + chr(0b110011) + '\065' + chr(51), 48893 - 48885), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b10100 + 0o35) + '\064' + chr(0b110100), 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(322 - 272) + '\x30' + chr(0b1001 + 0o56), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(0b100 + 0o55) + chr(0b110001) + '\065', ord("\x08")), ehT0Px3KOsy9(chr(1199 - 1151) + chr(0b1101111) + '\x33' + chr(361 - 312) + chr(0b1110 + 0o45), ord("\x08")), ehT0Px3KOsy9(chr(759 - 711) + chr(0b1101111) + chr(0b1001 + 0o51) + chr(2220 - 2171) + chr(1110 - 1059), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(0b10 + 0o61) + chr(0b1001 + 0o53) + '\x34', 0b1000), ehT0Px3KOsy9(chr(1458 - 1410) + chr(9292 - 9181) + chr(49) + '\064', 65010 - 65002), ehT0Px3KOsy9('\x30' + chr(340 - 229) + chr(0b1001 + 0o52) + chr(1781 - 1726) + chr(0b11111 + 0o26), 0o10), ehT0Px3KOsy9(chr(1636 - 1588) + chr(9109 - 8998) + '\x33' + '\x37' + '\060', 0o10), ehT0Px3KOsy9(chr(681 - 633) + '\x6f' + chr(0b110001) + chr(54) + chr(49), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(5228 - 5117) + '\065', 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b100 + 0o56) + '\x33' + chr(0b110110 + 0o0), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110010) + chr(0b110010) + '\x36', ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + '\061' + chr(1218 - 1169) + chr(1688 - 1634), 16992 - 16984), ehT0Px3KOsy9(chr(0b110000) + chr(0b111111 + 0o60) + chr(0b110111) + '\067', 8), ehT0Px3KOsy9(chr(48) + chr(7173 - 7062) + chr(0b110111) + chr(0b110000), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b100 + 0o153) + chr(0b1101 + 0o46) + chr(0b110000) + chr(54), 27387 - 27379), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b101010 + 0o11) + '\065' + chr(0b110011 + 0o3), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(622 - 574) + chr(4424 - 4313) + chr(0b110101) + chr(1258 - 1210), 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'P'), chr(100) + chr(101) + '\x63' + chr(0b1101110 + 0o1) + chr(0b1100100) + '\145')('\x75' + '\x74' + chr(0b1000100 + 0o42) + '\055' + '\070') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def pVmed7U5DpuL(qypPRW8fq869, i6loyAgxUM2t):
BACxa4XKHvRJ = FGhnnwoh1Dd8.tFAg22QQA3eR(xafqLlk3kkUe(SXOLrMavuUCe(b'8\x17)\xa1\x85gD\x18\x17h\xcb'), '\144' + chr(0b11110 + 0o107) + '\143' + chr(9810 - 9699) + chr(100) + chr(0b1100101))('\165' + '\164' + chr(8688 - 8586) + chr(45) + chr(0b111000)), [xafqLlk3kkUe(SXOLrMavuUCe(b'\r\x1a)\xa5\x95'), '\144' + chr(0b110101 + 0o60) + chr(0b0 + 0o143) + chr(7710 - 7599) + chr(0b1100100) + chr(0b1100101))(chr(117) + chr(0b111011 + 0o71) + '\x66' + chr(0b101101) + chr(0b100100 + 0o24)), xafqLlk3kkUe(SXOLrMavuUCe(b'\x10\x07%\x8a\x93y@"\nk\xd7'), chr(1717 - 1617) + chr(4223 - 4122) + '\x63' + chr(0b1101111) + chr(0b1100100) + chr(336 - 235))(chr(0b1001 + 0o154) + chr(11989 - 11873) + chr(0b1100110) + chr(0b101101) + chr(543 - 487))])
ok72FAgMhqwH = YyaZ4tpXu4lf(qypPRW8fq869[ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110000), 3252 - 3244)])
for nauYfLglTpcb in qypPRW8fq869:
if c2A0yzQpDQB3(nauYfLglTpcb) != c2A0yzQpDQB3(ok72FAgMhqwH):
raise q1QCh3W88sgk(xafqLlk3kkUe(SXOLrMavuUCe(b'-\x1a)\xa5\x95f\x01?\x1ck\xc0\x94\xd7\x82\xf2q\xd6L/VK\x83\x01\xa7>\xaa\xe6\x81,\x93\x8d\x1cg\xfb\xe4nP^\xe6\x8a\x17\x1f-\xbb\x83|N?\n '), chr(0b1010010 + 0o22) + '\x65' + chr(99) + '\x6f' + chr(0b1100100) + chr(101))(chr(117) + chr(0b1110100) + chr(0b1001111 + 0o27) + chr(1087 - 1042) + chr(0b1001 + 0o57)))
for WVxHKyX45z_L in vQr8gNKaIaWE(c2A0yzQpDQB3(nauYfLglTpcb)):
if ok72FAgMhqwH[WVxHKyX45z_L] is not None:
if nauYfLglTpcb[WVxHKyX45z_L] != ok72FAgMhqwH[WVxHKyX45z_L]:
ok72FAgMhqwH[WVxHKyX45z_L] = None
return BACxa4XKHvRJ(ok72FAgMhqwH, i6loyAgxUM2t)
|
tensorflow/tensor2tensor
|
tensor2tensor/v2/t2t.py
|
_select_features
|
def _select_features(example, feature_list=None):
"""Select a subset of features from the example dict."""
feature_list = feature_list or ["inputs", "targets"]
return {f: example[f] for f in feature_list}
|
python
|
def _select_features(example, feature_list=None):
"""Select a subset of features from the example dict."""
feature_list = feature_list or ["inputs", "targets"]
return {f: example[f] for f in feature_list}
|
[
"def",
"_select_features",
"(",
"example",
",",
"feature_list",
"=",
"None",
")",
":",
"feature_list",
"=",
"feature_list",
"or",
"[",
"\"inputs\"",
",",
"\"targets\"",
"]",
"return",
"{",
"f",
":",
"example",
"[",
"f",
"]",
"for",
"f",
"in",
"feature_list",
"}"
] |
Select a subset of features from the example dict.
|
[
"Select",
"a",
"subset",
"of",
"features",
"from",
"the",
"example",
"dict",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tens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VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\062' + chr(0b101010 + 0o15) + '\061', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\065' + chr(55), 0o10), ehT0Px3KOsy9(chr(0b10010 + 0o36) + '\x6f' + '\x32' + chr(55) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110001) + '\064' + '\066', 0o10), ehT0Px3KOsy9('\x30' + chr(6412 - 6301) + '\x31' + chr(55) + chr(0b110101), 32995 - 32987), ehT0Px3KOsy9('\060' + '\x6f' + '\063' + '\x33' + chr(110 - 61), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(1079 - 1030) + '\060' + chr(0b110000), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(4078 - 3967) + chr(0b110010) + chr(508 - 457) + '\x35', ord("\x08")), ehT0Px3KOsy9(chr(0b10010 + 0o36) + chr(0b1101111) + chr(0b10011 + 0o42) + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(347 - 299) + chr(0b100 + 0o153) + chr(0b1000 + 0o51) + '\x36' + '\x35', 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101011 + 0o4) + chr(51) + chr(2281 - 2232) + '\x33', ord("\x08")), ehT0Px3KOsy9(chr(0b11001 + 0o27) + chr(0b1101111) + '\x33' + chr(0b110101) + chr(48), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110001 + 0o1) + chr(52) + chr(49), 0o10), ehT0Px3KOsy9(chr(2125 - 2077) + chr(0b0 + 0o157) + chr(0b110001) + chr(0b100111 + 0o17) + chr(0b1011 + 0o50), ord("\x08")), ehT0Px3KOsy9(chr(596 - 548) + chr(2505 - 2394) + chr(640 - 589) + chr(0b110100) + chr(55), 14414 - 14406), ehT0Px3KOsy9('\x30' + '\157' + chr(0b10000 + 0o42) + '\x31' + chr(52), ord("\x08")), ehT0Px3KOsy9('\060' + chr(2462 - 2351) + chr(0b10 + 0o64) + '\064', 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(49) + chr(50) + chr(0b110010), 11621 - 11613), ehT0Px3KOsy9(chr(0b1001 + 0o47) + chr(0b1011 + 0o144) + chr(643 - 593) + chr(48) + chr(0b110000), 16870 - 16862), ehT0Px3KOsy9(chr(48) + chr(9820 - 9709) + chr(2173 - 2122) + chr(0b110111), 0o10), ehT0Px3KOsy9(chr(1320 - 1272) + chr(0b1101111) + chr(1981 - 1931) + chr(0b110110) + '\061', 37819 - 37811), ehT0Px3KOsy9(chr(1315 - 1267) + '\x6f' + chr(0b110011) + chr(48) + chr(1523 - 1475), ord("\x08")), ehT0Px3KOsy9(chr(0b100000 + 0o20) + '\x6f' + chr(107 - 57) + chr(0b100010 + 0o25) + '\063', 0b1000), ehT0Px3KOsy9('\060' + '\157' + '\063' + '\x34' + chr(1048 - 1000), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(11751 - 11640) + '\x33' + '\062' + '\065', ord("\x08")), ehT0Px3KOsy9(chr(0b100111 + 0o11) + chr(6398 - 6287) + chr(1846 - 1796) + '\x30', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(6228 - 6117) + '\x31' + '\x31' + '\x36', 0b1000), ehT0Px3KOsy9(chr(2294 - 2246) + '\x6f' + chr(49) + chr(0b110011) + chr(0b110000), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(2561 - 2510) + '\060' + '\x34', 59229 - 59221), ehT0Px3KOsy9(chr(0b101110 + 0o2) + chr(7416 - 7305) + '\063' + '\x31' + chr(1119 - 1071), 65519 - 65511), ehT0Px3KOsy9(chr(0b101000 + 0o10) + '\x6f' + '\065' + '\x37', 8), ehT0Px3KOsy9(chr(1712 - 1664) + chr(0b1101111) + chr(0b110010) + '\x30' + chr(0b11010 + 0o34), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\063' + chr(0b1110 + 0o47) + chr(0b1001 + 0o55), 59758 - 59750), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(958 - 907) + '\065' + chr(52), 0b1000), ehT0Px3KOsy9('\x30' + chr(1245 - 1134) + chr(0b110010) + '\065' + '\060', 231 - 223), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\061' + chr(0b110101) + chr(1586 - 1536), 8274 - 8266), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\062' + '\062' + '\x31', 0o10), ehT0Px3KOsy9(chr(0b101011 + 0o5) + '\157' + chr(50) + '\x31' + chr(1237 - 1189), 0o10), ehT0Px3KOsy9(chr(0b1000 + 0o50) + '\157' + chr(50) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x31' + '\067' + chr(48), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x35' + chr(0b110000), ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x97'), chr(0b10100 + 0o120) + '\145' + '\x63' + chr(0b1100101 + 0o12) + chr(100) + '\x65')(chr(0b1110101) + chr(0b1110100) + chr(102) + chr(0b101101) + chr(1873 - 1817)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def AslM28mnUrps(kP4qaKv0ZkGv, Z7YMKsexCzCW=None):
Z7YMKsexCzCW = Z7YMKsexCzCW or [xafqLlk3kkUe(SXOLrMavuUCe(b'\xd0A\xca\x13\t\xaa'), '\x64' + chr(1726 - 1625) + chr(0b1100011) + chr(111) + '\144' + chr(5609 - 5508))(chr(1098 - 981) + '\x74' + chr(0b101001 + 0o75) + chr(45) + chr(56)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xcdN\xc8\x01\x18\xad3'), chr(100) + chr(101) + chr(0b101001 + 0o72) + chr(0b100 + 0o153) + chr(0b110100 + 0o60) + chr(0b1000001 + 0o44))(chr(117) + '\x74' + chr(7820 - 7718) + '\x2d' + chr(1694 - 1638))]
return {EGyt1xfPT1P6: kP4qaKv0ZkGv[EGyt1xfPT1P6] for EGyt1xfPT1P6 in Z7YMKsexCzCW}
|
tensorflow/tensor2tensor
|
tensor2tensor/v2/t2t.py
|
_train_and_eval_dataset_v1
|
def _train_and_eval_dataset_v1(problem_name, data_dir):
"""Return train and evaluation datasets, feature info and supervised keys."""
problem = problems.problem(problem_name)
train_dataset = problem.dataset(tf.estimator.ModeKeys.TRAIN, data_dir)
train_dataset = train_dataset.map(_select_features)
eval_dataset = problem.dataset(tf.estimator.ModeKeys.EVAL, data_dir)
eval_dataset = eval_dataset.map(_select_features)
supervised_keys = (["inputs"], ["targets"])
hparams = problem.get_hparams()
# We take a few training examples to guess the shapes.
input_shapes, target_shapes = [], []
for example in train_dataset.take(3):
input_shapes.append(example["inputs"].shape.as_list())
target_shapes.append(example["targets"].shape.as_list())
input_vocab_size = hparams.vocab_size["inputs"]
target_vocab_size = hparams.vocab_size["targets"]
input_info = _make_info(input_shapes, input_vocab_size)
target_info = _make_info(target_shapes, target_vocab_size)
info = {"inputs": input_info, "targets": target_info}
return train_dataset, eval_dataset, info, supervised_keys
|
python
|
def _train_and_eval_dataset_v1(problem_name, data_dir):
"""Return train and evaluation datasets, feature info and supervised keys."""
problem = problems.problem(problem_name)
train_dataset = problem.dataset(tf.estimator.ModeKeys.TRAIN, data_dir)
train_dataset = train_dataset.map(_select_features)
eval_dataset = problem.dataset(tf.estimator.ModeKeys.EVAL, data_dir)
eval_dataset = eval_dataset.map(_select_features)
supervised_keys = (["inputs"], ["targets"])
hparams = problem.get_hparams()
# We take a few training examples to guess the shapes.
input_shapes, target_shapes = [], []
for example in train_dataset.take(3):
input_shapes.append(example["inputs"].shape.as_list())
target_shapes.append(example["targets"].shape.as_list())
input_vocab_size = hparams.vocab_size["inputs"]
target_vocab_size = hparams.vocab_size["targets"]
input_info = _make_info(input_shapes, input_vocab_size)
target_info = _make_info(target_shapes, target_vocab_size)
info = {"inputs": input_info, "targets": target_info}
return train_dataset, eval_dataset, info, supervised_keys
|
[
"def",
"_train_and_eval_dataset_v1",
"(",
"problem_name",
",",
"data_dir",
")",
":",
"problem",
"=",
"problems",
".",
"problem",
"(",
"problem_name",
")",
"train_dataset",
"=",
"problem",
".",
"dataset",
"(",
"tf",
".",
"estimator",
".",
"ModeKeys",
".",
"TRAIN",
",",
"data_dir",
")",
"train_dataset",
"=",
"train_dataset",
".",
"map",
"(",
"_select_features",
")",
"eval_dataset",
"=",
"problem",
".",
"dataset",
"(",
"tf",
".",
"estimator",
".",
"ModeKeys",
".",
"EVAL",
",",
"data_dir",
")",
"eval_dataset",
"=",
"eval_dataset",
".",
"map",
"(",
"_select_features",
")",
"supervised_keys",
"=",
"(",
"[",
"\"inputs\"",
"]",
",",
"[",
"\"targets\"",
"]",
")",
"hparams",
"=",
"problem",
".",
"get_hparams",
"(",
")",
"# We take a few training examples to guess the shapes.",
"input_shapes",
",",
"target_shapes",
"=",
"[",
"]",
",",
"[",
"]",
"for",
"example",
"in",
"train_dataset",
".",
"take",
"(",
"3",
")",
":",
"input_shapes",
".",
"append",
"(",
"example",
"[",
"\"inputs\"",
"]",
".",
"shape",
".",
"as_list",
"(",
")",
")",
"target_shapes",
".",
"append",
"(",
"example",
"[",
"\"targets\"",
"]",
".",
"shape",
".",
"as_list",
"(",
")",
")",
"input_vocab_size",
"=",
"hparams",
".",
"vocab_size",
"[",
"\"inputs\"",
"]",
"target_vocab_size",
"=",
"hparams",
".",
"vocab_size",
"[",
"\"targets\"",
"]",
"input_info",
"=",
"_make_info",
"(",
"input_shapes",
",",
"input_vocab_size",
")",
"target_info",
"=",
"_make_info",
"(",
"target_shapes",
",",
"target_vocab_size",
")",
"info",
"=",
"{",
"\"inputs\"",
":",
"input_info",
",",
"\"targets\"",
":",
"target_info",
"}",
"return",
"train_dataset",
",",
"eval_dataset",
",",
"info",
",",
"supervised_keys"
] |
Return train and evaluation datasets, feature info and supervised keys.
|
[
"Return",
"train",
"and",
"evaluation",
"datasets",
"feature",
"info",
"and",
"supervised",
"keys",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/v2/t2t.py#L107-L126
|
train
|
Return train and evaluation datasets feature info and supervised keys.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDASQ0Qkq,NL8dtWOpbcjF,_bikzMuRfbJG,sznFqDbNBHlx,ZsDPvpP4xdo3,cW7yQuy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VpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110010) + chr(54) + chr(111 - 58), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110001) + '\x31' + chr(55), 0o10), ehT0Px3KOsy9(chr(48) + chr(11530 - 11419) + chr(0b100011 + 0o20) + '\063' + chr(0b110111), 16365 - 16357), ehT0Px3KOsy9(chr(1771 - 1723) + '\x6f' + chr(49) + chr(53) + '\060', ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(1166 - 1115) + chr(0b11000 + 0o32) + '\065', 0o10), ehT0Px3KOsy9(chr(1886 - 1838) + chr(8649 - 8538) + chr(1698 - 1649) + chr(1139 - 1084) + chr(52), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(993 - 942) + chr(2098 - 2044), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(51) + chr(50) + chr(0b110011), ord("\x08")), ehT0Px3KOsy9(chr(1372 - 1324) + chr(0b1101111) + chr(508 - 457) + '\067' + chr(0b110 + 0o57), ord("\x08")), ehT0Px3KOsy9(chr(0b100011 + 0o15) + '\x6f' + chr(0b110110) + chr(0b11001 + 0o34), 40021 - 40013), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b1001 + 0o51) + chr(53) + chr(0b110101), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110000 + 0o3) + '\062', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b11000 + 0o127) + chr(55), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(50) + '\x31' + chr(2061 - 2013), 48964 - 48956), ehT0Px3KOsy9(chr(0b100101 + 0o13) + chr(111) + chr(2103 - 2053) + chr(0b110011) + chr(54), 1559 - 1551), ehT0Px3KOsy9(chr(0b10001 + 0o37) + chr(2009 - 1898) + chr(51) + chr(54) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(10169 - 10058) + chr(145 - 96) + '\063' + chr(0b10110 + 0o36), ord("\x08")), ehT0Px3KOsy9(chr(0b11011 + 0o25) + '\157' + chr(0b110101) + '\x32', 64407 - 64399), ehT0Px3KOsy9(chr(0b10011 + 0o35) + chr(0b100001 + 0o116) + chr(49) + chr(0b11000 + 0o30) + chr(0b101000 + 0o16), 17869 - 17861), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b1110 + 0o43) + chr(0b110010) + '\x33', ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(0b100010 + 0o20) + chr(0b110101) + '\x32', 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x33' + chr(1034 - 984) + '\x37', 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(1332 - 1283) + chr(0b110110) + chr(0b10 + 0o57), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(51) + chr(0b101001 + 0o12) + chr(1749 - 1695), 0b1000), ehT0Px3KOsy9('\x30' + chr(3292 - 3181) + '\x33' + chr(1554 - 1499) + chr(0b10100 + 0o41), 8), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\063' + chr(0b100 + 0o54) + chr(53), 13292 - 13284), ehT0Px3KOsy9(chr(909 - 861) + chr(111) + '\x32' + '\x34' + chr(52), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(2433 - 2383) + chr(1029 - 981) + '\x36', 0o10), ehT0Px3KOsy9(chr(0b1111 + 0o41) + chr(111) + chr(50) + '\066' + chr(0b110110), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(50) + chr(1548 - 1500) + chr(1920 - 1865), ord("\x08")), ehT0Px3KOsy9(chr(1555 - 1507) + chr(5546 - 5435) + '\x36' + chr(0b110110), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + '\061' + '\x34' + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(0b110 + 0o52) + '\x6f' + chr(0b10001 + 0o42) + '\065' + chr(0b10110 + 0o35), 54496 - 54488), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b10010 + 0o41) + chr(0b101000 + 0o12) + '\x30', 0b1000), ehT0Px3KOsy9(chr(0b1000 + 0o50) + chr(111) + chr(174 - 125) + chr(0b110101) + chr(0b110011), 0o10), ehT0Px3KOsy9(chr(0b1000 + 0o50) + '\x6f' + chr(2228 - 2179) + '\x35' + '\060', 8), ehT0Px3KOsy9(chr(0b10 + 0o56) + chr(0b101010 + 0o105) + chr(1945 - 1896) + '\064', 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(0b1111 + 0o47) + chr(54), 8), ehT0Px3KOsy9('\060' + chr(0b110100 + 0o73) + chr(0b110111) + '\x33', 6282 - 6274), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b1110 + 0o45) + chr(876 - 822) + '\062', 8)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(2078 - 2030) + '\x6f' + '\x35' + chr(0b110000 + 0o0), ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x9b'), '\x64' + chr(8931 - 8830) + '\x63' + chr(0b1011101 + 0o22) + chr(5906 - 5806) + '\x65')(chr(0b1110101) + chr(116) + chr(0b1100110) + '\055' + chr(0b111000)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def xTaEeUNS_uJ6(wezGpYDorAsK, kVFRD544hi_1):
sO7e1A_Mor6Q = Jcdr_dQEgT_C.sO7e1A_Mor6Q(wezGpYDorAsK)
_H7HhX1OiYNO = sO7e1A_Mor6Q.dataset(IDJ2eXGCBCDu.estimator.ModeKeys.TRAIN, kVFRD544hi_1)
_H7HhX1OiYNO = _H7HhX1OiYNO.map(AslM28mnUrps)
yXL7lYDLbCr_ = sO7e1A_Mor6Q.dataset(IDJ2eXGCBCDu.estimator.ModeKeys.EVAL, kVFRD544hi_1)
yXL7lYDLbCr_ = yXL7lYDLbCr_.map(AslM28mnUrps)
CZW_z9Phwam0 = ([xafqLlk3kkUe(SXOLrMavuUCe(b'\xdc!\xaf\x1d\xa1\x0f'), chr(0b1100100) + chr(0b1100101) + chr(99) + chr(111) + chr(100) + '\x65')(chr(0b1110101) + chr(0b1101 + 0o147) + chr(0b1001100 + 0o32) + '\055' + chr(56))], [xafqLlk3kkUe(SXOLrMavuUCe(b'\xc1.\xad\x0f\xb0\x08m'), chr(444 - 344) + '\145' + chr(99) + chr(11740 - 11629) + chr(100) + chr(0b1100101))(chr(0b1110101) + chr(0b1110100) + chr(0b1100110) + chr(0b100100 + 0o11) + chr(56))])
n4ljua2gi1Pr = sO7e1A_Mor6Q.get_hparams()
(MUaMiwsTdGeu, l6V0bqbLx_b9) = ([], [])
for kP4qaKv0ZkGv in xafqLlk3kkUe(_H7HhX1OiYNO, xafqLlk3kkUe(SXOLrMavuUCe(b'\xc1.\xb4\r'), chr(5903 - 5803) + chr(3474 - 3373) + '\143' + chr(0b1101111) + chr(0b100010 + 0o102) + '\145')('\x75' + '\164' + '\146' + chr(45) + chr(1320 - 1264)))(ehT0Px3KOsy9(chr(0b10011 + 0o35) + chr(0b1101111) + '\063', 36328 - 36320)):
xafqLlk3kkUe(MUaMiwsTdGeu, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd4?\xaf\r\xbb\x18'), chr(866 - 766) + '\145' + '\x63' + chr(111) + '\x64' + chr(0b1100101))('\x75' + '\164' + chr(0b1000000 + 0o46) + '\x2d' + chr(0b111000 + 0o0)))(xafqLlk3kkUe(kP4qaKv0ZkGv[xafqLlk3kkUe(SXOLrMavuUCe(b'\xdc!\xaf\x1d\xa1\x0f'), '\144' + '\145' + chr(0b11001 + 0o112) + chr(8394 - 8283) + chr(0b110100 + 0o60) + chr(0b1100101))(chr(117) + '\164' + chr(102) + chr(1520 - 1475) + chr(0b100101 + 0o23))].shape, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd4<\x80\x04\xbc\x0fj'), chr(0b10000 + 0o124) + chr(0b1000101 + 0o40) + chr(5799 - 5700) + '\x6f' + '\144' + '\145')('\165' + chr(0b100011 + 0o121) + chr(0b1100110) + chr(45) + chr(0b111000)))())
xafqLlk3kkUe(l6V0bqbLx_b9, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd4?\xaf\r\xbb\x18'), chr(0b1100100) + '\x65' + chr(0b1100011) + chr(0b1010101 + 0o32) + '\x64' + '\x65')(chr(0b1001111 + 0o46) + chr(0b1110100) + '\146' + chr(1401 - 1356) + chr(620 - 564)))(xafqLlk3kkUe(kP4qaKv0ZkGv[xafqLlk3kkUe(SXOLrMavuUCe(b'\xc1.\xad\x0f\xb0\x08m'), '\x64' + '\x65' + chr(99) + chr(0b1101111) + '\144' + chr(0b1001000 + 0o35))(chr(0b11110 + 0o127) + '\164' + '\146' + chr(0b101001 + 0o4) + '\x38')].shape, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd4<\x80\x04\xbc\x0fj'), '\x64' + chr(8613 - 8512) + chr(0b101101 + 0o66) + '\157' + '\x64' + '\x65')(chr(0b1110101) + chr(0b1110100) + chr(102) + '\055' + '\070'))())
nHdeL8JC2SEC = n4ljua2gi1Pr.CeyMIoSyrpkQ[xafqLlk3kkUe(SXOLrMavuUCe(b'\xdc!\xaf\x1d\xa1\x0f'), chr(0b1100100) + '\145' + chr(0b1000110 + 0o35) + chr(11158 - 11047) + chr(0b1100100) + '\x65')(chr(9723 - 9606) + chr(0b1101110 + 0o6) + chr(4875 - 4773) + chr(0b101101 + 0o0) + chr(56))]
HHpQzG13Xmp7 = n4ljua2gi1Pr.CeyMIoSyrpkQ[xafqLlk3kkUe(SXOLrMavuUCe(b'\xc1.\xad\x0f\xb0\x08m'), chr(0b1100100) + '\x65' + chr(3859 - 3760) + chr(0b1010111 + 0o30) + '\144' + chr(0b1000101 + 0o40))('\165' + chr(0b1110100) + '\x66' + chr(45) + chr(0b111000))]
S2d3tWjjt3Wy = pVmed7U5DpuL(MUaMiwsTdGeu, nHdeL8JC2SEC)
dNEMNGEup3WB = pVmed7U5DpuL(l6V0bqbLx_b9, HHpQzG13Xmp7)
S7Hxucg7jlZk = {xafqLlk3kkUe(SXOLrMavuUCe(b'\xdc!\xaf\x1d\xa1\x0f'), '\144' + chr(0b1100101) + chr(5954 - 5855) + chr(10974 - 10863) + chr(9875 - 9775) + '\145')(chr(0b1110101) + chr(0b1110100) + chr(10285 - 10183) + chr(0b11011 + 0o22) + '\x38'): S2d3tWjjt3Wy, xafqLlk3kkUe(SXOLrMavuUCe(b'\xc1.\xad\x0f\xb0\x08m'), chr(6581 - 6481) + chr(7172 - 7071) + chr(0b1100011) + chr(0b1101111) + chr(0b1100100) + chr(0b1001011 + 0o32))(chr(0b1100110 + 0o17) + chr(0b100111 + 0o115) + '\146' + '\x2d' + '\070'): dNEMNGEup3WB}
return (_H7HhX1OiYNO, yXL7lYDLbCr_, S7Hxucg7jlZk, CZW_z9Phwam0)
|
tensorflow/tensor2tensor
|
tensor2tensor/v2/t2t.py
|
batch_fn
|
def batch_fn(dataset, training, shapes, target_names,
batch_size=32, eval_batch_size=32, bucket_batch_length=32,
bucket_max_length=256, bucket_min_length=8,
bucket_length_step=1.1, buckets=None):
"""Batching function."""
del target_names
# If bucketing is not specified, check if target shapes are variable.
cur_batch_size = batch_size if training else eval_batch_size
if buckets is None:
variable_target_shapes = False
target_shape = shapes[1]
for dim in target_shape:
if dim is None:
variable_target_shapes = True
tf.logging.info("Heuristically setting bucketing to %s based on shapes "
"of target tensors." % variable_target_shapes)
if variable_target_shapes:
batch_size_per_token = cur_batch_size * bucket_batch_length
scheme = data_reader.batching_scheme(batch_size_per_token,
bucket_max_length,
bucket_min_length,
bucket_length_step,
drop_long_sequences=training)
buckets = (scheme["boundaries"], scheme["batch_sizes"])
if buckets:
tf.logging.info("Bucketing with buckets %s." % str(buckets))
def example_length(_, target):
return tf.shape(target)[0]
boundaries, batch_sizes = buckets
dataset = dataset.apply(tf.data.experimental.bucket_by_sequence_length(
example_length, boundaries, batch_sizes))
else:
dataset = dataset.padded_batch(cur_batch_size, shapes)
return dataset
|
python
|
def batch_fn(dataset, training, shapes, target_names,
batch_size=32, eval_batch_size=32, bucket_batch_length=32,
bucket_max_length=256, bucket_min_length=8,
bucket_length_step=1.1, buckets=None):
"""Batching function."""
del target_names
# If bucketing is not specified, check if target shapes are variable.
cur_batch_size = batch_size if training else eval_batch_size
if buckets is None:
variable_target_shapes = False
target_shape = shapes[1]
for dim in target_shape:
if dim is None:
variable_target_shapes = True
tf.logging.info("Heuristically setting bucketing to %s based on shapes "
"of target tensors." % variable_target_shapes)
if variable_target_shapes:
batch_size_per_token = cur_batch_size * bucket_batch_length
scheme = data_reader.batching_scheme(batch_size_per_token,
bucket_max_length,
bucket_min_length,
bucket_length_step,
drop_long_sequences=training)
buckets = (scheme["boundaries"], scheme["batch_sizes"])
if buckets:
tf.logging.info("Bucketing with buckets %s." % str(buckets))
def example_length(_, target):
return tf.shape(target)[0]
boundaries, batch_sizes = buckets
dataset = dataset.apply(tf.data.experimental.bucket_by_sequence_length(
example_length, boundaries, batch_sizes))
else:
dataset = dataset.padded_batch(cur_batch_size, shapes)
return dataset
|
[
"def",
"batch_fn",
"(",
"dataset",
",",
"training",
",",
"shapes",
",",
"target_names",
",",
"batch_size",
"=",
"32",
",",
"eval_batch_size",
"=",
"32",
",",
"bucket_batch_length",
"=",
"32",
",",
"bucket_max_length",
"=",
"256",
",",
"bucket_min_length",
"=",
"8",
",",
"bucket_length_step",
"=",
"1.1",
",",
"buckets",
"=",
"None",
")",
":",
"del",
"target_names",
"# If bucketing is not specified, check if target shapes are variable.",
"cur_batch_size",
"=",
"batch_size",
"if",
"training",
"else",
"eval_batch_size",
"if",
"buckets",
"is",
"None",
":",
"variable_target_shapes",
"=",
"False",
"target_shape",
"=",
"shapes",
"[",
"1",
"]",
"for",
"dim",
"in",
"target_shape",
":",
"if",
"dim",
"is",
"None",
":",
"variable_target_shapes",
"=",
"True",
"tf",
".",
"logging",
".",
"info",
"(",
"\"Heuristically setting bucketing to %s based on shapes \"",
"\"of target tensors.\"",
"%",
"variable_target_shapes",
")",
"if",
"variable_target_shapes",
":",
"batch_size_per_token",
"=",
"cur_batch_size",
"*",
"bucket_batch_length",
"scheme",
"=",
"data_reader",
".",
"batching_scheme",
"(",
"batch_size_per_token",
",",
"bucket_max_length",
",",
"bucket_min_length",
",",
"bucket_length_step",
",",
"drop_long_sequences",
"=",
"training",
")",
"buckets",
"=",
"(",
"scheme",
"[",
"\"boundaries\"",
"]",
",",
"scheme",
"[",
"\"batch_sizes\"",
"]",
")",
"if",
"buckets",
":",
"tf",
".",
"logging",
".",
"info",
"(",
"\"Bucketing with buckets %s.\"",
"%",
"str",
"(",
"buckets",
")",
")",
"def",
"example_length",
"(",
"_",
",",
"target",
")",
":",
"return",
"tf",
".",
"shape",
"(",
"target",
")",
"[",
"0",
"]",
"boundaries",
",",
"batch_sizes",
"=",
"buckets",
"dataset",
"=",
"dataset",
".",
"apply",
"(",
"tf",
".",
"data",
".",
"experimental",
".",
"bucket_by_sequence_length",
"(",
"example_length",
",",
"boundaries",
",",
"batch_sizes",
")",
")",
"else",
":",
"dataset",
"=",
"dataset",
".",
"padded_batch",
"(",
"cur_batch_size",
",",
"shapes",
")",
"return",
"dataset"
] |
Batching function.
|
[
"Batching",
"function",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/v2/t2t.py#L140-L174
|
train
|
Batching function.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAA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meticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(48) + chr(0b1011001 + 0o26) + chr(50) + '\x34' + chr(1440 - 1390), 0b1000), ehT0Px3KOsy9(chr(0b100011 + 0o15) + chr(11676 - 11565) + chr(0b101110 + 0o3) + chr(52) + chr(0b11110 + 0o22), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b10011 + 0o44), ord("\x08")), ehT0Px3KOsy9(chr(1112 - 1064) + chr(0b1100110 + 0o11) + '\061' + chr(54) + '\x30', ord("\x08")), ehT0Px3KOsy9(chr(0b101101 + 0o3) + chr(0b1101111) + chr(49) + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(0b100100 + 0o14) + '\x6f' + '\063' + '\067' + '\x36', 46652 - 46644), ehT0Px3KOsy9(chr(1906 - 1858) + chr(11857 - 11746) + chr(0b1011 + 0o47) + '\060' + '\x30', 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(51) + chr(0b110100) + chr(52), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(50) + chr(0b10100 + 0o35) + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(0b100100 + 0o14) + chr(111) + '\062' + chr(0b110010) + chr(1746 - 1693), 0b1000), ehT0Px3KOsy9(chr(1887 - 1839) + '\157' + chr(0b110010) + chr(0b110111) + chr(1983 - 1931), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b11000 + 0o127) + chr(0b110011) + chr(0b110101) + '\062', 62885 - 62877), ehT0Px3KOsy9('\x30' + chr(12068 - 11957) + '\x32' + chr(0b0 + 0o61) + chr(1639 - 1591), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(1591 - 1540) + chr(0b110101) + '\x31', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1100110 + 0o11) + '\x31' + chr(0b11101 + 0o24) + chr(380 - 332), ord("\x08")), ehT0Px3KOsy9(chr(1135 - 1087) + chr(0b100111 + 0o110) + chr(0b101011 + 0o7) + chr(0b1000 + 0o54) + chr(0b110111), 34106 - 34098), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(49) + '\x33' + chr(1851 - 1801), 63673 - 63665), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(55) + chr(882 - 833), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b111010 + 0o65) + chr(1172 - 1118) + chr(0b1001 + 0o50), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\062' + '\063', 58512 - 58504), ehT0Px3KOsy9('\x30' + '\157' + chr(50) + chr(0b1 + 0o61) + '\x31', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110 + 0o54) + '\060' + chr(48), 8), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110001) + '\x32' + chr(0b101011 + 0o13), 8344 - 8336), ehT0Px3KOsy9(chr(2241 - 2193) + '\157' + chr(50) + '\060', 26860 - 26852), ehT0Px3KOsy9(chr(0b10100 + 0o34) + chr(7715 - 7604) + chr(0b110 + 0o53) + chr(0b11011 + 0o31) + chr(0b110 + 0o56), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(2036 - 1986) + chr(733 - 683) + chr(0b100000 + 0o21), 8), ehT0Px3KOsy9('\x30' + chr(0b1101110 + 0o1) + chr(0b110001) + chr(1484 - 1433) + chr(0b10011 + 0o41), 0o10), ehT0Px3KOsy9(chr(0b1011 + 0o45) + chr(0b1011001 + 0o26) + chr(0b110010) + chr(0b110111) + chr(0b110001), 62319 - 62311), ehT0Px3KOsy9('\x30' + chr(111) + '\x37', 8), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b10001 + 0o46) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9('\060' + chr(8165 - 8054) + '\x31' + chr(52) + chr(0b1010 + 0o52), 8), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110001) + chr(0b110011 + 0o0) + chr(0b11100 + 0o25), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1011001 + 0o26) + chr(178 - 127) + chr(0b110101) + chr(0b110011), 53295 - 53287), ehT0Px3KOsy9(chr(0b110000) + chr(135 - 24) + chr(0b1110 + 0o43) + '\x36' + '\065', 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(50) + chr(0b11110 + 0o24) + '\065', 8), ehT0Px3KOsy9(chr(48) + chr(0b110000 + 0o77) + '\x31' + chr(53) + chr(0b1010 + 0o54), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b10111 + 0o130) + '\061' + chr(52) + chr(416 - 364), 8), ehT0Px3KOsy9(chr(1044 - 996) + chr(0b10011 + 0o134) + '\063' + '\x34' + '\066', 0o10), ehT0Px3KOsy9('\060' + '\157' + '\x32' + chr(0b110110) + chr(0b110010), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b1100 + 0o53) + chr(53), ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9(chr(2003 - 1955) + chr(2428 - 2317) + '\x35' + chr(1538 - 1490), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x8c'), '\144' + '\145' + chr(3992 - 3893) + chr(111) + chr(0b111111 + 0o45) + '\x65')('\x75' + chr(0b1110100) + chr(0b1100110) + chr(0b101101) + chr(56)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def whnIloAitBZa(xQt6gV9VfTO3, H15mhcYcioqz, OVHEymXlQYjG, xEjzlji2f7bf, ix9dZyeAmUxY=ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b10010 + 0o42) + chr(0b1100 + 0o44), 0o10), aCHA9MHY0KlX=ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(52) + chr(48), 8), LfwA_GCbE0K1=ehT0Px3KOsy9('\060' + chr(900 - 789) + '\x34' + chr(48), 8), _PixDnO6rWTF=ehT0Px3KOsy9(chr(161 - 113) + '\x6f' + chr(1232 - 1180) + chr(565 - 517) + '\x30', 0b1000), LgU9ex2kPZSc=ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b1111 + 0o42) + '\x30', 8), QpIR6akaVouN=1.1, rMH7GU_csUsK=None):
del xEjzlji2f7bf
AAOD69wsrfa1 = ix9dZyeAmUxY if H15mhcYcioqz else aCHA9MHY0KlX
if rMH7GU_csUsK is None:
Cl0L5qxNwXmt = ehT0Px3KOsy9(chr(48) + '\157' + '\060', ord("\x08"))
nk7Ena0OgGVQ = OVHEymXlQYjG[ehT0Px3KOsy9('\060' + '\157' + chr(49), 0b1000)]
for Nl_JhL3qUwSN in nk7Ena0OgGVQ:
if Nl_JhL3qUwSN is None:
Cl0L5qxNwXmt = ehT0Px3KOsy9('\060' + chr(3510 - 3399) + '\061', 8)
xafqLlk3kkUe(IDJ2eXGCBCDu.logging, xafqLlk3kkUe(SXOLrMavuUCe(b'\xf1WO\x08}\x9d\xe7\xd3\xe0\xf9\xe6\x81'), chr(0b111010 + 0o52) + chr(0b1100101) + chr(0b100000 + 0o103) + chr(0b1101111) + chr(0b1100100) + chr(0b11 + 0o142))(chr(4957 - 4840) + chr(0b101101 + 0o107) + chr(0b1100110) + chr(0b101101) + '\070'))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xea\x05r\x02a\x8d\xf4\x8d\xe9\xf4\xd0\x86\xf1\xc9;\xc2.MX}\xf6\xa04e\x07\xfa9\xcdnQ\x03y\x9f\x1a\xb5K\x17\xc6\xd0\\\xd1\x05cPg\x90\xa0\x97\xe2\xf4\xcc\x8f\xfb\xc9\'\xc1zMPa\xf6\xe5"0\x10\xf42\xcahM\x17w'), chr(8545 - 8445) + chr(0b1100101) + '\143' + chr(0b1101111) + '\144' + '\x65')(chr(0b1110101) + '\x74' + chr(0b1100110) + chr(1361 - 1316) + chr(0b10101 + 0o43)) % Cl0L5qxNwXmt)
if Cl0L5qxNwXmt:
I_trv9ZzYUX6 = AAOD69wsrfa1 * LfwA_GCbE0K1
nh0h0JN0W0q6 = oPPijFrlo4k2.batching_scheme(I_trv9ZzYUX6, _PixDnO6rWTF, LgU9ex2kPZSc, QpIR6akaVouN, drop_long_sequences=H15mhcYcioqz)
rMH7GU_csUsK = (nh0h0JN0W0q6[xafqLlk3kkUe(SXOLrMavuUCe(b'\xc0\x0fr\x1el\x9f\xf2\x8d\xef\xe6'), chr(100) + '\145' + '\x63' + '\157' + '\x64' + chr(101))(chr(0b1000011 + 0o62) + chr(116) + '\146' + chr(0b101101) + chr(0b100000 + 0o30))], nh0h0JN0W0q6[xafqLlk3kkUe(SXOLrMavuUCe(b'\xc0\x01s\x13`\xa1\xf3\x8d\xf0\xf0\xcf'), chr(100) + chr(0b1100101) + chr(979 - 880) + chr(0b1101111) + '\144' + chr(0b1000010 + 0o43))(chr(0b1110000 + 0o5) + '\x74' + chr(102) + chr(0b101101) + '\070')])
if rMH7GU_csUsK:
xafqLlk3kkUe(IDJ2eXGCBCDu.logging, xafqLlk3kkUe(SXOLrMavuUCe(b'\xf1WO\x08}\x9d\xe7\xd3\xe0\xf9\xe6\x81'), '\144' + chr(4806 - 4705) + chr(0b1100011) + chr(0b1101111) + chr(0b1001010 + 0o32) + chr(0b0 + 0o145))('\x75' + chr(1867 - 1751) + chr(102) + '\055' + '\070'))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xe0\x15d\x1bm\x8a\xe9\x8a\xed\xb5\xcb\x83\xfc\x81h\xc5/ZZv\xe5\xf3v5\x17\xbf'), chr(0b101010 + 0o72) + '\x65' + chr(1755 - 1656) + '\x6f' + chr(0b1100100) + '\x65')(chr(12779 - 12662) + '\x74' + chr(0b1100110) + chr(855 - 810) + chr(2381 - 2325)) % M8_cKLkHVB2V(rMH7GU_csUsK))
def fEAdJgn5yxLX(VNGQdHSFPrso, GR1581dR5rDS):
return xafqLlk3kkUe(IDJ2eXGCBCDu, xafqLlk3kkUe(SXOLrMavuUCe(b'\xcc\x01r)n\xb2\xe7\x88\xde\xe5\xdf\x88'), '\x64' + '\x65' + chr(99) + chr(10825 - 10714) + chr(0b1100100) + chr(0b1100101))('\165' + chr(0b1000110 + 0o56) + chr(102) + chr(1615 - 1570) + chr(384 - 328)))(GR1581dR5rDS)[ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b0 + 0o60), 8)]
(n7rrZRZYkBNq, vUD9kCH9I6mb) = rMH7GU_csUsK
xQt6gV9VfTO3 = xQt6gV9VfTO3.apply(IDJ2eXGCBCDu.data.experimental.bucket_by_sequence_length(fEAdJgn5yxLX, n7rrZRZYkBNq, vUD9kCH9I6mb))
else:
xQt6gV9VfTO3 = xQt6gV9VfTO3.padded_batch(AAOD69wsrfa1, OVHEymXlQYjG)
return xQt6gV9VfTO3
|
tensorflow/tensor2tensor
|
tensor2tensor/v2/t2t.py
|
shuffle_and_batch_data
|
def shuffle_and_batch_data(dataset, target_names, features_info, training):
"""Shuffle and batch the given dataset."""
def append_targets(example):
"""Append targets to the example dictionary. Needed for Keras."""
if len(target_names) == 1:
return (example, example[target_names[0]])
targets = {}
for name in target_names:
targets[name] = example[name]
return (example, targets)
dataset = dataset.map(append_targets)
if training:
dataset = dataset.repeat()
shapes = {k: features_info[k].shape for k in features_info}
shapes = (shapes, shapes[target_names[0]])
dataset = dataset.shuffle(128)
dataset = preprocess_fn(dataset, training)
dataset = batch_fn(dataset, training, shapes, target_names)
return dataset.prefetch(8)
|
python
|
def shuffle_and_batch_data(dataset, target_names, features_info, training):
"""Shuffle and batch the given dataset."""
def append_targets(example):
"""Append targets to the example dictionary. Needed for Keras."""
if len(target_names) == 1:
return (example, example[target_names[0]])
targets = {}
for name in target_names:
targets[name] = example[name]
return (example, targets)
dataset = dataset.map(append_targets)
if training:
dataset = dataset.repeat()
shapes = {k: features_info[k].shape for k in features_info}
shapes = (shapes, shapes[target_names[0]])
dataset = dataset.shuffle(128)
dataset = preprocess_fn(dataset, training)
dataset = batch_fn(dataset, training, shapes, target_names)
return dataset.prefetch(8)
|
[
"def",
"shuffle_and_batch_data",
"(",
"dataset",
",",
"target_names",
",",
"features_info",
",",
"training",
")",
":",
"def",
"append_targets",
"(",
"example",
")",
":",
"\"\"\"Append targets to the example dictionary. Needed for Keras.\"\"\"",
"if",
"len",
"(",
"target_names",
")",
"==",
"1",
":",
"return",
"(",
"example",
",",
"example",
"[",
"target_names",
"[",
"0",
"]",
"]",
")",
"targets",
"=",
"{",
"}",
"for",
"name",
"in",
"target_names",
":",
"targets",
"[",
"name",
"]",
"=",
"example",
"[",
"name",
"]",
"return",
"(",
"example",
",",
"targets",
")",
"dataset",
"=",
"dataset",
".",
"map",
"(",
"append_targets",
")",
"if",
"training",
":",
"dataset",
"=",
"dataset",
".",
"repeat",
"(",
")",
"shapes",
"=",
"{",
"k",
":",
"features_info",
"[",
"k",
"]",
".",
"shape",
"for",
"k",
"in",
"features_info",
"}",
"shapes",
"=",
"(",
"shapes",
",",
"shapes",
"[",
"target_names",
"[",
"0",
"]",
"]",
")",
"dataset",
"=",
"dataset",
".",
"shuffle",
"(",
"128",
")",
"dataset",
"=",
"preprocess_fn",
"(",
"dataset",
",",
"training",
")",
"dataset",
"=",
"batch_fn",
"(",
"dataset",
",",
"training",
",",
"shapes",
",",
"target_names",
")",
"return",
"dataset",
".",
"prefetch",
"(",
"8",
")"
] |
Shuffle and batch the given dataset.
|
[
"Shuffle",
"and",
"batch",
"the",
"given",
"dataset",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/v2/t2t.py#L177-L195
|
train
|
Shuffle and batch the given dataset.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,o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IV0tyJQ,f9CsFWzvg0Vq,YlkZvXL8qwsX,MCqssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(48) + '\x6f' + chr(50) + '\066' + chr(0b110011 + 0o2), 61404 - 61396), ehT0Px3KOsy9(chr(0b101001 + 0o7) + '\157' + chr(0b1010 + 0o47) + chr(0b1000 + 0o57) + chr(814 - 765), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(569 - 518) + chr(0b11001 + 0o31) + chr(0b10110 + 0o40), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b10 + 0o57) + chr(52) + chr(52), 30032 - 30024), ehT0Px3KOsy9('\x30' + chr(9470 - 9359) + chr(49) + chr(0b11100 + 0o25) + chr(49), 1086 - 1078), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(53) + chr(0b10111 + 0o35), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b101001 + 0o13) + chr(1398 - 1343), 0o10), ehT0Px3KOsy9(chr(0b1010 + 0o46) + chr(0b1110 + 0o141) + '\x31' + chr(49) + '\x32', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b101111 + 0o4) + chr(0b110001), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\062' + chr(0b110000) + '\x36', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1010 + 0o145) + chr(0b10 + 0o63) + '\067', 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(1586 - 1536) + chr(2021 - 1968) + '\062', 0b1000), ehT0Px3KOsy9(chr(0b1000 + 0o50) + chr(0b1101111) + '\x31' + '\x33' + chr(376 - 328), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110011) + chr(2252 - 2199) + '\x35', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\061' + '\064' + '\063', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x33' + '\x37' + chr(54), 794 - 786), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110001) + '\065' + chr(0b110 + 0o54), 49500 - 49492), ehT0Px3KOsy9('\x30' + chr(10790 - 10679) + chr(0b110110) + chr(1780 - 1727), 0b1000), ehT0Px3KOsy9(chr(0b101110 + 0o2) + chr(111) + chr(49) + chr(65 - 16) + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(49) + chr(0b1111 + 0o41) + chr(51), 12192 - 12184), ehT0Px3KOsy9('\060' + '\x6f' + '\063' + '\064' + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(622 - 511) + chr(0b110010) + '\063' + '\x32', 0o10), ehT0Px3KOsy9(chr(0b1001 + 0o47) + chr(3491 - 3380) + chr(0b101001 + 0o11) + chr(836 - 788) + chr(0b110 + 0o57), ord("\x08")), ehT0Px3KOsy9(chr(0b11000 + 0o30) + '\157' + chr(0b110001) + '\x34' + chr(0b101001 + 0o14), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(871 - 820) + '\062' + chr(55), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(1651 - 1598) + '\067', 8), ehT0Px3KOsy9(chr(0b11110 + 0o22) + chr(0b1101111) + chr(505 - 455) + chr(0b11101 + 0o23) + chr(0b0 + 0o67), ord("\x08")), ehT0Px3KOsy9(chr(0b100100 + 0o14) + chr(1380 - 1269) + chr(0b110110) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(0b1110 + 0o42) + chr(0b1010010 + 0o35) + chr(0b100100 + 0o15) + '\x30' + chr(0b110010), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b10110 + 0o131) + chr(262 - 209) + '\067', 8), ehT0Px3KOsy9('\060' + chr(7349 - 7238) + chr(992 - 942) + chr(49) + chr(49), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(893 - 844) + chr(48) + '\060', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110001) + chr(0b110100) + '\x34', 8), ehT0Px3KOsy9('\x30' + chr(0b101010 + 0o105) + '\x32' + chr(1886 - 1836) + chr(2619 - 2565), 0o10), ehT0Px3KOsy9(chr(48) + chr(11892 - 11781) + chr(0b110010) + chr(0b10001 + 0o41) + chr(49), 0o10), ehT0Px3KOsy9(chr(48) + chr(6311 - 6200) + chr(49) + chr(50) + chr(0b110111), 0o10), ehT0Px3KOsy9(chr(0b10000 + 0o40) + chr(111) + chr(49) + '\x33' + '\067', 0o10), ehT0Px3KOsy9('\060' + chr(111) + '\062' + chr(0b101001 + 0o15) + chr(1432 - 1377), 34077 - 34069), ehT0Px3KOsy9(chr(815 - 767) + chr(0b111011 + 0o64) + chr(49) + chr(0b101011 + 0o12), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(1641 - 1592) + chr(0b110101) + chr(0b11100 + 0o33), 29135 - 29127)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + chr(0b1010000 + 0o37) + chr(2736 - 2683) + chr(0b110000), 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x9b'), '\x64' + chr(3168 - 3067) + '\143' + '\157' + '\x64' + '\x65')(chr(4464 - 4347) + chr(116) + '\146' + '\055' + '\x38') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def lcM9yAEWxzEh(xQt6gV9VfTO3, xEjzlji2f7bf, VmNccqBk7Msl, H15mhcYcioqz):
def RUyVFghp0aLq(kP4qaKv0ZkGv):
if c2A0yzQpDQB3(xEjzlji2f7bf) == ehT0Px3KOsy9('\x30' + chr(111) + chr(0b1010 + 0o47), 0b1000):
return (kP4qaKv0ZkGv, kP4qaKv0ZkGv[xEjzlji2f7bf[ehT0Px3KOsy9(chr(48) + chr(9726 - 9615) + chr(0b110000), ord("\x08"))]])
xIEmRseySp3z = {}
for AIvJRzLdDfgF in xEjzlji2f7bf:
xIEmRseySp3z[AIvJRzLdDfgF] = kP4qaKv0ZkGv[AIvJRzLdDfgF]
return (kP4qaKv0ZkGv, xIEmRseySp3z)
xQt6gV9VfTO3 = xQt6gV9VfTO3.map(RUyVFghp0aLq)
if H15mhcYcioqz:
xQt6gV9VfTO3 = xQt6gV9VfTO3.repeat()
OVHEymXlQYjG = {OolUPRJhRaJd: VmNccqBk7Msl[OolUPRJhRaJd].nauYfLglTpcb for OolUPRJhRaJd in VmNccqBk7Msl}
OVHEymXlQYjG = (OVHEymXlQYjG, OVHEymXlQYjG[xEjzlji2f7bf[ehT0Px3KOsy9('\060' + chr(111) + chr(828 - 780), 8)]])
xQt6gV9VfTO3 = xQt6gV9VfTO3.shuffle(ehT0Px3KOsy9('\060' + '\x6f' + chr(1934 - 1884) + chr(0b110000) + chr(0b11101 + 0o23), 0o10))
xQt6gV9VfTO3 = x7qYqGTMLFkJ(xQt6gV9VfTO3, H15mhcYcioqz)
xQt6gV9VfTO3 = whnIloAitBZa(xQt6gV9VfTO3, H15mhcYcioqz, OVHEymXlQYjG, xEjzlji2f7bf)
return xafqLlk3kkUe(xQt6gV9VfTO3, xafqLlk3kkUe(SXOLrMavuUCe(b'\xc5\x0b\xb3\x02,XD"'), chr(0b100101 + 0o77) + chr(2331 - 2230) + chr(5186 - 5087) + '\157' + '\x64' + '\x65')(chr(117) + chr(116) + chr(3648 - 3546) + chr(0b100001 + 0o14) + '\070'))(ehT0Px3KOsy9(chr(0b110000) + chr(8861 - 8750) + chr(0b110001) + '\x30', 0o10))
|
tensorflow/tensor2tensor
|
tensor2tensor/v2/t2t.py
|
optimize_fn
|
def optimize_fn(model,
optimizer=None,
learning_rate_schedule=None,
loss=None,
metrics=None):
"""Compile the model in Keras."""
learning_rate_schedule = learning_rate_schedule or T2TLearningRateSchedule()
if optimizer:
optimizer = optimizer(learning_rate=learning_rate_schedule)
else: # We use Adam by default with adjusted parameters.
optimizer = tf.keras.optimizers.Adam(
learning_rate=learning_rate_schedule,
beta_1=0.9, beta_2=0.997, epsilon=1e-9)
metrics = metrics or [tf.keras.metrics.sparse_categorical_accuracy]
def xent_loss(y, x):
return tf.keras.backend.sparse_categorical_crossentropy(
y, x, from_logits=True)
loss = loss or xent_loss
return model.compile(optimizer=optimizer,
loss=loss,
metrics=metrics)
|
python
|
def optimize_fn(model,
optimizer=None,
learning_rate_schedule=None,
loss=None,
metrics=None):
"""Compile the model in Keras."""
learning_rate_schedule = learning_rate_schedule or T2TLearningRateSchedule()
if optimizer:
optimizer = optimizer(learning_rate=learning_rate_schedule)
else: # We use Adam by default with adjusted parameters.
optimizer = tf.keras.optimizers.Adam(
learning_rate=learning_rate_schedule,
beta_1=0.9, beta_2=0.997, epsilon=1e-9)
metrics = metrics or [tf.keras.metrics.sparse_categorical_accuracy]
def xent_loss(y, x):
return tf.keras.backend.sparse_categorical_crossentropy(
y, x, from_logits=True)
loss = loss or xent_loss
return model.compile(optimizer=optimizer,
loss=loss,
metrics=metrics)
|
[
"def",
"optimize_fn",
"(",
"model",
",",
"optimizer",
"=",
"None",
",",
"learning_rate_schedule",
"=",
"None",
",",
"loss",
"=",
"None",
",",
"metrics",
"=",
"None",
")",
":",
"learning_rate_schedule",
"=",
"learning_rate_schedule",
"or",
"T2TLearningRateSchedule",
"(",
")",
"if",
"optimizer",
":",
"optimizer",
"=",
"optimizer",
"(",
"learning_rate",
"=",
"learning_rate_schedule",
")",
"else",
":",
"# We use Adam by default with adjusted parameters.",
"optimizer",
"=",
"tf",
".",
"keras",
".",
"optimizers",
".",
"Adam",
"(",
"learning_rate",
"=",
"learning_rate_schedule",
",",
"beta_1",
"=",
"0.9",
",",
"beta_2",
"=",
"0.997",
",",
"epsilon",
"=",
"1e-9",
")",
"metrics",
"=",
"metrics",
"or",
"[",
"tf",
".",
"keras",
".",
"metrics",
".",
"sparse_categorical_accuracy",
"]",
"def",
"xent_loss",
"(",
"y",
",",
"x",
")",
":",
"return",
"tf",
".",
"keras",
".",
"backend",
".",
"sparse_categorical_crossentropy",
"(",
"y",
",",
"x",
",",
"from_logits",
"=",
"True",
")",
"loss",
"=",
"loss",
"or",
"xent_loss",
"return",
"model",
".",
"compile",
"(",
"optimizer",
"=",
"optimizer",
",",
"loss",
"=",
"loss",
",",
"metrics",
"=",
"metrics",
")"
] |
Compile the model in Keras.
|
[
"Compile",
"the",
"model",
"in",
"Keras",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/v2/t2t.py#L233-L253
|
train
|
Compile the model in Keras.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWS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imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(2393 - 2342) + chr(48) + chr(2164 - 2113), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(50) + '\061' + chr(0b100101 + 0o17), 0b1000), ehT0Px3KOsy9(chr(1090 - 1042) + chr(111) + chr(0b110010) + chr(0b1001 + 0o52) + '\067', ord("\x08")), ehT0Px3KOsy9(chr(0b1100 + 0o44) + '\x6f' + chr(50) + chr(54) + chr(0b101 + 0o55), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\061' + '\067' + '\065', 0b1000), ehT0Px3KOsy9(chr(0b100000 + 0o20) + chr(4767 - 4656) + '\x33' + chr(0b110010) + '\x37', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(2315 - 2264) + '\066' + '\066', 0o10), ehT0Px3KOsy9(chr(1329 - 1281) + '\x6f' + '\x32' + chr(0b10111 + 0o36) + chr(0b110001), 0o10), ehT0Px3KOsy9(chr(0b101000 + 0o10) + chr(111) + '\061' + chr(0b110101), ord("\x08")), ehT0Px3KOsy9(chr(0b1100 + 0o44) + chr(5117 - 5006) + '\062' + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(51) + chr(1423 - 1370) + chr(0b1011 + 0o52), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1 + 0o156) + chr(49) + chr(0b110011) + chr(296 - 247), 0b1000), ehT0Px3KOsy9(chr(1432 - 1384) + '\157' + chr(889 - 838) + chr(0b100000 + 0o21) + chr(50), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + '\061' + chr(0b1110 + 0o42) + chr(0b110010), 28432 - 28424), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(51) + '\x35' + '\x31', ord("\x08")), ehT0Px3KOsy9(chr(306 - 258) + chr(4642 - 4531) + chr(53) + chr(0b1010 + 0o47), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1010000 + 0o37) + chr(51) + '\066', 0b1000), ehT0Px3KOsy9(chr(0b10 + 0o56) + '\157' + chr(0b110011) + chr(0b110011), ord("\x08")), ehT0Px3KOsy9(chr(1727 - 1679) + '\157' + chr(50) + chr(0b110110), 60942 - 60934), ehT0Px3KOsy9(chr(48) + chr(0b111111 + 0o60) + '\063' + '\062' + '\x36', 0b1000), ehT0Px3KOsy9('\x30' + chr(6366 - 6255) + chr(0b110011) + chr(0b110010) + chr(0b110001), ord("\x08")), ehT0Px3KOsy9(chr(1982 - 1934) + '\x6f' + chr(1281 - 1232) + chr(0b110100) + chr(0b100111 + 0o13), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + '\063' + chr(810 - 762) + chr(2034 - 1982), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(325 - 276) + '\x30' + '\x32', 8), ehT0Px3KOsy9(chr(214 - 166) + chr(111) + '\063' + '\x32' + '\x37', 8), ehT0Px3KOsy9(chr(177 - 129) + chr(0b1101111) + '\x33' + '\063' + chr(1059 - 1009), 0b1000), ehT0Px3KOsy9(chr(628 - 580) + chr(0b1101111) + '\063' + chr(1493 - 1443) + chr(2309 - 2259), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(54) + chr(2170 - 2120), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b10011 + 0o43), 9973 - 9965), ehT0Px3KOsy9(chr(1311 - 1263) + '\157' + '\063' + chr(48) + '\x33', 8), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x37' + chr(0b110011), 54942 - 54934), ehT0Px3KOsy9(chr(0b110000) + chr(8706 - 8595) + chr(0b110010) + chr(499 - 451) + '\064', 0o10), ehT0Px3KOsy9(chr(0b110000 + 0o0) + chr(0b1101111) + '\063' + chr(0b1010 + 0o50) + '\x35', 58521 - 58513), ehT0Px3KOsy9('\060' + chr(0b110011 + 0o74) + chr(0b110100 + 0o1) + '\x31', 8), ehT0Px3KOsy9(chr(535 - 487) + chr(0b110111 + 0o70) + chr(1476 - 1426) + chr(2285 - 2235) + '\x35', 37688 - 37680), ehT0Px3KOsy9(chr(0b101011 + 0o5) + chr(0b1100000 + 0o17) + '\x31' + chr(0b110001) + chr(0b110000), 50588 - 50580), ehT0Px3KOsy9(chr(1957 - 1909) + '\x6f' + chr(0b110001 + 0o0) + chr(0b10010 + 0o45) + chr(51), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(1105 - 1054) + '\x35' + chr(0b101111 + 0o1), 3110 - 3102), ehT0Px3KOsy9(chr(0b101011 + 0o5) + chr(111) + '\061' + chr(0b110011) + chr(0b110101), 0o10), ehT0Px3KOsy9(chr(1715 - 1667) + '\x6f' + chr(0b110010) + chr(0b101110 + 0o4) + chr(217 - 164), 8)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + '\157' + chr(53) + chr(48), ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xed'), '\x64' + chr(0b100110 + 0o77) + chr(0b11111 + 0o104) + chr(111) + chr(2703 - 2603) + '\x65')('\165' + chr(5187 - 5071) + chr(0b1010101 + 0o21) + chr(1715 - 1670) + '\070') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def ou_KfhddYaVQ(FK0vqzZ5gPN6, XdKNcYRObPK3=None, Lz_s7neUzM5V=None, YpO0BcZ6fMsf=None, yYegMqDoSfs5=None):
Lz_s7neUzM5V = Lz_s7neUzM5V or WhP5REAucYfg()
if XdKNcYRObPK3:
XdKNcYRObPK3 = XdKNcYRObPK3(learning_rate=Lz_s7neUzM5V)
else:
XdKNcYRObPK3 = IDJ2eXGCBCDu.keras.optimizers.Adam(learning_rate=Lz_s7neUzM5V, beta_1=0.9, beta_2=0.997, epsilon=1e-09)
yYegMqDoSfs5 = yYegMqDoSfs5 or [IDJ2eXGCBCDu.keras.metrics.sparse_categorical_accuracy]
def oZKyB3GpH_4c(SqiSOtYOqOJH, OeWW0F1dBPRQ):
return xafqLlk3kkUe(IDJ2eXGCBCDu.keras.backend, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb0\xfc\xfe\xc0\x0e\xb2\xa9\xcald\x88>\xa50\x80J\x7fwI\xb5\xa3\r\xb71\xb2\xb4\xa6@i\xb3B'), '\144' + chr(2428 - 2327) + chr(0b1001011 + 0o30) + chr(0b1101111) + '\144' + chr(101))(chr(117) + chr(116) + chr(102) + chr(0b11100 + 0o21) + chr(56)))(SqiSOtYOqOJH, OeWW0F1dBPRQ, from_logits=ehT0Px3KOsy9('\x30' + '\157' + chr(692 - 643), 27416 - 27408))
YpO0BcZ6fMsf = YpO0BcZ6fMsf or oZKyB3GpH_4c
return xafqLlk3kkUe(FK0vqzZ5gPN6, xafqLlk3kkUe(SXOLrMavuUCe(b'\xa0\xe3\xf2\xc2\x14\xbb\x93'), '\144' + chr(101) + chr(99) + chr(0b11001 + 0o126) + '\144' + '\145')('\x75' + chr(12976 - 12860) + chr(0b1100110 + 0o0) + chr(0b101101) + chr(56)))(optimizer=XdKNcYRObPK3, loss=YpO0BcZ6fMsf, metrics=yYegMqDoSfs5)
|
tensorflow/tensor2tensor
|
tensor2tensor/v2/t2t.py
|
train_fn
|
def train_fn(data_dir=None, output_dir=None,
model_class=gin.REQUIRED, dataset=gin.REQUIRED,
input_names=None, target_names=None,
train_steps=1000, eval_steps=1, eval_frequency=100):
"""Train the given model on the given dataset.
Args:
data_dir: Directory where the data is located.
output_dir: Directory where to put the logs and checkpoints.
model_class: The model class to train.
dataset: The name of the dataset to train on.
input_names: List of strings with the names of the features on input.
target_names: List of strings with the names of the target features.
train_steps: for how many steps to train.
eval_steps: for how many steps to do evaluation.
eval_frequency: how often (every this many steps) to run evaluation.
"""
train_data, eval_data, features_info, keys = train_and_eval_dataset(
dataset, data_dir)
if input_names is None:
input_names = keys[0]
if target_names is None:
target_names = keys[1]
# TODO(lukaszkaiser): The use of distribution strategy below fails like this:
# .../keras/models.py", line 93, in _clone_functional_model
# for layer in model._input_layers:
# AttributeError: 'BasicFcRelu' object has no attribute '_input_layers'
# strategy = tf.distribute.MirroredStrategy()
# with strategy.scope():
model = model_class(features_info=features_info,
input_names=input_names, target_names=target_names)
optimize_fn(model)
train_batches = shuffle_and_batch_data(
train_data, target_names, features_info, training=True)
eval_batches = shuffle_and_batch_data(
eval_data, target_names, features_info, training=False)
# Need to run one training step just to get optimizer variables to load.
model.fit(train_batches, epochs=1, steps_per_epoch=1)
# Training loop.
callbacks = []
callbacks.append(tf.keras.callbacks.History())
callbacks.append(tf.keras.callbacks.BaseLogger())
last_epoch = 0
if output_dir is not None:
callbacks.append(tf.keras.callbacks.TensorBoard(log_dir=output_dir))
output_format = os.path.join(output_dir, "model-{epoch:05d}")
callbacks.append(tf.keras.callbacks.ModelCheckpoint(
filepath=output_format, save_weights_only=True))
checkpoints = tf.gfile.Glob(os.path.join(output_dir, "model-*"))
# Take basenames and strip the "model-" prefix.
checkpoints = [os.path.basename(ckpt)[6:] for ckpt in checkpoints]
# Get epoch numbers from the filenames and sort to obtain last epoch.
epoch_numbers = [int(ckpt[:5]) for ckpt in checkpoints if len(ckpt) > 4]
epoch_numbers.sort()
if epoch_numbers:
last_epoch = epoch_numbers[-1]
saved_path = os.path.join(output_dir, "model-%05d" % last_epoch)
model.load_weights(saved_path)
model.fit(train_batches,
epochs=train_steps // eval_frequency,
steps_per_epoch=eval_frequency,
validation_data=eval_batches,
validation_steps=eval_steps,
initial_epoch=last_epoch,
callbacks=callbacks)
|
python
|
def train_fn(data_dir=None, output_dir=None,
model_class=gin.REQUIRED, dataset=gin.REQUIRED,
input_names=None, target_names=None,
train_steps=1000, eval_steps=1, eval_frequency=100):
"""Train the given model on the given dataset.
Args:
data_dir: Directory where the data is located.
output_dir: Directory where to put the logs and checkpoints.
model_class: The model class to train.
dataset: The name of the dataset to train on.
input_names: List of strings with the names of the features on input.
target_names: List of strings with the names of the target features.
train_steps: for how many steps to train.
eval_steps: for how many steps to do evaluation.
eval_frequency: how often (every this many steps) to run evaluation.
"""
train_data, eval_data, features_info, keys = train_and_eval_dataset(
dataset, data_dir)
if input_names is None:
input_names = keys[0]
if target_names is None:
target_names = keys[1]
# TODO(lukaszkaiser): The use of distribution strategy below fails like this:
# .../keras/models.py", line 93, in _clone_functional_model
# for layer in model._input_layers:
# AttributeError: 'BasicFcRelu' object has no attribute '_input_layers'
# strategy = tf.distribute.MirroredStrategy()
# with strategy.scope():
model = model_class(features_info=features_info,
input_names=input_names, target_names=target_names)
optimize_fn(model)
train_batches = shuffle_and_batch_data(
train_data, target_names, features_info, training=True)
eval_batches = shuffle_and_batch_data(
eval_data, target_names, features_info, training=False)
# Need to run one training step just to get optimizer variables to load.
model.fit(train_batches, epochs=1, steps_per_epoch=1)
# Training loop.
callbacks = []
callbacks.append(tf.keras.callbacks.History())
callbacks.append(tf.keras.callbacks.BaseLogger())
last_epoch = 0
if output_dir is not None:
callbacks.append(tf.keras.callbacks.TensorBoard(log_dir=output_dir))
output_format = os.path.join(output_dir, "model-{epoch:05d}")
callbacks.append(tf.keras.callbacks.ModelCheckpoint(
filepath=output_format, save_weights_only=True))
checkpoints = tf.gfile.Glob(os.path.join(output_dir, "model-*"))
# Take basenames and strip the "model-" prefix.
checkpoints = [os.path.basename(ckpt)[6:] for ckpt in checkpoints]
# Get epoch numbers from the filenames and sort to obtain last epoch.
epoch_numbers = [int(ckpt[:5]) for ckpt in checkpoints if len(ckpt) > 4]
epoch_numbers.sort()
if epoch_numbers:
last_epoch = epoch_numbers[-1]
saved_path = os.path.join(output_dir, "model-%05d" % last_epoch)
model.load_weights(saved_path)
model.fit(train_batches,
epochs=train_steps // eval_frequency,
steps_per_epoch=eval_frequency,
validation_data=eval_batches,
validation_steps=eval_steps,
initial_epoch=last_epoch,
callbacks=callbacks)
|
[
"def",
"train_fn",
"(",
"data_dir",
"=",
"None",
",",
"output_dir",
"=",
"None",
",",
"model_class",
"=",
"gin",
".",
"REQUIRED",
",",
"dataset",
"=",
"gin",
".",
"REQUIRED",
",",
"input_names",
"=",
"None",
",",
"target_names",
"=",
"None",
",",
"train_steps",
"=",
"1000",
",",
"eval_steps",
"=",
"1",
",",
"eval_frequency",
"=",
"100",
")",
":",
"train_data",
",",
"eval_data",
",",
"features_info",
",",
"keys",
"=",
"train_and_eval_dataset",
"(",
"dataset",
",",
"data_dir",
")",
"if",
"input_names",
"is",
"None",
":",
"input_names",
"=",
"keys",
"[",
"0",
"]",
"if",
"target_names",
"is",
"None",
":",
"target_names",
"=",
"keys",
"[",
"1",
"]",
"# TODO(lukaszkaiser): The use of distribution strategy below fails like this:",
"# .../keras/models.py\", line 93, in _clone_functional_model",
"# for layer in model._input_layers:",
"# AttributeError: 'BasicFcRelu' object has no attribute '_input_layers'",
"# strategy = tf.distribute.MirroredStrategy()",
"# with strategy.scope():",
"model",
"=",
"model_class",
"(",
"features_info",
"=",
"features_info",
",",
"input_names",
"=",
"input_names",
",",
"target_names",
"=",
"target_names",
")",
"optimize_fn",
"(",
"model",
")",
"train_batches",
"=",
"shuffle_and_batch_data",
"(",
"train_data",
",",
"target_names",
",",
"features_info",
",",
"training",
"=",
"True",
")",
"eval_batches",
"=",
"shuffle_and_batch_data",
"(",
"eval_data",
",",
"target_names",
",",
"features_info",
",",
"training",
"=",
"False",
")",
"# Need to run one training step just to get optimizer variables to load.",
"model",
".",
"fit",
"(",
"train_batches",
",",
"epochs",
"=",
"1",
",",
"steps_per_epoch",
"=",
"1",
")",
"# Training loop.",
"callbacks",
"=",
"[",
"]",
"callbacks",
".",
"append",
"(",
"tf",
".",
"keras",
".",
"callbacks",
".",
"History",
"(",
")",
")",
"callbacks",
".",
"append",
"(",
"tf",
".",
"keras",
".",
"callbacks",
".",
"BaseLogger",
"(",
")",
")",
"last_epoch",
"=",
"0",
"if",
"output_dir",
"is",
"not",
"None",
":",
"callbacks",
".",
"append",
"(",
"tf",
".",
"keras",
".",
"callbacks",
".",
"TensorBoard",
"(",
"log_dir",
"=",
"output_dir",
")",
")",
"output_format",
"=",
"os",
".",
"path",
".",
"join",
"(",
"output_dir",
",",
"\"model-{epoch:05d}\"",
")",
"callbacks",
".",
"append",
"(",
"tf",
".",
"keras",
".",
"callbacks",
".",
"ModelCheckpoint",
"(",
"filepath",
"=",
"output_format",
",",
"save_weights_only",
"=",
"True",
")",
")",
"checkpoints",
"=",
"tf",
".",
"gfile",
".",
"Glob",
"(",
"os",
".",
"path",
".",
"join",
"(",
"output_dir",
",",
"\"model-*\"",
")",
")",
"# Take basenames and strip the \"model-\" prefix.",
"checkpoints",
"=",
"[",
"os",
".",
"path",
".",
"basename",
"(",
"ckpt",
")",
"[",
"6",
":",
"]",
"for",
"ckpt",
"in",
"checkpoints",
"]",
"# Get epoch numbers from the filenames and sort to obtain last epoch.",
"epoch_numbers",
"=",
"[",
"int",
"(",
"ckpt",
"[",
":",
"5",
"]",
")",
"for",
"ckpt",
"in",
"checkpoints",
"if",
"len",
"(",
"ckpt",
")",
">",
"4",
"]",
"epoch_numbers",
".",
"sort",
"(",
")",
"if",
"epoch_numbers",
":",
"last_epoch",
"=",
"epoch_numbers",
"[",
"-",
"1",
"]",
"saved_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"output_dir",
",",
"\"model-%05d\"",
"%",
"last_epoch",
")",
"model",
".",
"load_weights",
"(",
"saved_path",
")",
"model",
".",
"fit",
"(",
"train_batches",
",",
"epochs",
"=",
"train_steps",
"//",
"eval_frequency",
",",
"steps_per_epoch",
"=",
"eval_frequency",
",",
"validation_data",
"=",
"eval_batches",
",",
"validation_steps",
"=",
"eval_steps",
",",
"initial_epoch",
"=",
"last_epoch",
",",
"callbacks",
"=",
"callbacks",
")"
] |
Train the given model on the given dataset.
Args:
data_dir: Directory where the data is located.
output_dir: Directory where to put the logs and checkpoints.
model_class: The model class to train.
dataset: The name of the dataset to train on.
input_names: List of strings with the names of the features on input.
target_names: List of strings with the names of the target features.
train_steps: for how many steps to train.
eval_steps: for how many steps to do evaluation.
eval_frequency: how often (every this many steps) to run evaluation.
|
[
"Train",
"the",
"given",
"model",
"on",
"the",
"given",
"dataset",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/v2/t2t.py#L259-L324
|
train
|
Train the given model on the given dataset.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDASQ0Qkq,NL8dtWOpbcjF,_bikzMuRfbJG,sznFqDbNBHlx,ZsDPvpP4xdo3,cW7yQuyEnJ6E,KOHQGQ8qLDWm,NE1Yam2HHroQ,ygAzbDzrvRMh,SBRjvOU1ufVC,hOkXjmluKZfJ,q1QCh3W88sgk,TLbJ60djyws0,r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ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\066' + chr(0b110111), 42999 - 42991), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(552 - 502) + chr(0b10 + 0o64) + chr(330 - 277), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b11110 + 0o31) + chr(1377 - 1327), 0o10), ehT0Px3KOsy9(chr(1185 - 1137) + chr(0b1101000 + 0o7) + '\x31' + '\x35' + '\x35', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110011) + chr(0b110000), ord("\x08")), ehT0Px3KOsy9(chr(0b11100 + 0o24) + chr(0b1011010 + 0o25) + chr(0b110010) + '\x36' + chr(627 - 579), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(50) + chr(0b110010 + 0o4) + chr(0b110001), 0b1000), ehT0Px3KOsy9(chr(0b10011 + 0o35) + chr(0b1101111) + chr(0b110000 + 0o2) + chr(1398 - 1348) + '\064', ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + '\x31' + '\067' + '\063', ord("\x08")), ehT0Px3KOsy9(chr(0b1000 + 0o50) + '\x6f' + chr(0b101010 + 0o7) + chr(52) + chr(0b110110), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110011) + chr(0b1011 + 0o50) + chr(269 - 215), 0o10), ehT0Px3KOsy9('\060' + chr(0b111111 + 0o60) + '\062' + '\065' + chr(0b110111), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b11101 + 0o122) + '\063' + chr(0b101 + 0o53) + chr(53), 0b1000), ehT0Px3KOsy9(chr(1975 - 1927) + chr(0b1101111) + chr(0b10101 + 0o35) + chr(1860 - 1809) + chr(0b110011 + 0o3), 3896 - 3888), ehT0Px3KOsy9(chr(0b101101 + 0o3) + chr(1304 - 1193) + chr(0b11001 + 0o35) + '\063', 0o10), ehT0Px3KOsy9(chr(783 - 735) + '\x6f' + chr(0b100011 + 0o17) + chr(0b11011 + 0o34) + '\064', 42353 - 42345), ehT0Px3KOsy9(chr(1387 - 1339) + chr(0b1010111 + 0o30) + chr(50) + chr(429 - 374) + chr(0b101011 + 0o12), 28291 - 28283), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(54) + chr(0b110000), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1010111 + 0o30) + chr(0b100010 + 0o17) + chr(50) + chr(0b110011), 0o10), ehT0Px3KOsy9(chr(48) + chr(2039 - 1928) + chr(0b101111 + 0o4) + chr(0b10111 + 0o35) + chr(0b110000), 5003 - 4995), ehT0Px3KOsy9(chr(0b11001 + 0o27) + chr(111) + chr(50) + chr(0b10000 + 0o47) + '\x31', 50914 - 50906), ehT0Px3KOsy9('\x30' + chr(0b1111 + 0o140) + chr(537 - 486) + chr(0b110111) + chr(1448 - 1398), 0b1000), ehT0Px3KOsy9(chr(0b101101 + 0o3) + '\x6f' + chr(0b10100 + 0o36) + chr(0b11 + 0o60) + '\063', ord("\x08")), ehT0Px3KOsy9(chr(1302 - 1254) + chr(111) + chr(1153 - 1101) + '\x34', 0b1000), ehT0Px3KOsy9(chr(1939 - 1891) + '\157' + chr(675 - 626) + chr(0b101100 + 0o4) + chr(0b110011), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b100010 + 0o115) + chr(1560 - 1509) + chr(459 - 404) + chr(0b1111 + 0o45), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x32' + '\065' + chr(198 - 148), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b100000 + 0o22) + chr(0b110001) + chr(1397 - 1343), 60721 - 60713), ehT0Px3KOsy9('\x30' + chr(0b111010 + 0o65) + '\062' + chr(0b110000) + '\x31', ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + '\x31' + chr(0b110101) + chr(49), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(528 - 477) + chr(1528 - 1480) + chr(198 - 144), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + '\x31' + '\x33' + chr(0b110000), 38019 - 38011), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\061' + chr(0b110110) + chr(0b11011 + 0o33), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1011000 + 0o27) + '\x36' + '\060', 8), ehT0Px3KOsy9('\060' + '\x6f' + chr(50) + chr(49) + chr(1619 - 1570), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + '\x31' + '\x35' + chr(0b110110), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b100111 + 0o110) + chr(0b10010 + 0o41) + '\061', 20101 - 20093), ehT0Px3KOsy9(chr(48) + chr(111) + '\x31' + chr(51) + chr(54), 45241 - 45233), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b101000 + 0o12) + chr(1614 - 1564) + chr(48), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + '\066' + chr(0b1 + 0o64), 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(1941 - 1893) + chr(0b1101111) + '\x35' + chr(0b110000), ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x19'), chr(4165 - 4065) + chr(0b1100101) + chr(4021 - 3922) + chr(9411 - 9300) + chr(0b1100100) + chr(101))(chr(0b1110101) + chr(12415 - 12299) + '\146' + chr(45) + '\070') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def v5HLFpUfvELk(kVFRD544hi_1=None, nd0OX_BS6_o4=None, xS2ROZ6wphvF=xafqLlk3kkUe(WpThBfI19lUe, xafqLlk3kkUe(SXOLrMavuUCe(b'e\xf0k8Q\xe2\xf4\xd0'), chr(0b100110 + 0o76) + chr(568 - 467) + chr(0b101101 + 0o66) + '\x6f' + '\144' + '\145')(chr(117) + chr(116) + '\146' + chr(0b100101 + 0o10) + chr(3107 - 3051))), xQt6gV9VfTO3=xafqLlk3kkUe(WpThBfI19lUe, xafqLlk3kkUe(SXOLrMavuUCe(b'e\xf0k8Q\xe2\xf4\xd0'), chr(0b1100100) + chr(4248 - 4147) + chr(3910 - 3811) + chr(111) + chr(0b1100100) + chr(0b11 + 0o142))('\x75' + chr(0b1001 + 0o153) + chr(0b1001001 + 0o35) + '\x2d' + '\x38')), CMC8pWw9JJzH=None, xEjzlji2f7bf=None, daYMko0joBwR=ehT0Px3KOsy9('\060' + '\157' + chr(69 - 20) + chr(2778 - 2723) + '\065' + chr(1397 - 1349), 13584 - 13576), K3bHLghgmarn=ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110001), 0b1000), KIkXX2X7ASLN=ehT0Px3KOsy9(chr(90 - 42) + chr(10788 - 10677) + chr(2050 - 2001) + '\064' + '\064', 0o10)):
(sW8AagBcZuuj, lFsSHWR5AXWi, VmNccqBk7Msl, w8H8C9ec5BO1) = cA_PIO9aKoOR(xQt6gV9VfTO3, kVFRD544hi_1)
if CMC8pWw9JJzH is None:
CMC8pWw9JJzH = w8H8C9ec5BO1[ehT0Px3KOsy9(chr(0b110000) + chr(6672 - 6561) + '\x30', 58516 - 58508)]
if xEjzlji2f7bf is None:
xEjzlji2f7bf = w8H8C9ec5BO1[ehT0Px3KOsy9('\060' + '\x6f' + '\x31', 8)]
FK0vqzZ5gPN6 = xS2ROZ6wphvF(features_info=VmNccqBk7Msl, input_names=CMC8pWw9JJzH, target_names=xEjzlji2f7bf)
ou_KfhddYaVQ(FK0vqzZ5gPN6)
K4VUJHAd1wl8 = lcM9yAEWxzEh(sW8AagBcZuuj, xEjzlji2f7bf, VmNccqBk7Msl, training=ehT0Px3KOsy9(chr(48) + '\x6f' + '\x31', 8))
RPGQtUZ2bC76 = lcM9yAEWxzEh(lFsSHWR5AXWi, xEjzlji2f7bf, VmNccqBk7Msl, training=ehT0Px3KOsy9(chr(1060 - 1012) + '\x6f' + chr(0b10111 + 0o31), 8))
xafqLlk3kkUe(FK0vqzZ5gPN6, xafqLlk3kkUe(SXOLrMavuUCe(b'Q\xdcN'), chr(0b1010 + 0o132) + chr(101) + chr(99) + chr(111) + chr(0b1010001 + 0o23) + chr(0b1100101))('\165' + chr(116) + '\x66' + '\x2d' + '\070'))(K4VUJHAd1wl8, epochs=ehT0Px3KOsy9(chr(0b110000) + chr(0b1000111 + 0o50) + chr(0b110001), 8), steps_per_epoch=ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b10110 + 0o33), 8))
PX4b0z2UpTWH = []
xafqLlk3kkUe(PX4b0z2UpTWH, xafqLlk3kkUe(SXOLrMavuUCe(b'V\xc5J\x08v\xd4'), chr(0b1100100) + '\x65' + chr(0b1100011) + chr(111) + chr(100) + '\145')('\165' + chr(0b1110100) + chr(2128 - 2026) + '\x2d' + chr(0b111000 + 0o0)))(xafqLlk3kkUe(IDJ2eXGCBCDu.keras.callbacks, xafqLlk3kkUe(SXOLrMavuUCe(b'\x7f\xdcI\x19w\xc2\xc8'), '\x64' + chr(7495 - 7394) + chr(0b1011 + 0o130) + chr(3884 - 3773) + '\x64' + chr(101))('\x75' + chr(170 - 54) + chr(102) + chr(45) + chr(0b111000)))())
xafqLlk3kkUe(PX4b0z2UpTWH, xafqLlk3kkUe(SXOLrMavuUCe(b'V\xc5J\x08v\xd4'), chr(9378 - 9278) + chr(101) + chr(0b1100011) + chr(111) + chr(0b1100100) + chr(101))(chr(12562 - 12445) + '\164' + chr(102) + chr(0b10100 + 0o31) + '\070'))(xafqLlk3kkUe(IDJ2eXGCBCDu.keras.callbacks, xafqLlk3kkUe(SXOLrMavuUCe(b'u\xd4I\x08T\xdf\xd6\xf3\x1e\x14'), '\x64' + '\145' + '\143' + '\x6f' + chr(0b101001 + 0o73) + chr(2639 - 2538))('\x75' + '\x74' + chr(0b1100110) + chr(1747 - 1702) + chr(2982 - 2926)))())
spX63vzRw7gv = ehT0Px3KOsy9(chr(948 - 900) + chr(111) + '\060', 8)
if nd0OX_BS6_o4 is not None:
xafqLlk3kkUe(PX4b0z2UpTWH, xafqLlk3kkUe(SXOLrMavuUCe(b'V\xc5J\x08v\xd4'), '\x64' + chr(6569 - 6468) + '\143' + chr(0b1011111 + 0o20) + chr(1392 - 1292) + '\145')(chr(117) + chr(116) + chr(0b111000 + 0o56) + chr(0b101101) + chr(56)))(xafqLlk3kkUe(IDJ2eXGCBCDu.keras.callbacks, xafqLlk3kkUe(SXOLrMavuUCe(b'c\xd0T\x1ew\xc2\xf3\xfb\x1a\x14\xba'), chr(100) + chr(4167 - 4066) + chr(0b1100011) + chr(3917 - 3806) + chr(0b1100100) + chr(101))(chr(0b1110101) + '\x74' + '\146' + chr(0b101001 + 0o4) + chr(56)))(log_dir=nd0OX_BS6_o4))
OHzcAT5vsRQV = oqhJDdMJfuwx.path.join(nd0OX_BS6_o4, xafqLlk3kkUe(SXOLrMavuUCe(b'Z\xda^\x08t\x9d\xca\xf1\x0b\t\xbd\xc7\xff\xae\x06\xd8\xc0'), chr(5326 - 5226) + chr(0b1110 + 0o127) + chr(0b1100011) + '\x6f' + chr(100) + chr(101))(chr(0b1110101) + '\164' + chr(0b1100110) + chr(1679 - 1634) + '\x38'))
xafqLlk3kkUe(PX4b0z2UpTWH, xafqLlk3kkUe(SXOLrMavuUCe(b'V\xc5J\x08v\xd4'), '\144' + '\145' + chr(0b1100011) + chr(0b1101111) + chr(0b110100 + 0o60) + chr(0b1100101))(chr(1756 - 1639) + chr(0b111001 + 0o73) + '\146' + '\055' + chr(0b111000)))(xafqLlk3kkUe(IDJ2eXGCBCDu.keras.callbacks, xafqLlk3kkUe(SXOLrMavuUCe(b'z\xda^\x08t\xf3\xd9\xf1\x18\r\xae\xc0\xac\xf0G'), chr(100) + chr(101) + chr(99) + chr(0b1101110 + 0o1) + chr(0b11101 + 0o107) + chr(6225 - 6124))(chr(117) + chr(116) + chr(0b1000110 + 0o40) + chr(0b0 + 0o55) + '\070'))(filepath=OHzcAT5vsRQV, save_weights_only=ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110001), 8)))
ZoiWO7qyi1ja = IDJ2eXGCBCDu.gfile.Glob(oqhJDdMJfuwx.path.join(nd0OX_BS6_o4, xafqLlk3kkUe(SXOLrMavuUCe(b'Z\xda^\x08t\x9d\x9b'), chr(100) + '\145' + '\x63' + '\x6f' + chr(8019 - 7919) + chr(101))(chr(0b101101 + 0o110) + chr(116) + chr(0b1100110) + '\x2d' + '\070')))
ZoiWO7qyi1ja = [oqhJDdMJfuwx.path.basename(NjM4QqAJGres)[ehT0Px3KOsy9(chr(883 - 835) + chr(0b1100111 + 0o10) + '\066', 0o10):] for NjM4QqAJGres in ZoiWO7qyi1ja]
xHfpk1LTn8Wl = vUlqIvNSaRMa([ehT0Px3KOsy9(NjM4QqAJGres[:ehT0Px3KOsy9('\060' + '\157' + chr(0b100010 + 0o23), 0o10)]) for NjM4QqAJGres in ZoiWO7qyi1ja if c2A0yzQpDQB3(NjM4QqAJGres) > ehT0Px3KOsy9(chr(0b100010 + 0o16) + chr(4445 - 4334) + chr(52), 22425 - 22417)])
if xHfpk1LTn8Wl:
spX63vzRw7gv = xHfpk1LTn8Wl[-ehT0Px3KOsy9(chr(0b111 + 0o51) + chr(0b11111 + 0o120) + '\x31', 8)]
pICaaGzPFo7x = oqhJDdMJfuwx.path.join(nd0OX_BS6_o4, xafqLlk3kkUe(SXOLrMavuUCe(b'Z\xda^\x08t\x9d\x94\xa4N\x02'), chr(100) + chr(1628 - 1527) + '\143' + chr(0b1101111) + chr(0b111110 + 0o46) + '\145')('\x75' + chr(0b1110100) + '\x66' + '\x2d' + chr(0b111000)) % spX63vzRw7gv)
xafqLlk3kkUe(FK0vqzZ5gPN6, xafqLlk3kkUe(SXOLrMavuUCe(b'[\xda[\tG\xc7\xd4\xfd\x1c\x0e\xaa\xdc'), '\x64' + chr(1425 - 1324) + '\x63' + chr(0b1011010 + 0o25) + chr(100) + chr(4444 - 4343))(chr(0b1110101) + chr(4057 - 3941) + chr(3994 - 3892) + chr(0b100111 + 0o6) + chr(0b100 + 0o64)))(pICaaGzPFo7x)
xafqLlk3kkUe(FK0vqzZ5gPN6, xafqLlk3kkUe(SXOLrMavuUCe(b'Q\xdcN'), chr(0b1100100) + '\x65' + chr(0b100001 + 0o102) + chr(6054 - 5943) + chr(6826 - 6726) + chr(402 - 301))('\x75' + '\x74' + chr(9619 - 9517) + chr(0b101101) + '\x38'))(K4VUJHAd1wl8, epochs=daYMko0joBwR // KIkXX2X7ASLN, steps_per_epoch=KIkXX2X7ASLN, validation_data=RPGQtUZ2bC76, validation_steps=K3bHLghgmarn, initial_epoch=spX63vzRw7gv, callbacks=PX4b0z2UpTWH)
|
tensorflow/tensor2tensor
|
tensor2tensor/v2/t2t.py
|
t2t_train
|
def t2t_train(model_name, dataset_name,
data_dir=None, output_dir=None, config_file=None, config=None):
"""Main function to train the given model on the given dataset.
Args:
model_name: The name of the model to train.
dataset_name: The name of the dataset to train on.
data_dir: Directory where the data is located.
output_dir: Directory where to put the logs and checkpoints.
config_file: the gin configuration file to use.
config: string (in gin format) to override gin parameters.
"""
if model_name not in _MODEL_REGISTRY:
raise ValueError("Model %s not in registry. Available models:\n * %s." %
(model_name, "\n * ".join(_MODEL_REGISTRY.keys())))
model_class = _MODEL_REGISTRY[model_name]()
gin.bind_parameter("train_fn.model_class", model_class)
gin.bind_parameter("train_fn.dataset", dataset_name)
gin.parse_config_files_and_bindings(config_file, config)
# TODO(lukaszkaiser): save gin config in output_dir if provided?
train_fn(data_dir, output_dir=output_dir)
|
python
|
def t2t_train(model_name, dataset_name,
data_dir=None, output_dir=None, config_file=None, config=None):
"""Main function to train the given model on the given dataset.
Args:
model_name: The name of the model to train.
dataset_name: The name of the dataset to train on.
data_dir: Directory where the data is located.
output_dir: Directory where to put the logs and checkpoints.
config_file: the gin configuration file to use.
config: string (in gin format) to override gin parameters.
"""
if model_name not in _MODEL_REGISTRY:
raise ValueError("Model %s not in registry. Available models:\n * %s." %
(model_name, "\n * ".join(_MODEL_REGISTRY.keys())))
model_class = _MODEL_REGISTRY[model_name]()
gin.bind_parameter("train_fn.model_class", model_class)
gin.bind_parameter("train_fn.dataset", dataset_name)
gin.parse_config_files_and_bindings(config_file, config)
# TODO(lukaszkaiser): save gin config in output_dir if provided?
train_fn(data_dir, output_dir=output_dir)
|
[
"def",
"t2t_train",
"(",
"model_name",
",",
"dataset_name",
",",
"data_dir",
"=",
"None",
",",
"output_dir",
"=",
"None",
",",
"config_file",
"=",
"None",
",",
"config",
"=",
"None",
")",
":",
"if",
"model_name",
"not",
"in",
"_MODEL_REGISTRY",
":",
"raise",
"ValueError",
"(",
"\"Model %s not in registry. Available models:\\n * %s.\"",
"%",
"(",
"model_name",
",",
"\"\\n * \"",
".",
"join",
"(",
"_MODEL_REGISTRY",
".",
"keys",
"(",
")",
")",
")",
")",
"model_class",
"=",
"_MODEL_REGISTRY",
"[",
"model_name",
"]",
"(",
")",
"gin",
".",
"bind_parameter",
"(",
"\"train_fn.model_class\"",
",",
"model_class",
")",
"gin",
".",
"bind_parameter",
"(",
"\"train_fn.dataset\"",
",",
"dataset_name",
")",
"gin",
".",
"parse_config_files_and_bindings",
"(",
"config_file",
",",
"config",
")",
"# TODO(lukaszkaiser): save gin config in output_dir if provided?",
"train_fn",
"(",
"data_dir",
",",
"output_dir",
"=",
"output_dir",
")"
] |
Main function to train the given model on the given dataset.
Args:
model_name: The name of the model to train.
dataset_name: The name of the dataset to train on.
data_dir: Directory where the data is located.
output_dir: Directory where to put the logs and checkpoints.
config_file: the gin configuration file to use.
config: string (in gin format) to override gin parameters.
|
[
"Main",
"function",
"to",
"train",
"the",
"given",
"model",
"on",
"the",
"given",
"dataset",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/v2/t2t.py#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wAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + chr(0b1011110 + 0o21) + chr(50) + chr(0b110111) + '\060', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110001) + chr(0b110111) + chr(0b110111), 11839 - 11831), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(51) + '\065' + chr(49), 0b1000), ehT0Px3KOsy9(chr(1487 - 1439) + chr(0b1001101 + 0o42) + '\x33' + '\064', ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + '\x32' + '\x37', 0b1000), ehT0Px3KOsy9(chr(0b100010 + 0o16) + chr(0b1100110 + 0o11) + chr(1214 - 1163) + chr(52) + chr(0b110101), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\063' + '\x35' + '\x30', 44095 - 44087), ehT0Px3KOsy9('\x30' + '\157' + chr(1606 - 1555) + chr(1107 - 1055) + chr(2301 - 2251), 0b1000), ehT0Px3KOsy9(chr(0b11100 + 0o24) + '\157' + chr(659 - 610) + chr(0b110101) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1011100 + 0o23) + '\x31' + chr(0b0 + 0o61) + chr(50), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110010) + chr(0b110100) + chr(0b10111 + 0o35), 62623 - 62615), ehT0Px3KOsy9(chr(0b100 + 0o54) + '\157' + '\x32' + chr(54) + '\x34', 11362 - 11354), ehT0Px3KOsy9(chr(471 - 423) + chr(4501 - 4390) + '\063' + '\062' + chr(0b110001), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(1753 - 1698) + chr(0b110001), 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110101) + '\x34', 0b1000), ehT0Px3KOsy9(chr(0b101 + 0o53) + chr(0b101110 + 0o101) + chr(0b101010 + 0o12) + '\x30', 3162 - 3154), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110011) + chr(50) + '\x30', 0b1000), ehT0Px3KOsy9(chr(0b100000 + 0o20) + chr(111) + chr(1915 - 1865) + chr(0b110001) + '\x36', 0o10), ehT0Px3KOsy9(chr(0b11110 + 0o22) + chr(0b1101111) + chr(49) + chr(0b11110 + 0o26) + chr(0b110110), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1100110 + 0o11) + chr(2284 - 2229) + chr(414 - 359), 0o10), ehT0Px3KOsy9(chr(0b10 + 0o56) + chr(111) + '\x32' + '\065' + chr(2086 - 2037), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x33' + chr(51) + chr(49), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b111101 + 0o62) + chr(51) + chr(0b110111) + chr(0b110111), 15055 - 15047), ehT0Px3KOsy9(chr(0b1010 + 0o46) + chr(9872 - 9761) + chr(50) + chr(0b110110), 57253 - 57245), ehT0Px3KOsy9(chr(0b10011 + 0o35) + '\x6f' + '\x31' + chr(0b100100 + 0o16) + chr(2768 - 2715), 0o10), ehT0Px3KOsy9(chr(0b1110 + 0o42) + chr(0b1100 + 0o143) + chr(1987 - 1937) + chr(0b110101) + chr(0b100001 + 0o20), 8), ehT0Px3KOsy9(chr(1014 - 966) + '\157' + chr(0b101110 + 0o4) + chr(0b101010 + 0o10), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b10010 + 0o37) + '\065' + chr(1494 - 1441), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101010 + 0o5) + '\061' + '\065' + chr(1509 - 1458), 0o10), ehT0Px3KOsy9(chr(0b1101 + 0o43) + chr(1486 - 1375) + chr(1868 - 1817) + chr(0b110100 + 0o3) + '\065', 0b1000), ehT0Px3KOsy9('\060' + chr(8811 - 8700) + '\x32' + chr(0b111 + 0o51) + chr(1301 - 1249), 0b1000), ehT0Px3KOsy9(chr(1276 - 1228) + '\157' + '\063' + '\x31' + chr(48), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(49) + '\061' + '\x30', 0o10), ehT0Px3KOsy9(chr(173 - 125) + chr(0b11 + 0o154) + chr(0b110011) + chr(0b110000) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9(chr(0b100010 + 0o16) + chr(0b1101111) + chr(0b10001 + 0o45), 0o10), ehT0Px3KOsy9(chr(48) + chr(8176 - 8065) + chr(1256 - 1207) + chr(0b110100) + chr(49), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110001) + chr(0b110101) + chr(0b110111), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x34' + chr(2691 - 2638), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(5751 - 5640) + chr(50) + chr(0b1001 + 0o51) + chr(383 - 334), 55114 - 55106), ehT0Px3KOsy9(chr(0b110000) + chr(0b11100 + 0o123) + '\067', 6366 - 6358)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b10010 + 0o43) + '\x30', 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x96'), chr(100) + chr(0b1100010 + 0o3) + '\x63' + '\x6f' + chr(0b1111 + 0o125) + chr(0b1100101))(chr(0b100011 + 0o122) + chr(10357 - 10241) + chr(102) + '\055' + chr(0b111000)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def GhubuCeE18U3(yJFe33rl9i_r, p_vJ076GqAjR, kVFRD544hi_1=None, nd0OX_BS6_o4=None, umYO37c7rPBE=None, jAj7S20Ct06o=None):
if yJFe33rl9i_r not in hxgl7d06ps9T:
raise q1QCh3W88sgk(xafqLlk3kkUe(SXOLrMavuUCe(b'\xf5\x10\x8dy{\xc5\xcd\x91J$\xcb\xc0\xf1PB\x00\xa2\xeb\x01V\xda\xad\x8do{\x89S\x1b\n\x94\xe8\xa9*\xa8cA\x02J\xf5b\xd4\x0c\xd3\x167\xcf\xc8\xc7\x19d'), chr(0b1010010 + 0o22) + chr(4110 - 4009) + '\143' + chr(0b1001111 + 0o40) + chr(100) + chr(3259 - 3158))(chr(117) + '\164' + '\x66' + chr(45) + chr(0b111000)) % (yJFe33rl9i_r, xafqLlk3kkUe(xafqLlk3kkUe(SXOLrMavuUCe(b'\xb2_\xc3<'), chr(0b11111 + 0o105) + chr(0b100 + 0o141) + '\x63' + chr(0b1101111) + chr(0b1100100) + chr(0b101100 + 0o71))(chr(0b1110101) + chr(116) + chr(0b1000001 + 0o45) + chr(1866 - 1821) + '\070'), xafqLlk3kkUe(SXOLrMavuUCe(b'\xd2\x10\x80r'), chr(0b100100 + 0o100) + chr(101) + chr(0b1001000 + 0o33) + '\x6f' + chr(100) + chr(0b100101 + 0o100))('\165' + chr(0b1110100) + chr(102) + chr(1256 - 1211) + chr(56)))(xafqLlk3kkUe(hxgl7d06ps9T, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd3\x1a\x90o'), chr(100) + chr(0b0 + 0o145) + chr(99) + chr(0b1101111) + '\144' + chr(0b1100101))('\x75' + chr(0b1110100) + chr(102) + '\055' + chr(0b10110 + 0o42)))())))
xS2ROZ6wphvF = hxgl7d06ps9T[yJFe33rl9i_r]()
xafqLlk3kkUe(WpThBfI19lUe, xafqLlk3kkUe(SXOLrMavuUCe(b"\xda\x16\x87xH\x95\x89\x90\x0b'\xc1\xc0\xb4K"), chr(8475 - 8375) + chr(101) + '\143' + chr(111) + chr(0b110010 + 0o62) + '\x65')(chr(0b1110101) + chr(0b1110100) + chr(5647 - 5545) + chr(0b100101 + 0o10) + chr(0b111000)))(xafqLlk3kkUe(SXOLrMavuUCe(b"\xcc\r\x88uy\xba\x8e\x8cD'\xcb\xd0\xb4UsC\xbc\xef\x15L"), chr(0b1011001 + 0o13) + chr(6980 - 6879) + chr(0b111100 + 0o47) + chr(3555 - 3444) + chr(0b1100100) + chr(0b101111 + 0o66))(chr(0b100 + 0o161) + '\164' + chr(3827 - 3725) + chr(45) + '\070'), xS2ROZ6wphvF)
xafqLlk3kkUe(WpThBfI19lUe, xafqLlk3kkUe(SXOLrMavuUCe(b"\xda\x16\x87xH\x95\x89\x90\x0b'\xc1\xc0\xb4K"), chr(376 - 276) + chr(8426 - 8325) + chr(0b1100011) + chr(0b11010 + 0o125) + chr(6609 - 6509) + chr(0b1100101))('\x75' + chr(0b1110100) + chr(0b1100101 + 0o1) + chr(0b1001 + 0o44) + chr(2260 - 2204)))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xcc\r\x88uy\xba\x8e\x8cD.\xc5\xc0\xb0JIT'), chr(0b111111 + 0o45) + '\145' + chr(1305 - 1206) + chr(0b111110 + 0o61) + '\x64' + chr(0b1011011 + 0o12))(chr(0b1000 + 0o155) + '\164' + chr(0b100101 + 0o101) + '\055' + chr(0b110000 + 0o10)), p_vJ076GqAjR)
xafqLlk3kkUe(WpThBfI19lUe, xafqLlk3kkUe(SXOLrMavuUCe(b'\xc8\x1e\x9bor\xba\x8b\x8d\x04,\xcd\xd3\x8e_EL\xb5\xfd9^\xc7\xbd\xa0t<\xc7v\x04\x05\x9a\xf7'), '\x64' + '\145' + chr(0b1100011) + '\157' + '\x64' + chr(0b1100101))('\x75' + chr(0b1110100) + chr(5591 - 5489) + chr(555 - 510) + chr(0b1101 + 0o53)))(umYO37c7rPBE, jAj7S20Ct06o)
v5HLFpUfvELk(kVFRD544hi_1, output_dir=nd0OX_BS6_o4)
|
tensorflow/tensor2tensor
|
tensor2tensor/bin/t2t_decoder.py
|
decode
|
def decode(estimator, hparams, decode_hp):
"""Decode from estimator. Interactive, from file, or from dataset."""
if FLAGS.decode_interactive:
if estimator.config.use_tpu:
raise ValueError("TPU can only decode from dataset.")
decoding.decode_interactively(estimator, hparams, decode_hp,
checkpoint_path=FLAGS.checkpoint_path)
elif FLAGS.decode_from_file:
decoding.decode_from_file(estimator, FLAGS.decode_from_file, hparams,
decode_hp, FLAGS.decode_to_file,
checkpoint_path=FLAGS.checkpoint_path)
if FLAGS.checkpoint_path and FLAGS.keep_timestamp:
ckpt_time = os.path.getmtime(FLAGS.checkpoint_path + ".index")
os.utime(FLAGS.decode_to_file, (ckpt_time, ckpt_time))
else:
decoding.decode_from_dataset(
estimator,
FLAGS.problem,
hparams,
decode_hp,
decode_to_file=FLAGS.decode_to_file,
dataset_split="test" if FLAGS.eval_use_test_set else None,
checkpoint_path=FLAGS.checkpoint_path)
|
python
|
def decode(estimator, hparams, decode_hp):
"""Decode from estimator. Interactive, from file, or from dataset."""
if FLAGS.decode_interactive:
if estimator.config.use_tpu:
raise ValueError("TPU can only decode from dataset.")
decoding.decode_interactively(estimator, hparams, decode_hp,
checkpoint_path=FLAGS.checkpoint_path)
elif FLAGS.decode_from_file:
decoding.decode_from_file(estimator, FLAGS.decode_from_file, hparams,
decode_hp, FLAGS.decode_to_file,
checkpoint_path=FLAGS.checkpoint_path)
if FLAGS.checkpoint_path and FLAGS.keep_timestamp:
ckpt_time = os.path.getmtime(FLAGS.checkpoint_path + ".index")
os.utime(FLAGS.decode_to_file, (ckpt_time, ckpt_time))
else:
decoding.decode_from_dataset(
estimator,
FLAGS.problem,
hparams,
decode_hp,
decode_to_file=FLAGS.decode_to_file,
dataset_split="test" if FLAGS.eval_use_test_set else None,
checkpoint_path=FLAGS.checkpoint_path)
|
[
"def",
"decode",
"(",
"estimator",
",",
"hparams",
",",
"decode_hp",
")",
":",
"if",
"FLAGS",
".",
"decode_interactive",
":",
"if",
"estimator",
".",
"config",
".",
"use_tpu",
":",
"raise",
"ValueError",
"(",
"\"TPU can only decode from dataset.\"",
")",
"decoding",
".",
"decode_interactively",
"(",
"estimator",
",",
"hparams",
",",
"decode_hp",
",",
"checkpoint_path",
"=",
"FLAGS",
".",
"checkpoint_path",
")",
"elif",
"FLAGS",
".",
"decode_from_file",
":",
"decoding",
".",
"decode_from_file",
"(",
"estimator",
",",
"FLAGS",
".",
"decode_from_file",
",",
"hparams",
",",
"decode_hp",
",",
"FLAGS",
".",
"decode_to_file",
",",
"checkpoint_path",
"=",
"FLAGS",
".",
"checkpoint_path",
")",
"if",
"FLAGS",
".",
"checkpoint_path",
"and",
"FLAGS",
".",
"keep_timestamp",
":",
"ckpt_time",
"=",
"os",
".",
"path",
".",
"getmtime",
"(",
"FLAGS",
".",
"checkpoint_path",
"+",
"\".index\"",
")",
"os",
".",
"utime",
"(",
"FLAGS",
".",
"decode_to_file",
",",
"(",
"ckpt_time",
",",
"ckpt_time",
")",
")",
"else",
":",
"decoding",
".",
"decode_from_dataset",
"(",
"estimator",
",",
"FLAGS",
".",
"problem",
",",
"hparams",
",",
"decode_hp",
",",
"decode_to_file",
"=",
"FLAGS",
".",
"decode_to_file",
",",
"dataset_split",
"=",
"\"test\"",
"if",
"FLAGS",
".",
"eval_use_test_set",
"else",
"None",
",",
"checkpoint_path",
"=",
"FLAGS",
".",
"checkpoint_path",
")"
] |
Decode from estimator. Interactive, from file, or from dataset.
|
[
"Decode",
"from",
"estimator",
".",
"Interactive",
"from",
"file",
"or",
"from",
"dataset",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/bin/t2t_decoder.py#L82-L104
|
train
|
Decode from estimator. Interactive from file or from dataset.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthx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,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\x30' + chr(0b1 + 0o156) + '\x33' + chr(0b110011) + chr(0b1010 + 0o52), 19906 - 19898), ehT0Px3KOsy9(chr(2191 - 2143) + chr(0b1101111) + chr(0b10101 + 0o35), 18733 - 18725), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(1159 - 1110) + chr(48), 32120 - 32112), ehT0Px3KOsy9('\060' + chr(3416 - 3305) + chr(1717 - 1666) + chr(53) + chr(50), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(50) + '\x31' + chr(0b10011 + 0o44), 0o10), ehT0Px3KOsy9(chr(0b100111 + 0o11) + '\157' + '\062' + '\x31', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + '\x33' + '\x35' + '\x37', 39159 - 39151), ehT0Px3KOsy9('\060' + chr(0b110101 + 0o72) + '\x31' + '\x33' + chr(0b101110 + 0o10), 0b1000), ehT0Px3KOsy9(chr(1215 - 1167) + chr(111) + chr(50) + '\066', 0o10), ehT0Px3KOsy9(chr(1614 - 1566) + chr(111) + '\x37' + '\067', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(208 - 158) + chr(0b110101) + chr(2422 - 2367), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110001) + chr(0b10111 + 0o40), 48387 - 48379), ehT0Px3KOsy9(chr(0b101110 + 0o2) + chr(0b10 + 0o155) + chr(0b100001 + 0o21) + '\x35' + '\065', 37930 - 37922), ehT0Px3KOsy9(chr(1766 - 1718) + chr(3831 - 3720) + chr(0b110010) + chr(769 - 718) + chr(0b110010), 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(0b1100 + 0o45) + chr(0b110100) + '\064', 52111 - 52103), ehT0Px3KOsy9(chr(1190 - 1142) + chr(0b1010 + 0o145) + '\x31' + chr(54) + chr(1269 - 1220), 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(51) + chr(1850 - 1797), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b101011 + 0o104) + chr(0b10101 + 0o35) + '\x37' + '\060', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1011100 + 0o23) + chr(51) + chr(0b110001) + chr(0b10100 + 0o43), 0b1000), ehT0Px3KOsy9(chr(0b101011 + 0o5) + chr(1812 - 1701) + chr(388 - 338) + '\x33' + chr(52), 0o10), ehT0Px3KOsy9(chr(0b101001 + 0o7) + chr(996 - 885) + chr(0b110001) + '\061' + chr(0b110110), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b100000 + 0o117) + '\061' + chr(54) + chr(0b110 + 0o56), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\062' + chr(0b110010 + 0o3) + chr(0b1011 + 0o47), 0o10), ehT0Px3KOsy9(chr(1019 - 971) + chr(0b1101111) + chr(659 - 610) + chr(51) + chr(0b11 + 0o62), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(859 - 809) + chr(0b110101) + chr(833 - 783), 8), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x31' + chr(53) + '\x30', 20682 - 20674), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(1411 - 1362) + '\x34' + chr(986 - 936), 38702 - 38694), ehT0Px3KOsy9('\060' + chr(0b11 + 0o154) + chr(0b110010) + '\063' + chr(165 - 111), 0o10), ehT0Px3KOsy9('\060' + '\157' + '\x33' + '\065' + chr(2114 - 2064), 8), ehT0Px3KOsy9(chr(48) + chr(111) + chr(50) + chr(0b101111 + 0o10) + '\x31', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(1834 - 1784) + chr(48) + chr(688 - 640), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(49) + chr(1328 - 1275) + '\x34', 0b1000), ehT0Px3KOsy9(chr(48) + chr(864 - 753) + chr(0b101010 + 0o7) + chr(0b110110) + chr(2103 - 2048), 40675 - 40667), ehT0Px3KOsy9(chr(0b101000 + 0o10) + chr(2417 - 2306) + '\067' + chr(0b1110 + 0o47), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(1077 - 1023) + chr(1764 - 1711), 20738 - 20730), ehT0Px3KOsy9('\060' + chr(0b110111 + 0o70) + '\x32' + '\x37' + '\064', 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110011) + chr(0b11011 + 0o33) + '\064', 47602 - 47594), ehT0Px3KOsy9(chr(48) + chr(8745 - 8634) + chr(0b110011) + chr(0b100 + 0o56) + chr(49), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(49) + chr(0b110010) + chr(0b10000 + 0o47), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b10100 + 0o40) + chr(783 - 733), ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9(chr(607 - 559) + '\x6f' + chr(0b101000 + 0o15) + chr(0b1011 + 0o45), 17550 - 17542)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xf2'), chr(0b11111 + 0o105) + chr(0b1100101) + chr(0b1100011) + chr(0b1101111) + '\x64' + chr(9299 - 9198))(chr(0b101010 + 0o113) + chr(116) + '\146' + chr(411 - 366) + '\x38') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def RSziqSuj39r9(GDZi5OTNos9m, n4ljua2gi1Pr, dcaitvFqg9pp):
if xafqLlk3kkUe(vUTZFbqN0o8F, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb8gk\x85\xebt\xb07xK\xca}\xcc\xf9\x10\x18k\xdd'), '\x64' + chr(101) + chr(9076 - 8977) + chr(7937 - 7826) + chr(100) + chr(0b1001001 + 0o34))(chr(8162 - 8045) + chr(4322 - 4206) + '\146' + '\x2d' + chr(1097 - 1041))):
if xafqLlk3kkUe(GDZi5OTNos9m.config, xafqLlk3kkUe(SXOLrMavuUCe(b'\x906m\xaf\xb8z\x8c$_u\xd8n'), chr(3893 - 3793) + chr(0b1100101) + chr(0b111100 + 0o47) + '\x6f' + chr(100) + chr(0b1100101))(chr(0b1110101) + chr(771 - 655) + '\146' + '\x2d' + chr(56))):
raise q1QCh3W88sgk(xafqLlk3kkUe(SXOLrMavuUCe(b'\x88R]\xca\xecp\x81~yQ\xc3v\x8d\xfe\x01\x12r\xdc\xaa\xbc(\x06\xc50\x8a\x0c\x03\xea\x8b\xca\xe5\x18Y'), chr(0b1100100) + chr(7890 - 7789) + chr(0b1100011) + '\x6f' + '\x64' + chr(0b101100 + 0o71))('\x75' + chr(0b1110100) + '\x66' + '\055' + chr(0b111000)))
xafqLlk3kkUe(jyVHS0IYLm_8, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb8gk\x85\xebt\xb07xK\xca}\xcc\xf9\x10\x18k\xdd\xa3\xe5'), chr(100) + '\x65' + '\143' + '\x6f' + chr(0b1100100) + chr(0b1101 + 0o130))('\165' + '\164' + '\x66' + chr(45) + chr(56)))(GDZi5OTNos9m, n4ljua2gi1Pr, dcaitvFqg9pp, checkpoint_path=xafqLlk3kkUe(vUTZFbqN0o8F, xafqLlk3kkUe(SXOLrMavuUCe(b'\xbfjm\x89\xe4a\x807xK\xf0\x7f\xcc\xee\x0c'), chr(6836 - 6736) + chr(4354 - 4253) + chr(0b1100011) + chr(0b1001100 + 0o43) + chr(2560 - 2460) + chr(8996 - 8895))('\165' + chr(2405 - 2289) + chr(9756 - 9654) + chr(0b101101) + chr(1776 - 1720))))
elif xafqLlk3kkUe(vUTZFbqN0o8F, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb8gk\x85\xebt\xb08dP\xc2P\xcb\xf3\x08\x14'), chr(0b10001 + 0o123) + '\x65' + chr(99) + chr(111) + '\x64' + chr(0b1100011 + 0o2))(chr(0b1110101) + '\164' + '\x66' + chr(1757 - 1712) + chr(56))):
xafqLlk3kkUe(jyVHS0IYLm_8, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb8gk\x85\xebt\xb08dP\xc2P\xcb\xf3\x08\x14'), chr(3614 - 3514) + chr(101) + chr(0b1100011) + chr(111) + '\144' + chr(0b1100101))(chr(0b1110101) + chr(116) + chr(102) + '\055' + chr(0b111000)))(GDZi5OTNos9m, xafqLlk3kkUe(vUTZFbqN0o8F, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb8gk\x85\xebt\xb08dP\xc2P\xcb\xf3\x08\x14'), chr(100) + '\x65' + chr(99) + chr(1681 - 1570) + chr(0b1001 + 0o133) + '\145')('\x75' + chr(11969 - 11853) + chr(8515 - 8413) + chr(0b101101) + chr(56))), n4ljua2gi1Pr, dcaitvFqg9pp, xafqLlk3kkUe(vUTZFbqN0o8F, xafqLlk3kkUe(SXOLrMavuUCe(b'\xbaKP\x85\xe6D\x8e:Lx\xfek'), '\144' + '\145' + '\x63' + chr(0b1000100 + 0o53) + chr(0b1100100) + chr(0b11011 + 0o112))(chr(0b1000 + 0o155) + chr(0b1110100) + '\x66' + chr(191 - 146) + '\070')), checkpoint_path=xafqLlk3kkUe(vUTZFbqN0o8F, xafqLlk3kkUe(SXOLrMavuUCe(b'\xbfjm\x89\xe4a\x807xK\xf0\x7f\xcc\xee\x0c'), chr(0b1100100) + '\x65' + chr(99) + chr(5753 - 5642) + '\144' + chr(0b1010010 + 0o23))('\x75' + chr(0b1001001 + 0o53) + chr(0b1001001 + 0o35) + '\055' + chr(0b1 + 0o67))))
if xafqLlk3kkUe(vUTZFbqN0o8F, xafqLlk3kkUe(SXOLrMavuUCe(b'\xbfjm\x89\xe4a\x807xK\xf0\x7f\xcc\xee\x0c'), chr(0b1100100) + '\145' + chr(0b1100010 + 0o1) + chr(111) + '\x64' + chr(101))('\x75' + '\x74' + '\146' + chr(0b101011 + 0o2) + chr(2780 - 2724))) and xafqLlk3kkUe(vUTZFbqN0o8F, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb7gm\x9a\xd0e\x863sL\xdbn\xc0\xea'), '\x64' + chr(0b1000010 + 0o43) + '\143' + chr(0b110110 + 0o71) + '\x64' + chr(101))('\x75' + '\x74' + chr(0b1100110) + '\055' + chr(56))):
G02S8JKiQ16r = oqhJDdMJfuwx.path.getmtime(vUTZFbqN0o8F.checkpoint_path + xafqLlk3kkUe(SXOLrMavuUCe(b'\xf2kf\x8e\xeai'), chr(0b111000 + 0o54) + chr(101) + chr(6747 - 6648) + chr(111) + '\x64' + chr(0b11110 + 0o107))(chr(117) + '\x74' + chr(8233 - 8131) + chr(649 - 604) + '\070'))
xafqLlk3kkUe(oqhJDdMJfuwx, xafqLlk3kkUe(SXOLrMavuUCe(b'\xa9va\x87\xea'), '\x64' + chr(0b1100101) + chr(0b101011 + 0o70) + chr(0b1101111) + chr(1765 - 1665) + chr(0b1011011 + 0o12))('\165' + chr(11178 - 11062) + chr(0b11010 + 0o114) + '\055' + chr(0b111000)))(xafqLlk3kkUe(vUTZFbqN0o8F, xafqLlk3kkUe(SXOLrMavuUCe(b'\xbaKP\x85\xe6D\x8e:Lx\xfek'), chr(4509 - 4409) + chr(0b1001101 + 0o30) + chr(0b11 + 0o140) + '\157' + '\x64' + chr(1574 - 1473))(chr(0b1110101) + '\x74' + chr(0b100 + 0o142) + chr(45) + chr(56))), (G02S8JKiQ16r, G02S8JKiQ16r))
else:
xafqLlk3kkUe(jyVHS0IYLm_8, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb8gk\x85\xebt\xb08dP\xc2P\xc9\xfb\x10\x10n\xdd\xbb'), chr(0b1011111 + 0o5) + '\145' + chr(99) + '\157' + chr(0b1001010 + 0o32) + chr(9989 - 9888))(chr(0b1101000 + 0o15) + '\x74' + chr(0b1100100 + 0o2) + chr(45) + '\x38'))(GDZi5OTNos9m, xafqLlk3kkUe(vUTZFbqN0o8F, xafqLlk3kkUe(SXOLrMavuUCe(b'\xafM?\x8f\xbeP\xb0\x13yM\x99^'), chr(0b1100100) + chr(0b1100101 + 0o0) + '\143' + chr(0b1101111) + '\144' + '\x65')('\165' + '\164' + chr(102) + chr(917 - 872) + chr(0b11101 + 0o33))), n4ljua2gi1Pr, dcaitvFqg9pp, decode_to_file=xafqLlk3kkUe(vUTZFbqN0o8F, xafqLlk3kkUe(SXOLrMavuUCe(b'\xbaKP\x85\xe6D\x8e:Lx\xfek'), chr(1981 - 1881) + '\145' + '\x63' + '\157' + chr(0b100 + 0o140) + chr(0b1100101))('\x75' + '\x74' + '\x66' + chr(0b101101) + chr(1053 - 997))), dataset_split=xafqLlk3kkUe(SXOLrMavuUCe(b'\xa8g{\x9e'), '\144' + chr(0b1100101) + chr(887 - 788) + '\157' + chr(0b1100100) + chr(0b1100101))('\165' + '\164' + chr(0b1100110) + chr(770 - 725) + '\x38') if xafqLlk3kkUe(vUTZFbqN0o8F, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb9ti\x86\xd0d\x9c;IK\xca|\xd9\xc5\x17\x14i'), '\x64' + '\x65' + chr(0b1100011) + chr(0b1001000 + 0o47) + chr(0b1100100) + chr(4272 - 4171))(chr(0b1110101) + chr(10366 - 10250) + chr(4635 - 4533) + chr(0b101101) + chr(0b111000))) else None, checkpoint_path=xafqLlk3kkUe(vUTZFbqN0o8F, xafqLlk3kkUe(SXOLrMavuUCe(b'\xbfjm\x89\xe4a\x807xK\xf0\x7f\xcc\xee\x0c'), chr(0b111010 + 0o52) + '\145' + chr(99) + chr(5802 - 5691) + '\x64' + chr(101))(chr(117) + '\164' + chr(9123 - 9021) + '\055' + '\070')))
|
tensorflow/tensor2tensor
|
tensor2tensor/bin/t2t_decoder.py
|
score_file
|
def score_file(filename):
"""Score each line in a file and return the scores."""
# Prepare model.
hparams = create_hparams()
encoders = registry.problem(FLAGS.problem).feature_encoders(FLAGS.data_dir)
has_inputs = "inputs" in encoders
# Prepare features for feeding into the model.
if has_inputs:
inputs_ph = tf.placeholder(dtype=tf.int32) # Just length dimension.
batch_inputs = tf.reshape(inputs_ph, [1, -1, 1, 1]) # Make it 4D.
targets_ph = tf.placeholder(dtype=tf.int32) # Just length dimension.
batch_targets = tf.reshape(targets_ph, [1, -1, 1, 1]) # Make it 4D.
if has_inputs:
features = {"inputs": batch_inputs, "targets": batch_targets}
else:
features = {"targets": batch_targets}
# Prepare the model and the graph when model runs on features.
model = registry.model(FLAGS.model)(hparams, tf.estimator.ModeKeys.EVAL)
_, losses = model(features)
saver = tf.train.Saver()
with tf.Session() as sess:
# Load weights from checkpoint.
if FLAGS.checkpoint_path is None:
ckpts = tf.train.get_checkpoint_state(FLAGS.output_dir)
ckpt = ckpts.model_checkpoint_path
else:
ckpt = FLAGS.checkpoint_path
saver.restore(sess, ckpt)
# Run on each line.
with tf.gfile.Open(filename) as f:
lines = f.readlines()
results = []
for line in lines:
tab_split = line.split("\t")
if len(tab_split) > 2:
raise ValueError("Each line must have at most one tab separator.")
if len(tab_split) == 1:
targets = tab_split[0].strip()
else:
targets = tab_split[1].strip()
inputs = tab_split[0].strip()
# Run encoders and append EOS symbol.
targets_numpy = encoders["targets"].encode(
targets) + [text_encoder.EOS_ID]
if has_inputs:
inputs_numpy = encoders["inputs"].encode(inputs) + [text_encoder.EOS_ID]
# Prepare the feed.
if has_inputs:
feed = {inputs_ph: inputs_numpy, targets_ph: targets_numpy}
else:
feed = {targets_ph: targets_numpy}
# Get the score.
np_loss = sess.run(losses["training"], feed)
results.append(np_loss)
return results
|
python
|
def score_file(filename):
"""Score each line in a file and return the scores."""
# Prepare model.
hparams = create_hparams()
encoders = registry.problem(FLAGS.problem).feature_encoders(FLAGS.data_dir)
has_inputs = "inputs" in encoders
# Prepare features for feeding into the model.
if has_inputs:
inputs_ph = tf.placeholder(dtype=tf.int32) # Just length dimension.
batch_inputs = tf.reshape(inputs_ph, [1, -1, 1, 1]) # Make it 4D.
targets_ph = tf.placeholder(dtype=tf.int32) # Just length dimension.
batch_targets = tf.reshape(targets_ph, [1, -1, 1, 1]) # Make it 4D.
if has_inputs:
features = {"inputs": batch_inputs, "targets": batch_targets}
else:
features = {"targets": batch_targets}
# Prepare the model and the graph when model runs on features.
model = registry.model(FLAGS.model)(hparams, tf.estimator.ModeKeys.EVAL)
_, losses = model(features)
saver = tf.train.Saver()
with tf.Session() as sess:
# Load weights from checkpoint.
if FLAGS.checkpoint_path is None:
ckpts = tf.train.get_checkpoint_state(FLAGS.output_dir)
ckpt = ckpts.model_checkpoint_path
else:
ckpt = FLAGS.checkpoint_path
saver.restore(sess, ckpt)
# Run on each line.
with tf.gfile.Open(filename) as f:
lines = f.readlines()
results = []
for line in lines:
tab_split = line.split("\t")
if len(tab_split) > 2:
raise ValueError("Each line must have at most one tab separator.")
if len(tab_split) == 1:
targets = tab_split[0].strip()
else:
targets = tab_split[1].strip()
inputs = tab_split[0].strip()
# Run encoders and append EOS symbol.
targets_numpy = encoders["targets"].encode(
targets) + [text_encoder.EOS_ID]
if has_inputs:
inputs_numpy = encoders["inputs"].encode(inputs) + [text_encoder.EOS_ID]
# Prepare the feed.
if has_inputs:
feed = {inputs_ph: inputs_numpy, targets_ph: targets_numpy}
else:
feed = {targets_ph: targets_numpy}
# Get the score.
np_loss = sess.run(losses["training"], feed)
results.append(np_loss)
return results
|
[
"def",
"score_file",
"(",
"filename",
")",
":",
"# Prepare model.",
"hparams",
"=",
"create_hparams",
"(",
")",
"encoders",
"=",
"registry",
".",
"problem",
"(",
"FLAGS",
".",
"problem",
")",
".",
"feature_encoders",
"(",
"FLAGS",
".",
"data_dir",
")",
"has_inputs",
"=",
"\"inputs\"",
"in",
"encoders",
"# Prepare features for feeding into the model.",
"if",
"has_inputs",
":",
"inputs_ph",
"=",
"tf",
".",
"placeholder",
"(",
"dtype",
"=",
"tf",
".",
"int32",
")",
"# Just length dimension.",
"batch_inputs",
"=",
"tf",
".",
"reshape",
"(",
"inputs_ph",
",",
"[",
"1",
",",
"-",
"1",
",",
"1",
",",
"1",
"]",
")",
"# Make it 4D.",
"targets_ph",
"=",
"tf",
".",
"placeholder",
"(",
"dtype",
"=",
"tf",
".",
"int32",
")",
"# Just length dimension.",
"batch_targets",
"=",
"tf",
".",
"reshape",
"(",
"targets_ph",
",",
"[",
"1",
",",
"-",
"1",
",",
"1",
",",
"1",
"]",
")",
"# Make it 4D.",
"if",
"has_inputs",
":",
"features",
"=",
"{",
"\"inputs\"",
":",
"batch_inputs",
",",
"\"targets\"",
":",
"batch_targets",
"}",
"else",
":",
"features",
"=",
"{",
"\"targets\"",
":",
"batch_targets",
"}",
"# Prepare the model and the graph when model runs on features.",
"model",
"=",
"registry",
".",
"model",
"(",
"FLAGS",
".",
"model",
")",
"(",
"hparams",
",",
"tf",
".",
"estimator",
".",
"ModeKeys",
".",
"EVAL",
")",
"_",
",",
"losses",
"=",
"model",
"(",
"features",
")",
"saver",
"=",
"tf",
".",
"train",
".",
"Saver",
"(",
")",
"with",
"tf",
".",
"Session",
"(",
")",
"as",
"sess",
":",
"# Load weights from checkpoint.",
"if",
"FLAGS",
".",
"checkpoint_path",
"is",
"None",
":",
"ckpts",
"=",
"tf",
".",
"train",
".",
"get_checkpoint_state",
"(",
"FLAGS",
".",
"output_dir",
")",
"ckpt",
"=",
"ckpts",
".",
"model_checkpoint_path",
"else",
":",
"ckpt",
"=",
"FLAGS",
".",
"checkpoint_path",
"saver",
".",
"restore",
"(",
"sess",
",",
"ckpt",
")",
"# Run on each line.",
"with",
"tf",
".",
"gfile",
".",
"Open",
"(",
"filename",
")",
"as",
"f",
":",
"lines",
"=",
"f",
".",
"readlines",
"(",
")",
"results",
"=",
"[",
"]",
"for",
"line",
"in",
"lines",
":",
"tab_split",
"=",
"line",
".",
"split",
"(",
"\"\\t\"",
")",
"if",
"len",
"(",
"tab_split",
")",
">",
"2",
":",
"raise",
"ValueError",
"(",
"\"Each line must have at most one tab separator.\"",
")",
"if",
"len",
"(",
"tab_split",
")",
"==",
"1",
":",
"targets",
"=",
"tab_split",
"[",
"0",
"]",
".",
"strip",
"(",
")",
"else",
":",
"targets",
"=",
"tab_split",
"[",
"1",
"]",
".",
"strip",
"(",
")",
"inputs",
"=",
"tab_split",
"[",
"0",
"]",
".",
"strip",
"(",
")",
"# Run encoders and append EOS symbol.",
"targets_numpy",
"=",
"encoders",
"[",
"\"targets\"",
"]",
".",
"encode",
"(",
"targets",
")",
"+",
"[",
"text_encoder",
".",
"EOS_ID",
"]",
"if",
"has_inputs",
":",
"inputs_numpy",
"=",
"encoders",
"[",
"\"inputs\"",
"]",
".",
"encode",
"(",
"inputs",
")",
"+",
"[",
"text_encoder",
".",
"EOS_ID",
"]",
"# Prepare the feed.",
"if",
"has_inputs",
":",
"feed",
"=",
"{",
"inputs_ph",
":",
"inputs_numpy",
",",
"targets_ph",
":",
"targets_numpy",
"}",
"else",
":",
"feed",
"=",
"{",
"targets_ph",
":",
"targets_numpy",
"}",
"# Get the score.",
"np_loss",
"=",
"sess",
".",
"run",
"(",
"losses",
"[",
"\"training\"",
"]",
",",
"feed",
")",
"results",
".",
"append",
"(",
"np_loss",
")",
"return",
"results"
] |
Score each line in a file and return the scores.
|
[
"Score",
"each",
"line",
"in",
"a",
"file",
"and",
"return",
"the",
"scores",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/bin/t2t_decoder.py#L107-L164
|
train
|
Score each line in a file and return the scores.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDASQ0Qkq,NL8dtWOpbcjF,_bikzMuRfbJG,sznFqDbNBHlx,ZsDPvpP4xdo3,cW7yQuyE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pI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(51) + chr(0b110101) + chr(2431 - 2378), 0b1000), ehT0Px3KOsy9(chr(0b10101 + 0o33) + chr(0b1111 + 0o140) + chr(0b10001 + 0o41) + chr(53) + '\x35', ord("\x08")), ehT0Px3KOsy9(chr(1898 - 1850) + '\157' + '\x31' + chr(0b100101 + 0o20), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1010001 + 0o36) + chr(0b101011 + 0o7) + chr(54), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(0b11101 + 0o26) + '\067' + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(49) + chr(0b1110 + 0o42) + chr(0b110000), 63826 - 63818), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(51) + chr(0b110110) + chr(0b10100 + 0o37), ord("\x08")), ehT0Px3KOsy9(chr(1390 - 1342) + '\157' + chr(52), 0b1000), ehT0Px3KOsy9(chr(106 - 58) + chr(0b100001 + 0o116) + '\x32' + chr(2264 - 2216), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110011) + chr(49), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b110110 + 0o71) + '\x33' + '\x37' + chr(861 - 808), ord("\x08")), ehT0Px3KOsy9(chr(273 - 225) + '\157' + chr(0b10001 + 0o41) + chr(49) + chr(0b110110), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b100011 + 0o16) + '\x31' + chr(0b10111 + 0o36), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(9690 - 9579) + chr(0b101100 + 0o12) + chr(50), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(1636 - 1587) + '\063' + chr(0b100011 + 0o21), 0b1000), ehT0Px3KOsy9('\060' + chr(0b111001 + 0o66) + chr(311 - 262) + '\061' + '\060', 25527 - 25519), ehT0Px3KOsy9(chr(1666 - 1618) + chr(0b1101111) + chr(2330 - 2280) + chr(0b110010 + 0o2) + chr(1491 - 1443), 40539 - 40531), ehT0Px3KOsy9(chr(0b11010 + 0o26) + '\x6f' + chr(2019 - 1969) + chr(55) + chr(0b110111), 0o10), ehT0Px3KOsy9(chr(1571 - 1523) + chr(111) + chr(0b1110 + 0o45) + chr(0b110111) + chr(2062 - 2008), ord("\x08")), ehT0Px3KOsy9(chr(0b10011 + 0o35) + '\x6f' + chr(0b10001 + 0o46), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\062' + chr(0b1100 + 0o44) + '\060', 36886 - 36878), ehT0Px3KOsy9(chr(48) + chr(111) + '\x32' + chr(0b11100 + 0o25) + chr(1238 - 1186), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(49) + chr(51) + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(1016 - 966) + chr(48), 8), ehT0Px3KOsy9('\060' + '\x6f' + '\x31' + chr(52) + '\064', 44929 - 44921), ehT0Px3KOsy9(chr(1926 - 1878) + chr(0b1101111) + chr(1362 - 1312) + '\067' + chr(48), 58742 - 58734), ehT0Px3KOsy9('\x30' + chr(0b1101110 + 0o1) + '\x33' + chr(0b110110), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110011) + chr(0b101000 + 0o11) + '\x37', 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b100011 + 0o15), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x31' + '\x33' + chr(0b110111), 14574 - 14566), ehT0Px3KOsy9('\x30' + '\157' + chr(51) + '\066' + chr(0b0 + 0o61), ord("\x08")), ehT0Px3KOsy9(chr(1957 - 1909) + '\x6f' + chr(2560 - 2509) + chr(49) + '\x37', 8), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x31' + '\060' + chr(2326 - 2271), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(50) + '\060' + chr(0b100010 + 0o21), 64181 - 64173), ehT0Px3KOsy9(chr(1014 - 966) + '\157' + '\x31' + '\066' + chr(2584 - 2531), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\061' + chr(0b110101) + '\063', 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(515 - 466) + '\062' + chr(52), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(51) + chr(460 - 411) + chr(51), 0o10), ehT0Px3KOsy9(chr(2261 - 2213) + '\157' + chr(0b110010) + chr(0b110010 + 0o1) + chr(0b100011 + 0o15), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(0b100010 + 0o21) + chr(1627 - 1574) + chr(48), ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110101) + chr(413 - 365), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xc3'), chr(0b10001 + 0o123) + chr(0b1100101) + '\143' + chr(2029 - 1918) + chr(0b1100100) + '\145')(chr(0b11110 + 0o127) + '\164' + chr(0b1100110) + '\055' + chr(0b11100 + 0o34)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def RazrnlnbQZz1(xw4DsBfIJ22E):
n4ljua2gi1Pr = FPakHinFMgZb()
eY3hiWLaPZXu = U24OBsRcVqkJ.problem(vUTZFbqN0o8F.problem).feature_encoders(vUTZFbqN0o8F.kVFRD544hi_1)
qu4HiXSHnlzD = xafqLlk3kkUe(SXOLrMavuUCe(b'\x84\xc3}c\x8c3'), '\x64' + chr(101) + chr(0b11111 + 0o104) + '\x6f' + chr(100) + chr(0b1100101))(chr(117) + chr(116) + chr(0b1100110) + chr(1719 - 1674) + '\070') in eY3hiWLaPZXu
if qu4HiXSHnlzD:
nG7WiTRY8m8d = IDJ2eXGCBCDu.placeholder(dtype=IDJ2eXGCBCDu.int32)
eODVD1XFDCfc = IDJ2eXGCBCDu.reshape(nG7WiTRY8m8d, [ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\061', 0o10), -ehT0Px3KOsy9(chr(1490 - 1442) + chr(0b1010111 + 0o30) + chr(1918 - 1869), 8), ehT0Px3KOsy9(chr(48) + '\157' + '\x31', 8), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(943 - 894), 8)])
id1pYzbfe7XU = IDJ2eXGCBCDu.placeholder(dtype=IDJ2eXGCBCDu.int32)
MHOTVg4Rsx5b = IDJ2eXGCBCDu.reshape(id1pYzbfe7XU, [ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(836 - 787), 8), -ehT0Px3KOsy9(chr(149 - 101) + chr(7167 - 7056) + chr(0b100001 + 0o20), 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b11111 + 0o120) + chr(49), 8), ehT0Px3KOsy9(chr(0b1100 + 0o44) + '\157' + chr(1419 - 1370), 8)])
if qu4HiXSHnlzD:
EEf4r9nUvta_ = {xafqLlk3kkUe(SXOLrMavuUCe(b'\x84\xc3}c\x8c3'), chr(100) + chr(101) + '\x63' + '\x6f' + chr(0b100111 + 0o75) + '\145')(chr(117) + chr(0b100011 + 0o121) + chr(0b1100110) + '\x2d' + chr(1052 - 996)): eODVD1XFDCfc, xafqLlk3kkUe(SXOLrMavuUCe(b'\x99\xcc\x7fq\x9d4\x80'), chr(0b1100100) + chr(101) + chr(0b1011101 + 0o6) + '\x6f' + '\x64' + chr(101))(chr(12314 - 12197) + chr(0b100000 + 0o124) + chr(0b100101 + 0o101) + '\055' + '\070'): MHOTVg4Rsx5b}
else:
EEf4r9nUvta_ = {xafqLlk3kkUe(SXOLrMavuUCe(b'\x99\xcc\x7fq\x9d4\x80'), chr(9407 - 9307) + chr(7043 - 6942) + chr(748 - 649) + chr(111) + chr(100) + '\145')(chr(0b1110101) + '\x74' + '\146' + chr(45) + chr(0b1111 + 0o51)): MHOTVg4Rsx5b}
FK0vqzZ5gPN6 = U24OBsRcVqkJ.FK0vqzZ5gPN6(vUTZFbqN0o8F.FK0vqzZ5gPN6)(n4ljua2gi1Pr, IDJ2eXGCBCDu.estimator.ModeKeys.EVAL)
(VNGQdHSFPrso, eJKWkHA7qzlZ) = FK0vqzZ5gPN6(EEf4r9nUvta_)
nbAEz8Euou1e = IDJ2eXGCBCDu.train.Saver()
with xafqLlk3kkUe(IDJ2eXGCBCDu, xafqLlk3kkUe(SXOLrMavuUCe(b'\xbe\xc8~e\x91/\x9d'), chr(0b1100100) + chr(6274 - 6173) + chr(0b1100011) + chr(0b1101111) + chr(0b1100100) + chr(0b1000 + 0o135))(chr(6407 - 6290) + '\x74' + '\x66' + '\x2d' + chr(0b111000)))() as HVWCHjSQ2I35:
if xafqLlk3kkUe(vUTZFbqN0o8F, xafqLlk3kkUe(SXOLrMavuUCe(b'\x8e\xc5hu\x930\x9cm~m\xa2\xfe,F4'), chr(0b1100100) + '\145' + '\143' + '\157' + '\144' + '\145')(chr(0b1001111 + 0o46) + chr(0b1110100) + chr(102) + chr(1817 - 1772) + chr(126 - 70))) is None:
YeSGN4amEwg1 = IDJ2eXGCBCDu.train.get_checkpoint_state(vUTZFbqN0o8F.nd0OX_BS6_o4)
NjM4QqAJGres = YeSGN4amEwg1.model_checkpoint_path
else:
NjM4QqAJGres = vUTZFbqN0o8F.checkpoint_path
xafqLlk3kkUe(nbAEz8Euou1e, xafqLlk3kkUe(SXOLrMavuUCe(b'\x9f\xc8~b\x972\x96'), chr(0b1011010 + 0o12) + '\145' + '\x63' + chr(111) + '\144' + chr(101))(chr(4449 - 4332) + chr(116) + chr(9956 - 9854) + chr(880 - 835) + '\x38'))(HVWCHjSQ2I35, NjM4QqAJGres)
with xafqLlk3kkUe(IDJ2eXGCBCDu.gfile, xafqLlk3kkUe(SXOLrMavuUCe(b'\xa2\xddhx'), chr(100) + chr(101) + chr(2633 - 2534) + chr(9314 - 9203) + chr(5373 - 5273) + chr(101))(chr(0b100011 + 0o122) + '\x74' + chr(102) + chr(0b101101) + chr(56)))(xw4DsBfIJ22E) as EGyt1xfPT1P6:
izUh4XSf7tJY = EGyt1xfPT1P6.readlines()
iIGKX2zSEGYP = []
for LycYkDpyelF6 in izUh4XSf7tJY:
gjYcX4aGNyEN = LycYkDpyelF6.split(xafqLlk3kkUe(SXOLrMavuUCe(b'\xe4'), '\144' + chr(4949 - 4848) + chr(0b1100011) + '\157' + chr(0b1100100) + '\145')(chr(0b1110101) + chr(116) + chr(102) + chr(1762 - 1717) + chr(0b111000)))
if c2A0yzQpDQB3(gjYcX4aGNyEN) > ehT0Px3KOsy9(chr(48) + chr(111) + chr(50), 0b1000):
raise q1QCh3W88sgk(xafqLlk3kkUe(SXOLrMavuUCe(b"\xa8\xccn~\xd8,\x9aju9\x90\xfb>F| \xc1\xc9\x9b'\xe1\xf8~}\x0b\xcbj\xefo1\x94\xef3\xe2\x17K'\xae\xe8\x89\x9f\xccyy\x8an"), chr(100) + chr(101) + chr(99) + chr(5388 - 5277) + chr(100) + '\x65')(chr(9926 - 9809) + chr(11563 - 11447) + chr(102) + chr(0b100 + 0o51) + '\070'))
if c2A0yzQpDQB3(gjYcX4aGNyEN) == ehT0Px3KOsy9('\060' + chr(1211 - 1100) + chr(49), 8):
xIEmRseySp3z = gjYcX4aGNyEN[ehT0Px3KOsy9(chr(48) + chr(3515 - 3404) + '\x30', 8)].strip()
else:
xIEmRseySp3z = gjYcX4aGNyEN[ehT0Px3KOsy9('\x30' + chr(10424 - 10313) + chr(49), 8)].strip()
vXoupepMtCXU = gjYcX4aGNyEN[ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110 + 0o52), 8)].strip()
qVfWXyUGCMxf = eY3hiWLaPZXu[xafqLlk3kkUe(SXOLrMavuUCe(b'\x99\xcc\x7fq\x9d4\x80'), '\144' + '\x65' + chr(0b1010110 + 0o15) + chr(0b1101111) + chr(100) + chr(4967 - 4866))('\165' + '\164' + chr(0b1100110) + chr(1723 - 1678) + '\x38')].encode(xIEmRseySp3z) + [nCRDzZ_Is9fz.EOS_ID]
if qu4HiXSHnlzD:
w3YHPJXWU8yY = eY3hiWLaPZXu[xafqLlk3kkUe(SXOLrMavuUCe(b'\x84\xc3}c\x8c3'), chr(100) + '\145' + chr(0b1100011) + '\x6f' + chr(1189 - 1089) + chr(0b100100 + 0o101))('\x75' + '\x74' + '\x66' + chr(0b11001 + 0o24) + chr(243 - 187))].encode(vXoupepMtCXU) + [nCRDzZ_Is9fz.EOS_ID]
if qu4HiXSHnlzD:
hvmrINhTaZN9 = {nG7WiTRY8m8d: w3YHPJXWU8yY, id1pYzbfe7XU: qVfWXyUGCMxf}
else:
hvmrINhTaZN9 = {id1pYzbfe7XU: qVfWXyUGCMxf}
sDpQ_Pt0vwnC = HVWCHjSQ2I35.sgt5BU61bwZ2(eJKWkHA7qzlZ[xafqLlk3kkUe(SXOLrMavuUCe(b'\x99\xdfl\x7f\x96)\x9dc'), chr(100) + chr(2012 - 1911) + chr(8094 - 7995) + chr(111) + chr(0b1100100) + chr(0b1100101))('\x75' + chr(5907 - 5791) + '\x66' + chr(0b1 + 0o54) + chr(706 - 650))], hvmrINhTaZN9)
xafqLlk3kkUe(iIGKX2zSEGYP, xafqLlk3kkUe(SXOLrMavuUCe(b'\x8c\xdd}s\x96$'), chr(418 - 318) + '\x65' + chr(0b1100011) + chr(7681 - 7570) + chr(0b1100100) + chr(0b1001 + 0o134))(chr(0b10010 + 0o143) + chr(0b1110100) + '\x66' + chr(0b101101) + '\x38'))(sDpQ_Pt0vwnC)
return iIGKX2zSEGYP
|
tensorflow/tensor2tensor
|
tensor2tensor/models/research/autoencoders.py
|
time_to_channels
|
def time_to_channels(embedded_video):
"""Put time dimension on channels in an embedded video."""
video_shape = common_layers.shape_list(embedded_video)
if len(video_shape) != 5:
raise ValueError("Assuming videos given as tensors in the format "
"[batch, time, height, width, channels] but got one "
"of shape: %s" % str(video_shape))
transposed = tf.transpose(embedded_video, [0, 2, 3, 1, 4])
return tf.reshape(transposed, [
video_shape[0], video_shape[2], video_shape[3],
video_shape[1] * video_shape[4]
])
|
python
|
def time_to_channels(embedded_video):
"""Put time dimension on channels in an embedded video."""
video_shape = common_layers.shape_list(embedded_video)
if len(video_shape) != 5:
raise ValueError("Assuming videos given as tensors in the format "
"[batch, time, height, width, channels] but got one "
"of shape: %s" % str(video_shape))
transposed = tf.transpose(embedded_video, [0, 2, 3, 1, 4])
return tf.reshape(transposed, [
video_shape[0], video_shape[2], video_shape[3],
video_shape[1] * video_shape[4]
])
|
[
"def",
"time_to_channels",
"(",
"embedded_video",
")",
":",
"video_shape",
"=",
"common_layers",
".",
"shape_list",
"(",
"embedded_video",
")",
"if",
"len",
"(",
"video_shape",
")",
"!=",
"5",
":",
"raise",
"ValueError",
"(",
"\"Assuming videos given as tensors in the format \"",
"\"[batch, time, height, width, channels] but got one \"",
"\"of shape: %s\"",
"%",
"str",
"(",
"video_shape",
")",
")",
"transposed",
"=",
"tf",
".",
"transpose",
"(",
"embedded_video",
",",
"[",
"0",
",",
"2",
",",
"3",
",",
"1",
",",
"4",
"]",
")",
"return",
"tf",
".",
"reshape",
"(",
"transposed",
",",
"[",
"video_shape",
"[",
"0",
"]",
",",
"video_shape",
"[",
"2",
"]",
",",
"video_shape",
"[",
"3",
"]",
",",
"video_shape",
"[",
"1",
"]",
"*",
"video_shape",
"[",
"4",
"]",
"]",
")"
] |
Put time dimension on channels in an embedded video.
|
[
"Put",
"time",
"dimension",
"on",
"channels",
"in",
"an",
"embedded",
"video",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/models/research/autoencoders.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ZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(48) + chr(111) + chr(2352 - 2302), 0o10), ehT0Px3KOsy9('\x30' + '\157' + '\x32' + chr(0b110111) + '\066', ord("\x08")), ehT0Px3KOsy9(chr(499 - 451) + chr(0b1101111) + chr(2012 - 1962) + '\061' + chr(0b110100 + 0o1), 48940 - 48932), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b10000 + 0o45) + chr(0b1001 + 0o51), ord("\x08")), ehT0Px3KOsy9(chr(51 - 3) + chr(0b1101111) + chr(0b110001) + chr(830 - 776) + chr(54), 23642 - 23634), ehT0Px3KOsy9(chr(0b10011 + 0o35) + chr(111) + chr(0b110001) + '\x35' + chr(54), 0o10), ehT0Px3KOsy9('\060' + '\157' + '\x31' + '\x33' + '\x36', 0o10), ehT0Px3KOsy9(chr(0b101010 + 0o6) + chr(0b1101111) + chr(50) + '\065' + chr(49), ord("\x08")), ehT0Px3KOsy9(chr(2010 - 1962) + '\x6f' + chr(0b100001 + 0o22) + '\063', 48471 - 48463), ehT0Px3KOsy9(chr(0b1001 + 0o47) + chr(0b1101111) + chr(49) + chr(55) + '\061', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(9460 - 9349) + chr(0b110 + 0o55) + chr(1265 - 1217) + chr(0b110110), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(6524 - 6413) + '\x37' + '\062', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b110101 + 0o72) + chr(0b10111 + 0o33) + '\x34' + '\063', 57179 - 57171), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110001) + '\065' + chr(0b111 + 0o56), 44972 - 44964), ehT0Px3KOsy9(chr(48) + chr(0b1100001 + 0o16) + chr(415 - 364) + chr(122 - 71), 8), ehT0Px3KOsy9(chr(70 - 22) + chr(0b1110 + 0o141) + chr(1815 - 1766) + chr(48) + '\063', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b11101 + 0o122) + chr(0b11011 + 0o26) + chr(53) + chr(1597 - 1545), ord("\x08")), ehT0Px3KOsy9(chr(0b1111 + 0o41) + chr(0b10000 + 0o137) + chr(0b1100 + 0o47) + chr(0b110 + 0o54), 0o10), ehT0Px3KOsy9(chr(0b1001 + 0o47) + '\x6f' + chr(55) + '\060', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b10000 + 0o42) + chr(0b110110) + '\x37', ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + chr(0b11001 + 0o32) + chr(1142 - 1090) + chr(49), 61765 - 61757), ehT0Px3KOsy9('\060' + chr(0b1101010 + 0o5) + '\061' + '\x35' + '\060', 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101000 + 0o7) + chr(2455 - 2405) + '\x31' + chr(52), 0b1000), ehT0Px3KOsy9(chr(566 - 518) + chr(0b1010 + 0o145) + '\062' + chr(0b110001) + chr(904 - 855), 0o10), ehT0Px3KOsy9(chr(0b101 + 0o53) + chr(0b1101111) + chr(49) + chr(0b110011) + '\x34', 0b1000), ehT0Px3KOsy9('\x30' + chr(425 - 314) + '\x33' + chr(54), 55621 - 55613), ehT0Px3KOsy9(chr(0b110000) + chr(0b11101 + 0o122) + chr(0b110011) + '\x35' + '\x35', 0b1000), ehT0Px3KOsy9('\060' + chr(3136 - 3025) + chr(0b101110 + 0o3) + chr(0b11101 + 0o27) + chr(0b11 + 0o56), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110010) + '\064' + '\x36', 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(140 - 91) + '\x32' + chr(1238 - 1187), 0o10), ehT0Px3KOsy9('\x30' + chr(2460 - 2349) + chr(0b110001) + chr(0b110110) + chr(2376 - 2323), ord("\x08")), ehT0Px3KOsy9(chr(1868 - 1820) + chr(11165 - 11054) + '\x33' + chr(2629 - 2576) + chr(52), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(1088 - 1038) + chr(1928 - 1874) + chr(0b100 + 0o56), 38884 - 38876), ehT0Px3KOsy9(chr(0b110000) + chr(5401 - 5290) + chr(0b11101 + 0o24) + chr(52) + chr(52), 54672 - 54664), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(1600 - 1551) + chr(369 - 314) + chr(0b110010), 63475 - 63467), ehT0Px3KOsy9(chr(48) + chr(0b10 + 0o155) + chr(51) + chr(54), 8), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b101 + 0o55) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(6375 - 6264) + '\062' + chr(53) + '\060', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\066' + chr(0b110110), 4284 - 4276), ehT0Px3KOsy9('\x30' + '\157' + chr(2306 - 2257) + chr(0b110000 + 0o2) + chr(0b11011 + 0o30), 8)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + '\157' + chr(0b110101) + '\x30', 37379 - 37371)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b','), chr(0b110111 + 0o55) + chr(101) + '\x63' + chr(4370 - 4259) + chr(0b1100100) + chr(0b1100011 + 0o2))(chr(10911 - 10794) + chr(116) + '\x66' + chr(0b1001 + 0o44) + '\x38') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def Tx8HfrQS3lT4(lLCoSh49ktv5):
yK64m0eFyaVx = jSKPaHwSAfVv.shape_list(lLCoSh49ktv5)
if c2A0yzQpDQB3(yK64m0eFyaVx) != ehT0Px3KOsy9(chr(0b110000) + chr(1049 - 938) + chr(0b110101), 0b1000):
raise q1QCh3W88sgk(xafqLlk3kkUe(SXOLrMavuUCe(b'C\xcd\xfe_\x1b\x070\xce;\x0f\xaf^\xc6\x02hc\x0bsN\xd2\x8fH\xed\xfa|j\x88\x0f\xd5<\x07\x9f\x92\r\x14>`\xc0Ssd\xd1\xffG\x17\x1a~\xf2y\x18\xb2Y\xcbA;7\x05w]\x9b\xc1\x00\xe9\xe0;v\x99M\x86$\x1c\x88\xc6\x0cV>w\xc0W=l\xdb\xe1Y+N<\xdcoY\xa1U\xd7Mt-\t:W\xd1\xc1\x1b\xe4\xe8,{\xd7A\x83 '), chr(0b1010011 + 0o21) + '\x65' + chr(99) + chr(111) + '\x64' + chr(4613 - 4512))(chr(3166 - 3049) + chr(345 - 229) + chr(7638 - 7536) + chr(1147 - 1102) + chr(0b111000)) % M8_cKLkHVB2V(yK64m0eFyaVx))
BrtGnLRws8hM = IDJ2eXGCBCDu.transpose(lLCoSh49ktv5, [ehT0Px3KOsy9(chr(0b10001 + 0o37) + '\157' + '\x30', ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + chr(50), 8), ehT0Px3KOsy9('\060' + '\157' + '\x33', 56890 - 56882), ehT0Px3KOsy9(chr(0b100010 + 0o16) + chr(0b1101111) + '\x31', 0b1000), ehT0Px3KOsy9(chr(2074 - 2026) + chr(0b1101111) + '\064', ord("\x08"))])
return xafqLlk3kkUe(IDJ2eXGCBCDu, xafqLlk3kkUe(SXOLrMavuUCe(b'p\xdb\xfeB\x17\x1e;'), chr(100) + chr(6144 - 6043) + '\143' + chr(111) + chr(100) + chr(0b1100101))(chr(0b1011010 + 0o33) + chr(0b1110100) + chr(102) + chr(0b101101) + chr(0b110110 + 0o2)))(BrtGnLRws8hM, [yK64m0eFyaVx[ehT0Px3KOsy9(chr(2288 - 2240) + '\x6f' + chr(48), 8)], yK64m0eFyaVx[ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110010), 8)], yK64m0eFyaVx[ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x33', 8)], yK64m0eFyaVx[ehT0Px3KOsy9(chr(0b1000 + 0o50) + chr(0b11110 + 0o121) + chr(0b1 + 0o60), 8)] * yK64m0eFyaVx[ehT0Px3KOsy9(chr(796 - 748) + chr(0b1101111) + chr(2096 - 2044), 8)]])
|
tensorflow/tensor2tensor
|
tensor2tensor/models/research/autoencoders.py
|
autoencoder_basic
|
def autoencoder_basic():
"""Basic autoencoder model."""
hparams = common_hparams.basic_params1()
hparams.optimizer = "adam"
hparams.learning_rate_constant = 0.0002
hparams.learning_rate_warmup_steps = 500
hparams.learning_rate_schedule = "constant * linear_warmup"
hparams.label_smoothing = 0.0
hparams.batch_size = 128
hparams.hidden_size = 64
hparams.num_hidden_layers = 5
hparams.initializer = "uniform_unit_scaling"
hparams.initializer_gain = 1.0
hparams.weight_decay = 0.0
hparams.kernel_height = 4
hparams.kernel_width = 4
hparams.dropout = 0.05
hparams.add_hparam("max_hidden_size", 1024)
hparams.add_hparam("bottleneck_bits", 128)
hparams.add_hparam("bottleneck_shared_bits", 0)
hparams.add_hparam("bottleneck_shared_bits_start_warmup", 0)
hparams.add_hparam("bottleneck_shared_bits_stop_warmup", 0)
hparams.add_hparam("bottleneck_noise", 0.1)
hparams.add_hparam("bottleneck_warmup_steps", 2000)
hparams.add_hparam("sample_height", 32)
hparams.add_hparam("sample_width", 32)
hparams.add_hparam("discriminator_batchnorm", True)
hparams.add_hparam("num_sliced_vecs", 20000)
hparams.add_hparam("sliced_do_tanh", int(True))
hparams.add_hparam("discriminator_size", 256)
hparams.add_hparam("discriminator_kernel_size", 6)
hparams.add_hparam("discriminator_strides", 4)
hparams.add_hparam("discriminator_pure_mean", int(False))
hparams.add_hparam("code_loss_factor", 1.0)
hparams.add_hparam("gan_codes_warmup_steps", 16000)
hparams.add_hparam("gan_loss_factor", 0.0)
hparams.add_hparam("bottleneck_l2_factor", 0.05)
hparams.add_hparam("gumbel_temperature", 0.5)
hparams.add_hparam("gumbel_noise_factor", 0.5)
hparams.add_hparam("vq_temperature", 0.001)
hparams.add_hparam("use_vq_loss", int(False))
hparams.add_hparam("discriminator", "double")
return hparams
|
python
|
def autoencoder_basic():
"""Basic autoencoder model."""
hparams = common_hparams.basic_params1()
hparams.optimizer = "adam"
hparams.learning_rate_constant = 0.0002
hparams.learning_rate_warmup_steps = 500
hparams.learning_rate_schedule = "constant * linear_warmup"
hparams.label_smoothing = 0.0
hparams.batch_size = 128
hparams.hidden_size = 64
hparams.num_hidden_layers = 5
hparams.initializer = "uniform_unit_scaling"
hparams.initializer_gain = 1.0
hparams.weight_decay = 0.0
hparams.kernel_height = 4
hparams.kernel_width = 4
hparams.dropout = 0.05
hparams.add_hparam("max_hidden_size", 1024)
hparams.add_hparam("bottleneck_bits", 128)
hparams.add_hparam("bottleneck_shared_bits", 0)
hparams.add_hparam("bottleneck_shared_bits_start_warmup", 0)
hparams.add_hparam("bottleneck_shared_bits_stop_warmup", 0)
hparams.add_hparam("bottleneck_noise", 0.1)
hparams.add_hparam("bottleneck_warmup_steps", 2000)
hparams.add_hparam("sample_height", 32)
hparams.add_hparam("sample_width", 32)
hparams.add_hparam("discriminator_batchnorm", True)
hparams.add_hparam("num_sliced_vecs", 20000)
hparams.add_hparam("sliced_do_tanh", int(True))
hparams.add_hparam("discriminator_size", 256)
hparams.add_hparam("discriminator_kernel_size", 6)
hparams.add_hparam("discriminator_strides", 4)
hparams.add_hparam("discriminator_pure_mean", int(False))
hparams.add_hparam("code_loss_factor", 1.0)
hparams.add_hparam("gan_codes_warmup_steps", 16000)
hparams.add_hparam("gan_loss_factor", 0.0)
hparams.add_hparam("bottleneck_l2_factor", 0.05)
hparams.add_hparam("gumbel_temperature", 0.5)
hparams.add_hparam("gumbel_noise_factor", 0.5)
hparams.add_hparam("vq_temperature", 0.001)
hparams.add_hparam("use_vq_loss", int(False))
hparams.add_hparam("discriminator", "double")
return hparams
|
[
"def",
"autoencoder_basic",
"(",
")",
":",
"hparams",
"=",
"common_hparams",
".",
"basic_params1",
"(",
")",
"hparams",
".",
"optimizer",
"=",
"\"adam\"",
"hparams",
".",
"learning_rate_constant",
"=",
"0.0002",
"hparams",
".",
"learning_rate_warmup_steps",
"=",
"500",
"hparams",
".",
"learning_rate_schedule",
"=",
"\"constant * linear_warmup\"",
"hparams",
".",
"label_smoothing",
"=",
"0.0",
"hparams",
".",
"batch_size",
"=",
"128",
"hparams",
".",
"hidden_size",
"=",
"64",
"hparams",
".",
"num_hidden_layers",
"=",
"5",
"hparams",
".",
"initializer",
"=",
"\"uniform_unit_scaling\"",
"hparams",
".",
"initializer_gain",
"=",
"1.0",
"hparams",
".",
"weight_decay",
"=",
"0.0",
"hparams",
".",
"kernel_height",
"=",
"4",
"hparams",
".",
"kernel_width",
"=",
"4",
"hparams",
".",
"dropout",
"=",
"0.05",
"hparams",
".",
"add_hparam",
"(",
"\"max_hidden_size\"",
",",
"1024",
")",
"hparams",
".",
"add_hparam",
"(",
"\"bottleneck_bits\"",
",",
"128",
")",
"hparams",
".",
"add_hparam",
"(",
"\"bottleneck_shared_bits\"",
",",
"0",
")",
"hparams",
".",
"add_hparam",
"(",
"\"bottleneck_shared_bits_start_warmup\"",
",",
"0",
")",
"hparams",
".",
"add_hparam",
"(",
"\"bottleneck_shared_bits_stop_warmup\"",
",",
"0",
")",
"hparams",
".",
"add_hparam",
"(",
"\"bottleneck_noise\"",
",",
"0.1",
")",
"hparams",
".",
"add_hparam",
"(",
"\"bottleneck_warmup_steps\"",
",",
"2000",
")",
"hparams",
".",
"add_hparam",
"(",
"\"sample_height\"",
",",
"32",
")",
"hparams",
".",
"add_hparam",
"(",
"\"sample_width\"",
",",
"32",
")",
"hparams",
".",
"add_hparam",
"(",
"\"discriminator_batchnorm\"",
",",
"True",
")",
"hparams",
".",
"add_hparam",
"(",
"\"num_sliced_vecs\"",
",",
"20000",
")",
"hparams",
".",
"add_hparam",
"(",
"\"sliced_do_tanh\"",
",",
"int",
"(",
"True",
")",
")",
"hparams",
".",
"add_hparam",
"(",
"\"discriminator_size\"",
",",
"256",
")",
"hparams",
".",
"add_hparam",
"(",
"\"discriminator_kernel_size\"",
",",
"6",
")",
"hparams",
".",
"add_hparam",
"(",
"\"discriminator_strides\"",
",",
"4",
")",
"hparams",
".",
"add_hparam",
"(",
"\"discriminator_pure_mean\"",
",",
"int",
"(",
"False",
")",
")",
"hparams",
".",
"add_hparam",
"(",
"\"code_loss_factor\"",
",",
"1.0",
")",
"hparams",
".",
"add_hparam",
"(",
"\"gan_codes_warmup_steps\"",
",",
"16000",
")",
"hparams",
".",
"add_hparam",
"(",
"\"gan_loss_factor\"",
",",
"0.0",
")",
"hparams",
".",
"add_hparam",
"(",
"\"bottleneck_l2_factor\"",
",",
"0.05",
")",
"hparams",
".",
"add_hparam",
"(",
"\"gumbel_temperature\"",
",",
"0.5",
")",
"hparams",
".",
"add_hparam",
"(",
"\"gumbel_noise_factor\"",
",",
"0.5",
")",
"hparams",
".",
"add_hparam",
"(",
"\"vq_temperature\"",
",",
"0.001",
")",
"hparams",
".",
"add_hparam",
"(",
"\"use_vq_loss\"",
",",
"int",
"(",
"False",
")",
")",
"hparams",
".",
"add_hparam",
"(",
"\"discriminator\"",
",",
"\"double\"",
")",
"return",
"hparams"
] |
Basic autoencoder model.
|
[
"Basic",
"autoencoder",
"model",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/models/research/autoencoders.py#L1027-L1069
|
train
|
Basic autoencoder model.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZ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oAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b11000 + 0o31) + '\x33', 0o10), ehT0Px3KOsy9(chr(0b100 + 0o54) + '\157' + '\063' + chr(54) + '\x35', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110010) + chr(1180 - 1132) + chr(2453 - 2403), ord("\x08")), ehT0Px3KOsy9(chr(243 - 195) + '\157' + chr(2095 - 2045) + chr(0b10001 + 0o41) + '\x30', 61254 - 61246), ehT0Px3KOsy9(chr(48) + chr(0b111101 + 0o62) + '\x32' + chr(0b11 + 0o64) + '\x33', 53393 - 53385), ehT0Px3KOsy9('\060' + chr(111) + chr(0b100011 + 0o17) + '\x37' + chr(0b100110 + 0o17), 29426 - 29418), ehT0Px3KOsy9(chr(48) + chr(0b1011 + 0o144) + chr(148 - 97) + '\x37' + '\x34', 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(0b101000 + 0o16) + '\x32', 43197 - 43189), ehT0Px3KOsy9('\060' + chr(272 - 161) + chr(0b101111 + 0o3) + chr(1108 - 1059) + '\067', ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + '\063' + chr(48) + '\x35', 0o10), ehT0Px3KOsy9(chr(48) + '\157' + '\x33' + chr(49) + '\067', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(5610 - 5499) + chr(0b110011) + chr(0b110100) + chr(0b1000 + 0o54), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\063' + chr(0b110000) + '\063', ord("\x08")), ehT0Px3KOsy9(chr(0b100110 + 0o12) + '\x6f' + '\064' + '\x30', 0o10), ehT0Px3KOsy9('\x30' + chr(10071 - 9960) + chr(49) + '\067' + chr(0b110111), 11729 - 11721), ehT0Px3KOsy9('\060' + chr(111) + '\062' + chr(0b110101) + chr(0b10011 + 0o35), 40690 - 40682), ehT0Px3KOsy9(chr(0b10111 + 0o31) + chr(0b10010 + 0o135) + chr(0b110010) + chr(0b100101 + 0o14) + chr(59 - 11), 14703 - 14695), ehT0Px3KOsy9(chr(0b110000) + chr(4199 - 4088) + chr(50) + chr(0b110101) + chr(1910 - 1861), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101001 + 0o6) + chr(1339 - 1290) + chr(0b110110) + '\x33', 61963 - 61955), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110011) + chr(0b10000 + 0o43) + '\061', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + '\061' + '\060' + chr(0b100100 + 0o15), 3968 - 3960), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110010) + chr(1786 - 1738) + chr(1306 - 1253), 0o10), ehT0Px3KOsy9(chr(0b11010 + 0o26) + '\157' + chr(0b110110) + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(8498 - 8387) + '\063' + chr(0b110101) + chr(54), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1010 + 0o145) + chr(0b10000 + 0o42) + chr(0b110011) + chr(774 - 721), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(128 - 79) + chr(0b110011) + chr(124 - 75), 24203 - 24195), ehT0Px3KOsy9(chr(48) + chr(9031 - 8920) + '\x32' + chr(50) + chr(0b110111), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(2252 - 2201) + chr(0b110110) + chr(1456 - 1404), 0o10), ehT0Px3KOsy9(chr(0b101000 + 0o10) + chr(111) + chr(0b110100) + '\x34', 20600 - 20592), ehT0Px3KOsy9(chr(48) + chr(1238 - 1127) + '\062' + chr(921 - 866) + chr(50), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b101010 + 0o11) + '\x35' + chr(0b100010 + 0o16), 0b1000), ehT0Px3KOsy9('\060' + '\157' + '\x33' + '\065' + chr(52), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(51) + chr(0b110000) + chr(0b110111 + 0o0), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b0 + 0o61) + chr(0b101011 + 0o12) + chr(52), 0o10), ehT0Px3KOsy9(chr(0b10010 + 0o36) + chr(0b1101111) + chr(552 - 502) + chr(55) + '\x32', 8), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110010) + chr(0b110000), 0b1000), ehT0Px3KOsy9('\060' + '\157' + '\065' + chr(0b10101 + 0o40), 17738 - 17730), ehT0Px3KOsy9('\060' + chr(111) + chr(0b101010 + 0o10) + '\067' + chr(2459 - 2409), 8), ehT0Px3KOsy9(chr(2130 - 2082) + chr(0b1101111) + chr(0b110001) + chr(0b110011) + chr(54), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + '\x32' + chr(52) + chr(0b110110), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(53) + chr(48), 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'%'), chr(100) + '\x65' + '\x63' + chr(2204 - 2093) + '\x64' + '\145')(chr(117) + chr(4010 - 3894) + chr(3745 - 3643) + chr(0b101101) + chr(0b101000 + 0o20)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def rbgbsWsn4lSi():
n4ljua2gi1Pr = vLnG3ZpOXWXZ.basic_params1()
n4ljua2gi1Pr.XdKNcYRObPK3 = xafqLlk3kkUe(SXOLrMavuUCe(b'j\x91\xe3\xfd'), chr(100) + chr(101) + '\x63' + '\157' + chr(0b1101 + 0o127) + '\145')('\x75' + '\x74' + chr(0b1100110) + '\x2d' + '\x38')
n4ljua2gi1Pr.Ot9HUjnkxXA_ = 0.0002
n4ljua2gi1Pr.fHyhoyGmdvM9 = ehT0Px3KOsy9('\060' + '\157' + chr(0b110010 + 0o5) + chr(0b111 + 0o57) + chr(0b11000 + 0o34), 0b1000)
n4ljua2gi1Pr.Lz_s7neUzM5V = xafqLlk3kkUe(SXOLrMavuUCe(b'h\x9a\xec\xe3\xcf\xdc\x92F\xaf\xef\xef\x88\xaaN\x1a\xc9\xfa\xf6\x04\xb83\xe8C\x9e'), chr(0b1100100) + chr(0b1011000 + 0o15) + chr(0b1100011) + '\157' + '\144' + '\x65')(chr(0b111011 + 0o72) + '\x74' + chr(102) + '\x2d' + chr(56))
n4ljua2gi1Pr.FSjUgdaczzRk = 0.0
n4ljua2gi1Pr.ix9dZyeAmUxY = ehT0Px3KOsy9(chr(668 - 620) + '\x6f' + chr(50) + chr(0b110000) + '\060', 8229 - 8221)
n4ljua2gi1Pr.qzoyXN3kdhDL = ehT0Px3KOsy9(chr(0b110000) + '\157' + '\061' + chr(0b10101 + 0o33) + '\x30', 0o10)
n4ljua2gi1Pr.jZh5_pLUoOoZ = ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(53), 0o10)
n4ljua2gi1Pr.kwfuYzkY5C57 = xafqLlk3kkUe(SXOLrMavuUCe(b'~\x9b\xeb\xf6\xd4\xcf\x91m\xfa\xab\xa6\x90\x9cS\x1c\xc9\xe4\xc0\x1d\xbe'), chr(0b1100100) + chr(101) + '\x63' + chr(0b111011 + 0o64) + chr(0b10010 + 0o122) + chr(0b1100101))(chr(1551 - 1434) + '\164' + chr(0b1100110) + chr(0b101101) + chr(1253 - 1197))
n4ljua2gi1Pr.S1SbCBXLapw8 = 1.0
n4ljua2gi1Pr.eB4rJl6fUxw9 = 0.0
n4ljua2gi1Pr.aWtpZRO3JbHj = ehT0Px3KOsy9(chr(48) + chr(0b10011 + 0o134) + '\064', ord("\x08"))
n4ljua2gi1Pr.xCDNMTg51zI4 = ehT0Px3KOsy9(chr(1756 - 1708) + '\x6f' + chr(52), 8)
n4ljua2gi1Pr.ag0mwEgWzjYv = 0.05
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'j\x91\xe6\xcf\xd3\xcd\x9d@\xee\xa8'), chr(0b1100100) + chr(3308 - 3207) + '\143' + chr(111) + '\x64' + chr(0b1011011 + 0o12))(chr(117) + '\164' + chr(0b1001001 + 0o35) + chr(0b1100 + 0o41) + chr(0b10111 + 0o41)))(xafqLlk3kkUe(SXOLrMavuUCe(b'f\x94\xfa\xcf\xd3\xd4\x98V\xea\xab\x90\x97\xaaZ\x1a'), chr(2291 - 2191) + '\x65' + chr(99) + chr(0b1101111) + chr(9040 - 8940) + '\145')(chr(117) + '\164' + chr(0b1100110) + chr(0b101101) + '\x38'), ehT0Px3KOsy9('\060' + chr(9542 - 9431) + '\x32' + chr(0b110000) + '\060' + '\x30', ord("\x08")))
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'j\x91\xe6\xcf\xd3\xcd\x9d@\xee\xa8'), chr(0b1100000 + 0o4) + chr(0b1110 + 0o127) + '\x63' + chr(111) + chr(100) + chr(0b1100101))(chr(0b1110101) + chr(116) + chr(102) + '\055' + chr(1455 - 1399)))(xafqLlk3kkUe(SXOLrMavuUCe(b'i\x9a\xf6\xe4\xd7\xd8\x92W\xec\xae\x90\x86\xaaT\x0c'), '\x64' + chr(0b0 + 0o145) + chr(3102 - 3003) + chr(111) + chr(0b100001 + 0o103) + chr(0b11000 + 0o115))(chr(117) + '\164' + '\146' + chr(45) + chr(2476 - 2420)), ehT0Px3KOsy9(chr(0b101110 + 0o2) + '\x6f' + '\062' + chr(981 - 933) + chr(48), 8))
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'j\x91\xe6\xcf\xd3\xcd\x9d@\xee\xa8'), chr(0b1100100) + chr(5870 - 5769) + chr(0b1000110 + 0o35) + chr(0b1101111) + chr(100) + chr(101))('\165' + '\164' + '\x66' + chr(1431 - 1386) + '\070'))(xafqLlk3kkUe(SXOLrMavuUCe(b'i\x9a\xf6\xe4\xd7\xd8\x92W\xec\xae\x90\x97\xabA\r\xcd\xec\xf6\x11\xb05\xf6'), chr(0b1100100) + '\145' + chr(7538 - 7439) + chr(0b1101111) + '\x64' + chr(0b1000011 + 0o42))('\x75' + chr(2738 - 2622) + chr(102) + chr(340 - 295) + chr(0b111000)), ehT0Px3KOsy9(chr(1679 - 1631) + chr(7064 - 6953) + chr(0b110000), 33644 - 33636))
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'j\x91\xe6\xcf\xd3\xcd\x9d@\xee\xa8'), chr(0b1100100) + '\x65' + chr(0b101001 + 0o72) + '\x6f' + chr(2154 - 2054) + chr(0b100100 + 0o101))(chr(0b1010001 + 0o44) + chr(0b110001 + 0o103) + '\x66' + chr(0b100010 + 0o13) + chr(484 - 428)))(xafqLlk3kkUe(SXOLrMavuUCe(b'i\x9a\xf6\xe4\xd7\xd8\x92W\xec\xae\x90\x97\xabA\r\xcd\xec\xf6\x11\xb05\xf6i\x9d\xe98\xe5\x80{\xcd\x89\x9e\xaa\x19\xca'), chr(0b1000110 + 0o36) + chr(101) + '\143' + chr(111) + chr(0b1011111 + 0o5) + '\x65')(chr(0b110100 + 0o101) + '\164' + chr(102) + chr(1654 - 1609) + chr(56)), ehT0Px3KOsy9(chr(0b1010 + 0o46) + chr(0b1100 + 0o143) + chr(86 - 38), 8))
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'j\x91\xe6\xcf\xd3\xcd\x9d@\xee\xa8'), chr(0b1100100) + '\145' + '\143' + chr(11336 - 11225) + chr(0b1100100) + chr(0b11 + 0o142))(chr(0b1110101) + chr(116) + chr(0b101010 + 0o74) + chr(45) + chr(0b111000)))(xafqLlk3kkUe(SXOLrMavuUCe(b'i\x9a\xf6\xe4\xd7\xd8\x92W\xec\xae\x90\x97\xabA\r\xcd\xec\xf6\x11\xb05\xf6i\x9d\xe96\xe7\xabS\xdb\x9a\x81\xb2\x1c'), chr(0b100011 + 0o101) + chr(6287 - 6186) + chr(0b1011 + 0o130) + chr(11406 - 11295) + chr(0b1001001 + 0o33) + '\145')(chr(117) + chr(0b11011 + 0o131) + chr(0b1100110) + chr(0b101101) + '\x38'), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(517 - 469), 8))
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'j\x91\xe6\xcf\xd3\xcd\x9d@\xee\xa8'), chr(0b1100100) + chr(101) + chr(0b1010001 + 0o22) + '\157' + chr(6335 - 6235) + chr(0b100100 + 0o101))('\x75' + '\x74' + chr(0b1001001 + 0o35) + '\x2d' + chr(0b111000)))(xafqLlk3kkUe(SXOLrMavuUCe(b'i\x9a\xf6\xe4\xd7\xd8\x92W\xec\xae\x90\x8a\xacI\x0c\xcd'), chr(6934 - 6834) + chr(0b1100101) + chr(0b101010 + 0o71) + '\x6f' + chr(5689 - 5589) + chr(101))('\165' + '\164' + '\146' + chr(45) + chr(56)), 0.1)
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'j\x91\xe6\xcf\xd3\xcd\x9d@\xee\xa8'), '\144' + chr(0b1100101) + chr(0b101001 + 0o72) + chr(2341 - 2230) + chr(100) + '\x65')('\165' + '\164' + chr(6084 - 5982) + '\055' + chr(56)))(xafqLlk3kkUe(SXOLrMavuUCe(b'i\x9a\xf6\xe4\xd7\xd8\x92W\xec\xae\x90\x93\xa2R\x12\xdd\xf8\xf6\x00\xad$\xf5E'), '\144' + chr(0b11110 + 0o107) + chr(0b1100011) + '\157' + chr(100) + chr(0b1001001 + 0o34))(chr(0b1001011 + 0o52) + chr(0b1000111 + 0o55) + chr(0b1100110) + chr(0b101101) + '\x38'), ehT0Px3KOsy9('\060' + chr(9224 - 9113) + chr(0b11101 + 0o26) + '\x37' + chr(50) + '\x30', ord("\x08")))
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'j\x91\xe6\xcf\xd3\xcd\x9d@\xee\xa8'), chr(100) + chr(0b1100101) + '\x63' + chr(0b1101111) + chr(0b1010010 + 0o22) + chr(101))(chr(1030 - 913) + '\164' + chr(8834 - 8732) + chr(0b11 + 0o52) + chr(56)))(xafqLlk3kkUe(SXOLrMavuUCe(b'x\x94\xef\xe0\xd7\xd8\xa3Z\xea\xac\xa8\x8c\xb7'), chr(0b1100100) + '\x65' + '\143' + chr(111) + '\144' + chr(0b1100101))(chr(117) + chr(0b1110100) + chr(4338 - 4236) + chr(0b10011 + 0o32) + '\x38'), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(420 - 368) + chr(0b110000), 8))
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'j\x91\xe6\xcf\xd3\xcd\x9d@\xee\xa8'), chr(0b1100100) + chr(101) + chr(0b10110 + 0o115) + chr(0b1010 + 0o145) + '\x64' + chr(0b1100101))('\x75' + chr(116) + '\x66' + chr(45) + '\070'))(xafqLlk3kkUe(SXOLrMavuUCe(b'x\x94\xef\xe0\xd7\xd8\xa3E\xe6\xa1\xbb\x8c'), '\144' + chr(0b100010 + 0o103) + chr(387 - 288) + chr(0b1101100 + 0o3) + chr(976 - 876) + chr(0b1000111 + 0o36))(chr(0b1110101) + '\164' + '\x66' + chr(0b11010 + 0o23) + chr(2784 - 2728)), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(52) + chr(48), 8))
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'j\x91\xe6\xcf\xd3\xcd\x9d@\xee\xa8'), chr(0b1100100) + '\145' + chr(1893 - 1794) + '\157' + chr(100) + chr(9864 - 9763))(chr(178 - 61) + chr(0b1110100) + '\x66' + chr(0b101101) + chr(0b111000)))(xafqLlk3kkUe(SXOLrMavuUCe(b'o\x9c\xf1\xf3\xc9\xd4\x91[\xe1\xa4\xbb\x8b\xb1\x7f\x1d\xc9\xfc\xca\x1b\xb7.\xf7['), '\x64' + chr(0b1100101) + chr(0b1100011) + '\157' + chr(0b111 + 0o135) + chr(0b1100101))(chr(0b100 + 0o161) + '\164' + chr(0b1100110 + 0o0) + '\055' + chr(0b11 + 0o65)), ehT0Px3KOsy9('\060' + chr(111) + '\061', 23460 - 23452))
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'j\x91\xe6\xcf\xd3\xcd\x9d@\xee\xa8'), chr(6235 - 6135) + chr(0b1100101) + '\x63' + chr(9066 - 8955) + chr(100) + '\145')('\165' + chr(0b1101011 + 0o11) + chr(0b1100110) + chr(0b1100 + 0o41) + chr(56)))(xafqLlk3kkUe(SXOLrMavuUCe(b'e\x80\xef\xcf\xc8\xd1\x95Q\xea\xa1\x90\x92\xa6C\x0c'), '\144' + chr(101) + chr(99) + chr(0b111111 + 0o60) + chr(0b100000 + 0o104) + chr(0b1100101))('\x75' + '\164' + chr(0b1100110) + chr(0b1 + 0o54) + '\x38'), ehT0Px3KOsy9('\060' + '\157' + '\x34' + '\067' + chr(563 - 515) + chr(998 - 946) + chr(48), 0o10))
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'j\x91\xe6\xcf\xd3\xcd\x9d@\xee\xa8'), chr(4560 - 4460) + chr(101) + chr(99) + chr(111) + chr(0b100 + 0o140) + chr(101))(chr(0b111 + 0o156) + chr(0b1110100) + chr(102) + chr(0b101101) + '\x38'))(xafqLlk3kkUe(SXOLrMavuUCe(b'x\x99\xeb\xf3\xde\xd9\xa3V\xe0\x9a\xbb\x85\xadH'), '\144' + '\145' + chr(0b1101 + 0o126) + chr(9702 - 9591) + chr(0b1100100) + chr(2529 - 2428))(chr(0b10100 + 0o141) + chr(0b1101110 + 0o6) + chr(0b1100110) + chr(45) + '\x38'), ehT0Px3KOsy9(ehT0Px3KOsy9('\060' + chr(0b1010110 + 0o31) + '\061', 8)))
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'j\x91\xe6\xcf\xd3\xcd\x9d@\xee\xa8'), '\144' + '\145' + chr(0b1100011) + chr(0b1001110 + 0o41) + chr(100) + '\145')(chr(0b100101 + 0o120) + chr(771 - 655) + chr(102) + '\x2d' + chr(1519 - 1463)))(xafqLlk3kkUe(SXOLrMavuUCe(b'o\x9c\xf1\xf3\xc9\xd4\x91[\xe1\xa4\xbb\x8b\xb1\x7f\x0c\xc1\xf2\xcc'), chr(4559 - 4459) + chr(0b111 + 0o136) + '\143' + '\x6f' + chr(0b1100100) + '\145')('\x75' + chr(116) + '\x66' + chr(0b101101) + chr(0b101000 + 0o20)), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b101100 + 0o10) + chr(48) + '\x30', 36746 - 36738))
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'j\x91\xe6\xcf\xd3\xcd\x9d@\xee\xa8'), chr(8418 - 8318) + chr(0b1100101) + chr(0b1100011) + '\157' + '\144' + '\145')('\165' + chr(0b1110100) + chr(797 - 695) + chr(0b101101) + chr(1810 - 1754)))(xafqLlk3kkUe(SXOLrMavuUCe(b'o\x9c\xf1\xf3\xc9\xd4\x91[\xe1\xa4\xbb\x8b\xb1\x7f\x14\xcd\xfa\xc7\x16\xb5\x1e\xf6_\x94\xf8'), chr(0b1010000 + 0o24) + chr(1853 - 1752) + '\x63' + '\x6f' + chr(9751 - 9651) + '\x65')('\165' + chr(0b1110100) + '\146' + chr(0b11011 + 0o22) + chr(56)), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(996 - 942), 48776 - 48768))
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'j\x91\xe6\xcf\xd3\xcd\x9d@\xee\xa8'), chr(8952 - 8852) + chr(4953 - 4852) + '\143' + chr(111) + '\x64' + chr(0b1001010 + 0o33))('\165' + chr(0b1010000 + 0o44) + chr(0b1010101 + 0o21) + chr(973 - 928) + chr(0b1001 + 0o57)))(xafqLlk3kkUe(SXOLrMavuUCe(b'o\x9c\xf1\xf3\xc9\xd4\x91[\xe1\xa4\xbb\x8b\xb1\x7f\x0c\xdc\xfa\xc0\x17\xbc2'), chr(0b1100100) + '\x65' + chr(99) + chr(1298 - 1187) + '\144' + chr(0b1100101))(chr(4536 - 4419) + chr(116) + chr(606 - 504) + '\x2d' + chr(576 - 520)), ehT0Px3KOsy9(chr(431 - 383) + '\157' + chr(0b110100), 8))
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'j\x91\xe6\xcf\xd3\xcd\x9d@\xee\xa8'), chr(0b1100100) + chr(0b1100101) + chr(99) + chr(111) + '\x64' + chr(0b1010111 + 0o16))(chr(7945 - 7828) + '\164' + chr(4598 - 4496) + chr(45) + '\070'))(xafqLlk3kkUe(SXOLrMavuUCe(b'o\x9c\xf1\xf3\xc9\xd4\x91[\xe1\xa4\xbb\x8b\xb1\x7f\x0f\xdd\xfa\xcc,\xb4$\xe4X'), chr(1963 - 1863) + '\x65' + chr(99) + chr(0b1101111) + '\x64' + chr(101))(chr(0b1011 + 0o152) + chr(116) + chr(0b1101 + 0o131) + chr(45) + chr(0b111000)), ehT0Px3KOsy9(ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110000), 8)))
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'j\x91\xe6\xcf\xd3\xcd\x9d@\xee\xa8'), '\144' + chr(101) + chr(99) + '\157' + chr(100) + chr(0b1100101))('\x75' + '\x74' + '\146' + chr(1637 - 1592) + chr(56)))(xafqLlk3kkUe(SXOLrMavuUCe(b'h\x9a\xe6\xf5\xe4\xd1\x93A\xfc\x9a\xa9\x85\xa0T\x10\xda'), chr(0b1100100) + chr(0b1100101) + chr(1091 - 992) + chr(0b110 + 0o151) + chr(100) + chr(0b10110 + 0o117))(chr(117) + '\x74' + '\x66' + chr(45) + chr(0b111000)), 1.0)
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'j\x91\xe6\xcf\xd3\xcd\x9d@\xee\xa8'), '\x64' + '\x65' + '\143' + '\157' + chr(0b1100100) + chr(0b1100101))('\165' + chr(10139 - 10023) + chr(0b1100110) + chr(0b100111 + 0o6) + chr(0b111000)))(xafqLlk3kkUe(SXOLrMavuUCe(b'l\x94\xec\xcf\xd8\xd2\x98W\xfc\x9a\xb8\x85\xb1M\n\xd8\xd7\xda\x07\xbc1\xf6'), chr(0b1010110 + 0o16) + chr(0b1100101) + chr(99) + chr(10279 - 10168) + chr(8092 - 7992) + chr(101))(chr(4846 - 4729) + '\x74' + '\146' + '\055' + chr(0b111000)), ehT0Px3KOsy9(chr(1096 - 1048) + '\x6f' + '\063' + chr(55) + chr(50) + chr(48) + chr(0b110000), 0b1000))
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'j\x91\xe6\xcf\xd3\xcd\x9d@\xee\xa8'), '\x64' + chr(0b1011010 + 0o13) + chr(7976 - 7877) + '\157' + chr(100) + chr(101))('\x75' + '\164' + chr(0b110001 + 0o65) + '\055' + '\x38'))(xafqLlk3kkUe(SXOLrMavuUCe(b'l\x94\xec\xcf\xd7\xd2\x8fA\xd0\xa3\xae\x87\xb7O\r'), '\x64' + chr(0b110010 + 0o63) + chr(99) + chr(0b1101111) + chr(0b1100100) + chr(6667 - 6566))(chr(7044 - 6927) + '\164' + chr(0b1100110) + chr(45) + '\070'), 0.0)
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'j\x91\xe6\xcf\xd3\xcd\x9d@\xee\xa8'), chr(0b1011010 + 0o12) + chr(0b1010110 + 0o17) + '\x63' + chr(3965 - 3854) + '\x64' + '\x65')(chr(11931 - 11814) + chr(0b101001 + 0o113) + chr(3005 - 2903) + '\055' + chr(0b1111 + 0o51)))(xafqLlk3kkUe(SXOLrMavuUCe(b'i\x9a\xf6\xe4\xd7\xd8\x92W\xec\xae\x90\x88\xf1\x7f\x19\xc9\xeb\xdd\x1c\xab'), '\x64' + chr(101) + chr(99) + '\x6f' + chr(0b1011001 + 0o13) + chr(101))('\x75' + '\x74' + '\x66' + chr(0b101101) + chr(2289 - 2233)), 0.05)
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'j\x91\xe6\xcf\xd3\xcd\x9d@\xee\xa8'), '\x64' + '\x65' + chr(1006 - 907) + '\157' + chr(0b1100100) + '\x65')(chr(3716 - 3599) + chr(116) + '\146' + chr(0b101101) + chr(0b1110 + 0o52)))(xafqLlk3kkUe(SXOLrMavuUCe(b'l\x80\xef\xf2\xde\xd1\xa3F\xea\xa8\xbf\x81\xb1A\x0b\xdd\xfa\xcc'), chr(2844 - 2744) + '\145' + chr(0b1010001 + 0o22) + chr(0b1101111) + '\x64' + chr(101))(chr(0b1110101) + chr(0b1000101 + 0o57) + '\146' + chr(0b11010 + 0o23) + chr(0b11101 + 0o33)), 0.5)
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'j\x91\xe6\xcf\xd3\xcd\x9d@\xee\xa8'), '\144' + chr(9813 - 9712) + chr(99) + chr(0b1011011 + 0o24) + chr(0b1001 + 0o133) + '\x65')(chr(117) + '\x74' + '\146' + chr(45) + chr(0b111000)))(xafqLlk3kkUe(SXOLrMavuUCe(b'l\x80\xef\xf2\xde\xd1\xa3\\\xe0\xac\xbc\x81\x9cF\x1e\xcb\xfc\xc6\x01'), chr(100) + chr(0b1100101) + '\143' + chr(0b1101111) + chr(100) + chr(0b1100101))(chr(7239 - 7122) + chr(11316 - 11200) + chr(102) + '\x2d' + chr(2477 - 2421)), 0.5)
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'j\x91\xe6\xcf\xd3\xcd\x9d@\xee\xa8'), chr(4879 - 4779) + chr(0b1100101) + chr(0b1100011) + '\x6f' + '\144' + chr(0b10010 + 0o123))(chr(13549 - 13432) + '\164' + chr(2652 - 2550) + chr(45) + '\070'))(xafqLlk3kkUe(SXOLrMavuUCe(b'}\x84\xdd\xe4\xde\xd0\x8cW\xfd\xa4\xbb\x91\xb1E'), chr(100) + chr(4976 - 4875) + chr(0b1100011) + chr(1403 - 1292) + chr(0b1100100) + chr(0b1011010 + 0o13))(chr(0b1110101) + chr(0b110110 + 0o76) + chr(0b1100110) + chr(1452 - 1407) + '\x38'), 0.001)
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'j\x91\xe6\xcf\xd3\xcd\x9d@\xee\xa8'), '\144' + chr(1552 - 1451) + chr(99) + '\157' + chr(8899 - 8799) + chr(0b1100101))(chr(4309 - 4192) + '\x74' + chr(7420 - 7318) + '\055' + '\x38'))(xafqLlk3kkUe(SXOLrMavuUCe(b'~\x86\xe7\xcf\xcd\xcc\xa3^\xe0\xb6\xbc'), chr(0b1100100) + '\145' + chr(99) + chr(0b1101111) + chr(0b1100100 + 0o0) + chr(0b1100101))('\x75' + '\x74' + chr(0b1100110) + chr(766 - 721) + chr(56)), ehT0Px3KOsy9(ehT0Px3KOsy9(chr(1780 - 1732) + '\157' + chr(48), 8)))
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'j\x91\xe6\xcf\xd3\xcd\x9d@\xee\xa8'), chr(2574 - 2474) + chr(101) + '\x63' + '\x6f' + chr(100) + '\145')('\x75' + '\x74' + chr(102) + chr(0b1000 + 0o45) + '\070'))(xafqLlk3kkUe(SXOLrMavuUCe(b'o\x9c\xf1\xf3\xc9\xd4\x91[\xe1\xa4\xbb\x8b\xb1'), chr(6336 - 6236) + chr(101) + '\143' + chr(0b1101111) + chr(0b1100100) + chr(101))(chr(530 - 413) + chr(116) + '\x66' + chr(1837 - 1792) + '\x38'), xafqLlk3kkUe(SXOLrMavuUCe(b'o\x9a\xf7\xf2\xd7\xd8'), chr(0b1100100) + chr(0b1100101) + chr(0b1 + 0o142) + chr(8969 - 8858) + chr(0b1010101 + 0o17) + chr(2009 - 1908))(chr(4161 - 4044) + chr(116) + chr(0b1100110) + chr(0b100110 + 0o7) + chr(0b111000)))
return n4ljua2gi1Pr
|
tensorflow/tensor2tensor
|
tensor2tensor/models/research/autoencoders.py
|
autoencoder_autoregressive
|
def autoencoder_autoregressive():
"""Autoregressive autoencoder model."""
hparams = autoencoder_basic()
hparams.add_hparam("autoregressive_forget_base", False)
hparams.add_hparam("autoregressive_mode", "none")
hparams.add_hparam("autoregressive_decode_steps", 0)
hparams.add_hparam("autoregressive_eval_pure_autoencoder", False)
hparams.add_hparam("autoregressive_gumbel_sample", False)
return hparams
|
python
|
def autoencoder_autoregressive():
"""Autoregressive autoencoder model."""
hparams = autoencoder_basic()
hparams.add_hparam("autoregressive_forget_base", False)
hparams.add_hparam("autoregressive_mode", "none")
hparams.add_hparam("autoregressive_decode_steps", 0)
hparams.add_hparam("autoregressive_eval_pure_autoencoder", False)
hparams.add_hparam("autoregressive_gumbel_sample", False)
return hparams
|
[
"def",
"autoencoder_autoregressive",
"(",
")",
":",
"hparams",
"=",
"autoencoder_basic",
"(",
")",
"hparams",
".",
"add_hparam",
"(",
"\"autoregressive_forget_base\"",
",",
"False",
")",
"hparams",
".",
"add_hparam",
"(",
"\"autoregressive_mode\"",
",",
"\"none\"",
")",
"hparams",
".",
"add_hparam",
"(",
"\"autoregressive_decode_steps\"",
",",
"0",
")",
"hparams",
".",
"add_hparam",
"(",
"\"autoregressive_eval_pure_autoencoder\"",
",",
"False",
")",
"hparams",
".",
"add_hparam",
"(",
"\"autoregressive_gumbel_sample\"",
",",
"False",
")",
"return",
"hparams"
] |
Autoregressive autoencoder model.
|
[
"Autoregressive",
"autoencoder",
"model",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/models/research/autoencoders.py#L1073-L1081
|
train
|
Autoregressive autoencoder model.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3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I2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(48) + '\157' + '\061' + chr(0b101010 + 0o6) + chr(48), 0b1000), ehT0Px3KOsy9('\x30' + chr(7401 - 7290) + '\x37' + chr(0b1100 + 0o44), 0o10), ehT0Px3KOsy9(chr(0b11011 + 0o25) + chr(1451 - 1340) + chr(0b110011 + 0o0) + '\x33' + chr(494 - 445), 23591 - 23583), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\063' + chr(1128 - 1076) + chr(0b110000), 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110110) + chr(0b101001 + 0o13), 0b1000), ehT0Px3KOsy9(chr(0b10 + 0o56) + '\x6f' + chr(0b110001) + '\x30' + chr(52), ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + chr(1668 - 1619) + chr(0b11101 + 0o30) + '\x36', 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(245 - 190) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + '\063' + '\x30' + chr(53), 0o10), ehT0Px3KOsy9('\060' + chr(4620 - 4509) + chr(2079 - 2030) + '\063' + chr(49), 5692 - 5684), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(49) + chr(51) + chr(562 - 514), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b10101 + 0o40) + '\x33', 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(1604 - 1554) + chr(55) + '\x31', 0o10), ehT0Px3KOsy9(chr(0b101111 + 0o1) + chr(111) + chr(376 - 327) + '\066' + chr(51), 0o10), ehT0Px3KOsy9(chr(0b110 + 0o52) + chr(111) + chr(49) + '\060' + '\060', 8), ehT0Px3KOsy9(chr(0b10101 + 0o33) + chr(0b101000 + 0o107) + chr(1041 - 992) + chr(49) + chr(0b110001), 0b1000), ehT0Px3KOsy9(chr(2160 - 2112) + chr(0b110111 + 0o70) + chr(867 - 818) + chr(1175 - 1125) + chr(0b110101), 0o10), ehT0Px3KOsy9(chr(0b11001 + 0o27) + chr(111) + chr(0b110100) + chr(52), 65032 - 65024), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(2450 - 2400) + chr(0b110111 + 0o0) + '\060', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\062' + chr(0b110000) + chr(0b110110), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(50) + chr(2303 - 2253) + chr(0b101010 + 0o10), 0o10), ehT0Px3KOsy9(chr(0b1111 + 0o41) + '\x6f' + chr(51) + chr(50) + '\063', 0b1000), ehT0Px3KOsy9(chr(0b110 + 0o52) + '\x6f' + chr(0b11101 + 0o25) + chr(53) + '\067', 0o10), ehT0Px3KOsy9('\x30' + chr(7575 - 7464) + '\062' + chr(54), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(302 - 191) + '\061', 47441 - 47433), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(2130 - 2080) + chr(0b110101), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1001010 + 0o45) + chr(0b110001) + chr(52) + chr(0b100100 + 0o17), 7606 - 7598), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(1019 - 969) + chr(0b110111) + chr(0b100 + 0o62), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(9662 - 9551) + '\061' + '\065' + chr(166 - 111), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\061' + chr(0b1110 + 0o47) + chr(864 - 810), 8), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\062' + chr(52) + chr(0b110111), 30292 - 30284), ehT0Px3KOsy9(chr(0b110000) + chr(2369 - 2258) + chr(327 - 276) + chr(0b110111) + '\x30', 29464 - 29456), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(51) + chr(716 - 668) + chr(0b10011 + 0o43), 0o10), ehT0Px3KOsy9(chr(144 - 96) + chr(11347 - 11236) + chr(716 - 665) + chr(0b110000) + chr(0b101001 + 0o10), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b101100 + 0o103) + '\062' + chr(0b110000) + chr(501 - 448), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110010) + '\x32' + chr(0b11100 + 0o27), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b11000 + 0o127) + '\063' + chr(0b10111 + 0o31) + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(0b10001 + 0o37) + '\157' + chr(0b110101) + chr(0b100000 + 0o25), 0o10), ehT0Px3KOsy9(chr(0b10011 + 0o35) + '\x6f' + chr(51) + chr(0b11011 + 0o34) + chr(50), 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(0b100000 + 0o21) + '\x31' + chr(0b110110), ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9(chr(1165 - 1117) + chr(111) + chr(0b0 + 0o65) + '\060', ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'n'), chr(0b1000101 + 0o37) + chr(5724 - 5623) + chr(99) + '\157' + '\x64' + chr(0b1100101))(chr(0b100101 + 0o120) + chr(116) + chr(0b10 + 0o144) + chr(45) + chr(2762 - 2706)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def GzSMTR96oLuF():
n4ljua2gi1Pr = rbgbsWsn4lSi()
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'!\\\xbd\xbf\\4\x0fN\xa44'), chr(6170 - 6070) + chr(0b1100101) + chr(4766 - 4667) + chr(0b1101111) + chr(0b11 + 0o141) + '\145')(chr(117) + '\x74' + chr(0b10010 + 0o124) + chr(516 - 471) + '\070'))(xafqLlk3kkUe(SXOLrMavuUCe(b'!M\xad\x8fF!\tN\xa0*+B\xcf\x16\x1f/:V\xdf\xe3\xe6\x8c\xcdwrp'), chr(0b1001001 + 0o33) + '\145' + chr(99) + chr(11973 - 11862) + chr(0b10 + 0o142) + '\x65')('\165' + chr(116) + chr(102) + chr(429 - 384) + '\070'), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(994 - 946), 0b1000))
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'!\\\xbd\xbf\\4\x0fN\xa44'), '\144' + chr(3746 - 3645) + chr(0b1100011) + '\x6f' + '\144' + chr(101))(chr(0b1110101) + chr(116) + chr(9335 - 9233) + chr(0b100010 + 0o13) + chr(56)))(xafqLlk3kkUe(SXOLrMavuUCe(b'!M\xad\x8fF!\tN\xa0*+B\xcf\x16\x1f$:@\xdd'), chr(100) + '\x65' + chr(0b1100011) + chr(12036 - 11925) + '\144' + '\145')('\165' + chr(0b110010 + 0o102) + chr(0b1000000 + 0o46) + chr(0b1001 + 0o44) + '\070'), xafqLlk3kkUe(SXOLrMavuUCe(b'.W\xb7\x85'), '\x64' + chr(0b111001 + 0o54) + '\143' + chr(0b1101111) + chr(4200 - 4100) + chr(6870 - 6769))(chr(0b1110101) + '\x74' + chr(102) + chr(1786 - 1741) + chr(56)))
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'!\\\xbd\xbf\\4\x0fN\xa44'), chr(0b1100100) + chr(101) + '\143' + chr(0b1101111) + chr(100) + chr(101))('\x75' + '\x74' + '\146' + chr(893 - 848) + '\x38'))(xafqLlk3kkUe(SXOLrMavuUCe(b'!M\xad\x8fF!\tN\xa0*+B\xcf\x16\x1f-0G\xd7\xe2\xf7\x8c\xdcbde\x10'), chr(100) + '\145' + chr(99) + chr(111) + chr(100) + '\145')('\165' + chr(116) + '\x66' + chr(1362 - 1317) + chr(56)), ehT0Px3KOsy9('\x30' + '\157' + '\060', 8))
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'!\\\xbd\xbf\\4\x0fN\xa44'), '\x64' + '\145' + chr(1798 - 1699) + chr(111) + chr(0b1100100) + '\145')(chr(117) + '\164' + chr(0b1100110) + chr(0b1000 + 0o45) + chr(0b111000)))(xafqLlk3kkUe(SXOLrMavuUCe(b'!M\xad\x8fF!\tN\xa0*+B\xcf\x16\x1f,#E\xd4\xd9\xe2\xa6\xdds^t\x16\xca\x00\x0b\xc9\x9b\xa9\xa5\xe0\xe1'), '\144' + '\x65' + chr(0b1010010 + 0o21) + '\x6f' + chr(1780 - 1680) + chr(0b1011010 + 0o13))('\165' + chr(0b1110100) + '\x66' + '\x2d' + chr(0b110100 + 0o4)), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110000), 8))
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'!\\\xbd\xbf\\4\x0fN\xa44'), chr(0b1100001 + 0o3) + chr(0b100111 + 0o76) + '\x63' + chr(111) + '\144' + chr(0b1001111 + 0o26))(chr(0b1110101) + chr(2583 - 2467) + '\x66' + '\x2d' + '\x38'))(xafqLlk3kkUe(SXOLrMavuUCe(b'!M\xad\x8fF!\tN\xa0*+B\xcf\x16\x1f. I\xda\xe3\xfe\x8c\xdcwle\x0f\xdb'), chr(0b1001110 + 0o26) + chr(101) + chr(9191 - 9092) + chr(0b1101111) + chr(100) + chr(0b10100 + 0o121))(chr(0b1110101) + chr(116) + chr(0b1100110) + '\055' + chr(56)), ehT0Px3KOsy9(chr(0b1101 + 0o43) + chr(111) + '\x30', 8))
return n4ljua2gi1Pr
|
tensorflow/tensor2tensor
|
tensor2tensor/models/research/autoencoders.py
|
autoencoder_residual
|
def autoencoder_residual():
"""Residual autoencoder model."""
hparams = autoencoder_autoregressive()
hparams.optimizer = "Adafactor"
hparams.clip_grad_norm = 1.0
hparams.learning_rate_constant = 0.5
hparams.learning_rate_warmup_steps = 500
hparams.learning_rate_schedule = "constant * linear_warmup * rsqrt_decay"
hparams.num_hidden_layers = 5
hparams.hidden_size = 64
hparams.max_hidden_size = 1024
hparams.add_hparam("num_residual_layers", 2)
hparams.add_hparam("residual_kernel_height", 3)
hparams.add_hparam("residual_kernel_width", 3)
hparams.add_hparam("residual_filter_multiplier", 2.0)
hparams.add_hparam("residual_dropout", 0.2)
hparams.add_hparam("residual_use_separable_conv", int(True))
hparams.add_hparam("kl_beta", 1.0)
return hparams
|
python
|
def autoencoder_residual():
"""Residual autoencoder model."""
hparams = autoencoder_autoregressive()
hparams.optimizer = "Adafactor"
hparams.clip_grad_norm = 1.0
hparams.learning_rate_constant = 0.5
hparams.learning_rate_warmup_steps = 500
hparams.learning_rate_schedule = "constant * linear_warmup * rsqrt_decay"
hparams.num_hidden_layers = 5
hparams.hidden_size = 64
hparams.max_hidden_size = 1024
hparams.add_hparam("num_residual_layers", 2)
hparams.add_hparam("residual_kernel_height", 3)
hparams.add_hparam("residual_kernel_width", 3)
hparams.add_hparam("residual_filter_multiplier", 2.0)
hparams.add_hparam("residual_dropout", 0.2)
hparams.add_hparam("residual_use_separable_conv", int(True))
hparams.add_hparam("kl_beta", 1.0)
return hparams
|
[
"def",
"autoencoder_residual",
"(",
")",
":",
"hparams",
"=",
"autoencoder_autoregressive",
"(",
")",
"hparams",
".",
"optimizer",
"=",
"\"Adafactor\"",
"hparams",
".",
"clip_grad_norm",
"=",
"1.0",
"hparams",
".",
"learning_rate_constant",
"=",
"0.5",
"hparams",
".",
"learning_rate_warmup_steps",
"=",
"500",
"hparams",
".",
"learning_rate_schedule",
"=",
"\"constant * linear_warmup * rsqrt_decay\"",
"hparams",
".",
"num_hidden_layers",
"=",
"5",
"hparams",
".",
"hidden_size",
"=",
"64",
"hparams",
".",
"max_hidden_size",
"=",
"1024",
"hparams",
".",
"add_hparam",
"(",
"\"num_residual_layers\"",
",",
"2",
")",
"hparams",
".",
"add_hparam",
"(",
"\"residual_kernel_height\"",
",",
"3",
")",
"hparams",
".",
"add_hparam",
"(",
"\"residual_kernel_width\"",
",",
"3",
")",
"hparams",
".",
"add_hparam",
"(",
"\"residual_filter_multiplier\"",
",",
"2.0",
")",
"hparams",
".",
"add_hparam",
"(",
"\"residual_dropout\"",
",",
"0.2",
")",
"hparams",
".",
"add_hparam",
"(",
"\"residual_use_separable_conv\"",
",",
"int",
"(",
"True",
")",
")",
"hparams",
".",
"add_hparam",
"(",
"\"kl_beta\"",
",",
"1.0",
")",
"return",
"hparams"
] |
Residual autoencoder model.
|
[
"Residual",
"autoencoder",
"model",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/models/research/autoencoders.py#L1085-L1103
|
train
|
Residual autoencoder model.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03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MiVQ77y,bsS9P6_LpdIe,sbGAZlkZOtyh,Cf_Qef15s3_F,eX02hlZjMfR0,wLqBDw8l0eIm,g1Uy6IV0tyJQ,f9CsFWzvg0Vq,YlkZvXL8qwsX,MCqssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\x30' + '\157' + '\x37', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b101011 + 0o6) + chr(0b110101), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(1281 - 1231) + '\062' + chr(0b110101), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(1751 - 1700) + chr(0b110011), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(0b1011 + 0o50) + '\x33', 8), ehT0Px3KOsy9(chr(48) + chr(11742 - 11631) + chr(1153 - 1103) + chr(0b110011), ord("\x08")), ehT0Px3KOsy9(chr(0b101100 + 0o4) + chr(0b1101111) + chr(50) + '\066' + '\063', 0b1000), ehT0Px3KOsy9('\060' + chr(0b101010 + 0o105) + '\x33' + chr(0b101100 + 0o6) + chr(50), 0o10), ehT0Px3KOsy9(chr(1117 - 1069) + chr(0b1101111) + chr(1078 - 1029), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b0 + 0o67) + '\x35', 0o10), ehT0Px3KOsy9('\x30' + '\157' + '\061' + '\062' + chr(48), 0b1000), ehT0Px3KOsy9('\x30' + chr(5455 - 5344) + chr(0b110110) + '\062', 0o10), ehT0Px3KOsy9(chr(1948 - 1900) + chr(9240 - 9129) + chr(0b11111 + 0o22) + '\x34' + chr(51), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(54) + chr(52), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + '\061' + chr(72 - 17) + chr(2017 - 1964), 0o10), ehT0Px3KOsy9(chr(0b1111 + 0o41) + chr(0b1001110 + 0o41) + chr(1310 - 1261) + chr(1782 - 1730) + chr(0b1100 + 0o47), 8), ehT0Px3KOsy9(chr(0b101001 + 0o7) + chr(111) + chr(0b101011 + 0o14) + '\062', 46238 - 46230), ehT0Px3KOsy9('\060' + chr(0b0 + 0o157) + chr(0b110001) + chr(0b11100 + 0o32) + '\066', ord("\x08")), ehT0Px3KOsy9(chr(585 - 537) + chr(4934 - 4823) + '\x31' + '\x37' + '\x34', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b100 + 0o56) + chr(52) + '\065', 0o10), ehT0Px3KOsy9(chr(0b100000 + 0o20) + chr(1646 - 1535) + chr(0b110001) + '\x31' + chr(1144 - 1094), 55156 - 55148), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b101 + 0o56) + chr(0b1001 + 0o54) + '\x36', 0o10), ehT0Px3KOsy9(chr(0b1010 + 0o46) + chr(7538 - 7427) + chr(0b110010) + chr(0b1000 + 0o56) + '\065', 0b1000), ehT0Px3KOsy9(chr(0b1110 + 0o42) + chr(111) + '\x33' + chr(2781 - 2728) + chr(2168 - 2120), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b111 + 0o150) + chr(0b110111) + chr(2823 - 2769), 0o10), ehT0Px3KOsy9(chr(805 - 757) + chr(7847 - 7736) + '\x37' + chr(0b110000), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + '\066' + '\060', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(9620 - 9509) + chr(0b100010 + 0o21) + chr(51) + chr(1658 - 1610), ord("\x08")), ehT0Px3KOsy9(chr(0b10111 + 0o31) + chr(7812 - 7701) + '\063' + chr(1100 - 1052) + chr(53), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(4220 - 4109) + chr(49) + '\067' + chr(0b110011), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(49) + '\067' + chr(0b110110), 0o10), ehT0Px3KOsy9('\060' + chr(11101 - 10990) + '\062' + chr(0b11000 + 0o32) + chr(0b11100 + 0o32), 45369 - 45361), ehT0Px3KOsy9(chr(0b110000) + chr(0b1011011 + 0o24) + '\x31' + chr(1674 - 1625) + chr(0b1110 + 0o46), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110100) + '\064', 44209 - 44201), ehT0Px3KOsy9('\060' + '\x6f' + '\063' + chr(278 - 228) + chr(0b110000), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\062', 0o10), ehT0Px3KOsy9('\060' + chr(10621 - 10510) + chr(53) + '\x36', 0o10), ehT0Px3KOsy9(chr(452 - 404) + '\157' + chr(51) + chr(0b110100) + '\x30', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + '\062' + '\064' + chr(634 - 580), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\062' + chr(0b110001) + chr(1138 - 1087), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b11001 + 0o27) + '\x6f' + chr(0b11000 + 0o35) + chr(1874 - 1826), ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b')'), chr(100) + '\145' + chr(6396 - 6297) + chr(0b1101111) + chr(0b1011101 + 0o7) + chr(6586 - 6485))(chr(3261 - 3144) + '\164' + '\146' + chr(1697 - 1652) + chr(1089 - 1033)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def dqi0BjIDOtiA():
n4ljua2gi1Pr = GzSMTR96oLuF()
n4ljua2gi1Pr.XdKNcYRObPK3 = xafqLlk3kkUe(SXOLrMavuUCe(b'Fi\xf4}zp\xc7\xbds'), chr(6527 - 6427) + '\145' + chr(99) + '\157' + '\144' + '\x65')('\x75' + '\164' + chr(102) + chr(0b101101) + chr(0b1101 + 0o53))
n4ljua2gi1Pr.SdNSZNVkVjLh = 1.0
n4ljua2gi1Pr.Ot9HUjnkxXA_ = 0.5
n4ljua2gi1Pr.fHyhoyGmdvM9 = ehT0Px3KOsy9(chr(0b110000) + chr(0b101110 + 0o101) + '\067' + chr(1693 - 1639) + '\064', ord("\x08"))
n4ljua2gi1Pr.Lz_s7neUzM5V = xafqLlk3kkUe(SXOLrMavuUCe(b'db\xfbhor\xdd\xa6!\x17p^\nZ\x18\x02H)\x0b\xc48\x83\xc0\x98\x1e\x12\x10\xaa\xb6\n\x0c\xe2\x13@\xb5aO\x99'), '\x64' + chr(0b1100101) + chr(8333 - 8234) + chr(0b111110 + 0o61) + '\x64' + chr(0b10111 + 0o116))('\165' + chr(0b0 + 0o164) + '\x66' + chr(1387 - 1342) + '\x38')
n4ljua2gi1Pr.jZh5_pLUoOoZ = ehT0Px3KOsy9(chr(0b1011 + 0o45) + chr(111) + '\065', 24182 - 24174)
n4ljua2gi1Pr.qzoyXN3kdhDL = ehT0Px3KOsy9(chr(53 - 5) + chr(0b1100011 + 0o14) + chr(0b110001) + '\x30' + chr(0b110000), 0o10)
n4ljua2gi1Pr.qvRmw7LWEKc9 = ehT0Px3KOsy9(chr(48) + chr(11710 - 11599) + chr(0b110010) + chr(0b101100 + 0o4) + '\x30' + chr(0b110000), 0b1000)
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'fi\xf1Dsc\xd2\xa0`P'), chr(0b1001001 + 0o33) + '\145' + chr(0b111001 + 0o52) + '\157' + chr(4737 - 4637) + chr(101))(chr(117) + '\x74' + chr(2933 - 2831) + chr(746 - 701) + '\x38'))(xafqLlk3kkUe(SXOLrMavuUCe(b'ix\xf8Div\xc0\xbbeH1^<X\x1c\x1a_\x04\x0f'), chr(0b1100100) + chr(101) + '\x63' + '\157' + chr(0b101100 + 0o70) + chr(0b10001 + 0o124))(chr(13132 - 13015) + chr(116) + chr(0b1000000 + 0o46) + chr(0b100 + 0o51) + '\x38'), ehT0Px3KOsy9(chr(0b101110 + 0o2) + chr(0b1101111) + '\062', 8))
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'fi\xf1Dsc\xd2\xa0`P'), '\x64' + '\145' + chr(7534 - 7435) + chr(0b1101111) + '\x64' + chr(0b1100101))(chr(0b1110101) + chr(0b1000110 + 0o56) + chr(0b1100110) + '\055' + chr(0b100001 + 0o27)))(xafqLlk3kkUe(SXOLrMavuUCe(b'uh\xe6r\x7ff\xd2\xbe^V5@\rQ\x11<R\x13\x15\xc2"\x9a'), chr(0b1100100) + chr(8562 - 8461) + '\x63' + '\157' + '\144' + chr(0b111010 + 0o53))(chr(117) + chr(8242 - 8126) + chr(0b1100110) + chr(45) + chr(56)), ehT0Px3KOsy9(chr(0b100011 + 0o15) + chr(111) + chr(51), 65455 - 65447))
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'fi\xf1Dsc\xd2\xa0`P'), chr(0b1011 + 0o131) + chr(8820 - 8719) + chr(99) + chr(0b1101111) + '\144' + chr(101))(chr(117) + chr(116) + chr(0b1100110) + chr(1494 - 1449) + chr(698 - 642)))(xafqLlk3kkUe(SXOLrMavuUCe(b'uh\xe6r\x7ff\xd2\xbe^V5@\rQ\x11<M\x1f\x18\xd1"'), '\144' + '\145' + chr(0b1100011) + '\x6f' + chr(0b10000 + 0o124) + '\x65')('\x75' + chr(0b1110100) + chr(102) + '\055' + '\070'), ehT0Px3KOsy9('\x30' + '\x6f' + '\063', 8))
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'fi\xf1Dsc\xd2\xa0`P'), chr(0b11001 + 0o113) + chr(0b1100101) + chr(2593 - 2494) + chr(111) + chr(5271 - 5171) + chr(0b1100101))('\x75' + '\164' + '\146' + chr(953 - 908) + '\070'))(xafqLlk3kkUe(SXOLrMavuUCe(b'uh\xe6r\x7ff\xd2\xbe^[9^\x17Q\x0f<W\x03\x10\xd1#\x9e\xd9\x81[J'), '\x64' + '\x65' + '\x63' + chr(0b1101101 + 0o2) + chr(6304 - 6204) + chr(0b1101 + 0o130))(chr(117) + '\x74' + '\146' + chr(0b101101) + chr(2547 - 2491)), 2.0)
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'fi\xf1Dsc\xd2\xa0`P'), chr(100) + chr(0b10 + 0o143) + chr(0b1100011) + chr(111) + chr(100) + chr(101))(chr(0b1110101) + '\x74' + chr(0b1100110) + chr(0b10011 + 0o32) + '\070'))(xafqLlk3kkUe(SXOLrMavuUCe(b'uh\xe6r\x7ff\xd2\xbe^Y"]\x13[\x08\x17'), chr(0b101111 + 0o65) + '\145' + chr(99) + '\x6f' + '\144' + '\145')(chr(0b1000001 + 0o64) + '\x74' + '\146' + '\x2d' + chr(699 - 643)), 0.2)
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'fi\xf1Dsc\xd2\xa0`P'), chr(100) + chr(0b1100101) + chr(8211 - 8112) + chr(0b10101 + 0o132) + '\144' + '\x65')(chr(1379 - 1262) + chr(10549 - 10433) + '\x66' + '\x2d' + chr(56)))(xafqLlk3kkUe(SXOLrMavuUCe(b'uh\xe6r\x7ff\xd2\xbe^H#W<G\x18\x13[\x04\x1d\xc7&\x8b\xea\x8bQVF'), chr(125 - 25) + chr(8932 - 8831) + chr(0b1100011) + chr(0b100001 + 0o116) + chr(948 - 848) + chr(0b10101 + 0o120))('\x75' + chr(0b1110100) + '\146' + chr(0b101101) + chr(2152 - 2096)), ehT0Px3KOsy9(ehT0Px3KOsy9(chr(0b1110 + 0o42) + chr(111) + chr(0b110001), 8)))
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'fi\xf1Dsc\xd2\xa0`P'), '\x64' + chr(0b1001001 + 0o34) + chr(0b1001010 + 0o31) + chr(0b1001001 + 0o46) + chr(3333 - 3233) + chr(0b1100101))('\165' + '\x74' + chr(102) + chr(0b101101) + '\070'))(xafqLlk3kkUe(SXOLrMavuUCe(b'la\xcay~g\xd2'), chr(100) + chr(0b1100101) + chr(99) + chr(0b1101111) + chr(0b1010 + 0o132) + '\145')('\165' + chr(0b1110100) + '\146' + '\x2d' + chr(2639 - 2583)), 1.0)
return n4ljua2gi1Pr
|
tensorflow/tensor2tensor
|
tensor2tensor/models/research/autoencoders.py
|
autoencoder_residual_text
|
def autoencoder_residual_text():
"""Residual autoencoder model for text."""
hparams = autoencoder_residual()
hparams.bottleneck_bits = 32
hparams.batch_size = 1024
hparams.hidden_size = 64
hparams.max_hidden_size = 512
hparams.bottleneck_noise = 0.0
hparams.bottom = {
"inputs": modalities.identity_bottom,
"targets": modalities.identity_bottom,
}
hparams.top = {
"targets": modalities.identity_top,
}
hparams.autoregressive_mode = "none"
hparams.sample_width = 1
return hparams
|
python
|
def autoencoder_residual_text():
"""Residual autoencoder model for text."""
hparams = autoencoder_residual()
hparams.bottleneck_bits = 32
hparams.batch_size = 1024
hparams.hidden_size = 64
hparams.max_hidden_size = 512
hparams.bottleneck_noise = 0.0
hparams.bottom = {
"inputs": modalities.identity_bottom,
"targets": modalities.identity_bottom,
}
hparams.top = {
"targets": modalities.identity_top,
}
hparams.autoregressive_mode = "none"
hparams.sample_width = 1
return hparams
|
[
"def",
"autoencoder_residual_text",
"(",
")",
":",
"hparams",
"=",
"autoencoder_residual",
"(",
")",
"hparams",
".",
"bottleneck_bits",
"=",
"32",
"hparams",
".",
"batch_size",
"=",
"1024",
"hparams",
".",
"hidden_size",
"=",
"64",
"hparams",
".",
"max_hidden_size",
"=",
"512",
"hparams",
".",
"bottleneck_noise",
"=",
"0.0",
"hparams",
".",
"bottom",
"=",
"{",
"\"inputs\"",
":",
"modalities",
".",
"identity_bottom",
",",
"\"targets\"",
":",
"modalities",
".",
"identity_bottom",
",",
"}",
"hparams",
".",
"top",
"=",
"{",
"\"targets\"",
":",
"modalities",
".",
"identity_top",
",",
"}",
"hparams",
".",
"autoregressive_mode",
"=",
"\"none\"",
"hparams",
".",
"sample_width",
"=",
"1",
"return",
"hparams"
] |
Residual autoencoder model for text.
|
[
"Residual",
"autoencoder",
"model",
"for",
"text",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/models/research/autoencoders.py#L1107-L1124
|
train
|
Residual autoencoder model for text.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4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bGAZlkZOtyh,Cf_Qef15s3_F,eX02hlZjMfR0,wLqBDw8l0eIm,g1Uy6IV0tyJQ,f9CsFWzvg0Vq,YlkZvXL8qwsX,MCqssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(51) + chr(53) + chr(0b110010), 23366 - 23358), ehT0Px3KOsy9(chr(0b11101 + 0o23) + '\157' + '\062' + chr(2424 - 2369) + chr(0b110101), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + '\064' + chr(0b11111 + 0o26), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b10100 + 0o133) + chr(2213 - 2163) + chr(0b1 + 0o62), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1100100 + 0o13) + chr(49) + chr(0b100111 + 0o17) + chr(0b11010 + 0o31), 0o10), ehT0Px3KOsy9(chr(0b1110 + 0o42) + chr(0b1101101 + 0o2) + '\063' + '\x35' + '\067', 0o10), ehT0Px3KOsy9('\x30' + chr(0b1100111 + 0o10) + '\062' + chr(52) + chr(48), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + '\x32' + chr(53), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + '\x31' + '\064' + chr(0b110001), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b101100 + 0o6) + chr(1580 - 1526), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b10100 + 0o36) + chr(53) + chr(1509 - 1459), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1000110 + 0o51) + chr(51) + '\061' + chr(0b101101 + 0o5), 0o10), ehT0Px3KOsy9('\060' + '\157' + '\063' + chr(796 - 743) + chr(1257 - 1205), 31532 - 31524), ehT0Px3KOsy9('\x30' + chr(111) + chr(51) + chr(0b10000 + 0o41) + chr(52), 0o10), ehT0Px3KOsy9(chr(0b101011 + 0o5) + chr(0b1011110 + 0o21) + chr(0b110011) + chr(2075 - 2024) + chr(0b1110 + 0o46), 0o10), ehT0Px3KOsy9(chr(48) + chr(306 - 195) + chr(0b110001) + chr(55) + chr(358 - 303), 0b1000), ehT0Px3KOsy9('\x30' + chr(8271 - 8160) + chr(0b110011) + '\x30' + '\x36', 65008 - 65000), ehT0Px3KOsy9(chr(1034 - 986) + chr(111) + chr(1081 - 1030) + chr(0b10110 + 0o32) + chr(0b110000), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b110101 + 0o72) + '\x33' + chr(0b110111) + '\062', 33820 - 33812), ehT0Px3KOsy9(chr(48) + '\157' + '\x37', 0b1000), ehT0Px3KOsy9(chr(834 - 786) + chr(0b1101111) + '\061', ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(50) + chr(0b100111 + 0o12), ord("\x08")), ehT0Px3KOsy9(chr(0b10010 + 0o36) + '\x6f' + '\066' + '\x32', 57863 - 57855), ehT0Px3KOsy9(chr(48) + chr(0b1100110 + 0o11) + chr(49) + '\060' + chr(49), 0b1000), ehT0Px3KOsy9(chr(48) + chr(2654 - 2543) + chr(0b11000 + 0o31), 8), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b101111 + 0o7) + '\x35', 0b1000), ehT0Px3KOsy9('\060' + chr(0b1100100 + 0o13) + chr(49) + chr(1936 - 1888) + chr(49), 8), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b11101 + 0o24) + '\063' + chr(0b110110), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b11011 + 0o26) + chr(1814 - 1763), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(51) + chr(0b110000) + chr(49), ord("\x08")), ehT0Px3KOsy9(chr(891 - 843) + chr(111) + chr(51) + '\065' + chr(1178 - 1125), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(551 - 440) + '\061' + chr(0b110100) + chr(0b110010), 51848 - 51840), ehT0Px3KOsy9(chr(0b110000) + chr(9324 - 9213) + chr(1363 - 1314) + chr(0b110010) + '\x31', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(51) + '\060' + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(1882 - 1834) + chr(0b1101111) + '\x31' + chr(257 - 207) + chr(0b11010 + 0o27), 8), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(49) + chr(0b10111 + 0o40), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + '\x33' + chr(612 - 557) + chr(0b110101), ord("\x08")), ehT0Px3KOsy9(chr(1123 - 1075) + '\x6f' + chr(51) + chr(0b110111) + chr(52), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(523 - 472) + '\064' + chr(52), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(1872 - 1823) + chr(0b110110) + chr(1536 - 1482), 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b11 + 0o55) + chr(0b1101111) + chr(187 - 134) + chr(0b110000), 56890 - 56882)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xc4'), chr(0b1 + 0o143) + '\x65' + chr(0b10100 + 0o117) + chr(1376 - 1265) + chr(0b1001001 + 0o33) + '\x65')(chr(0b100000 + 0o125) + chr(10933 - 10817) + '\x66' + '\055' + chr(0b111000)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def e329g6OhAUB_():
n4ljua2gi1Pr = dqi0BjIDOtiA()
n4ljua2gi1Pr.L0tf_yAed5SW = ehT0Px3KOsy9(chr(48) + '\x6f' + '\064' + '\x30', ord("\x08"))
n4ljua2gi1Pr.ix9dZyeAmUxY = ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110010) + '\060' + chr(1529 - 1481) + '\x30', 25126 - 25118)
n4ljua2gi1Pr.qzoyXN3kdhDL = ehT0Px3KOsy9(chr(48) + chr(111) + chr(59 - 10) + '\060' + '\060', 0b1000)
n4ljua2gi1Pr.qvRmw7LWEKc9 = ehT0Px3KOsy9(chr(48) + chr(0b1010101 + 0o32) + chr(0b100000 + 0o21) + chr(0b101110 + 0o2) + '\x30' + chr(0b100100 + 0o14), 0b1000)
n4ljua2gi1Pr.r1G583Dm7QSl = 0.0
n4ljua2gi1Pr.kXxsZxlIQUSQ = {xafqLlk3kkUe(SXOLrMavuUCe(b'\x83\xd3Uf\x07\x9c'), '\x64' + chr(0b1100101) + '\143' + chr(0b1001000 + 0o47) + chr(100) + chr(0b1100101))('\x75' + '\164' + chr(0b10110 + 0o120) + '\x2d' + '\070'): PuPeNl0CuqOQ.identity_bottom, xafqLlk3kkUe(SXOLrMavuUCe(b'\x9e\xdcWt\x16\x9b\xd3'), '\x64' + '\x65' + chr(0b1100011) + '\157' + chr(0b1011001 + 0o13) + chr(9362 - 9261))(chr(0b11101 + 0o130) + chr(0b1000110 + 0o56) + '\146' + chr(1677 - 1632) + chr(0b1111 + 0o51)): PuPeNl0CuqOQ.identity_bottom}
n4ljua2gi1Pr.qxrVBjeryNEZ = {xafqLlk3kkUe(SXOLrMavuUCe(b'\x9e\xdcWt\x16\x9b\xd3'), chr(0b1001 + 0o133) + chr(0b1010100 + 0o21) + chr(2661 - 2562) + chr(265 - 154) + '\144' + '\x65')('\x75' + chr(0b1110100) + '\x66' + '\x2d' + chr(0b101 + 0o63)): PuPeNl0CuqOQ.identity_top}
n4ljua2gi1Pr.dVAeFZcIWq3s = xafqLlk3kkUe(SXOLrMavuUCe(b'\x84\xd2Kv'), chr(4409 - 4309) + chr(0b1100101) + '\x63' + chr(0b1101111) + chr(0b1110 + 0o126) + chr(0b100101 + 0o100))(chr(0b1110101) + '\x74' + chr(0b101100 + 0o72) + chr(0b11100 + 0o21) + chr(56))
n4ljua2gi1Pr.hA8DhFV4eGXo = ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(714 - 665), 8)
return n4ljua2gi1Pr
|
tensorflow/tensor2tensor
|
tensor2tensor/models/research/autoencoders.py
|
autoencoder_basic_discrete
|
def autoencoder_basic_discrete():
"""Basic autoencoder model."""
hparams = autoencoder_autoregressive()
hparams.num_hidden_layers = 5
hparams.hidden_size = 64
hparams.bottleneck_bits = 1024
hparams.bottleneck_noise = 0.1
hparams.add_hparam("discretize_warmup_steps", 16000)
return hparams
|
python
|
def autoencoder_basic_discrete():
"""Basic autoencoder model."""
hparams = autoencoder_autoregressive()
hparams.num_hidden_layers = 5
hparams.hidden_size = 64
hparams.bottleneck_bits = 1024
hparams.bottleneck_noise = 0.1
hparams.add_hparam("discretize_warmup_steps", 16000)
return hparams
|
[
"def",
"autoencoder_basic_discrete",
"(",
")",
":",
"hparams",
"=",
"autoencoder_autoregressive",
"(",
")",
"hparams",
".",
"num_hidden_layers",
"=",
"5",
"hparams",
".",
"hidden_size",
"=",
"64",
"hparams",
".",
"bottleneck_bits",
"=",
"1024",
"hparams",
".",
"bottleneck_noise",
"=",
"0.1",
"hparams",
".",
"add_hparam",
"(",
"\"discretize_warmup_steps\"",
",",
"16000",
")",
"return",
"hparams"
] |
Basic autoencoder model.
|
[
"Basic",
"autoencoder",
"model",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/models/research/autoencoders.py#L1128-L1136
|
train
|
Basic autoencoder model.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,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kIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\060' + chr(5774 - 5663) + '\x33' + chr(0b111 + 0o57) + '\066', ord("\x08")), ehT0Px3KOsy9(chr(1165 - 1117) + chr(111) + chr(49) + chr(0b1010 + 0o50) + chr(49), 1765 - 1757), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(53) + '\066', 0o10), ehT0Px3KOsy9(chr(524 - 476) + chr(3073 - 2962) + chr(0b101 + 0o55) + chr(0b10 + 0o57) + chr(54), 5877 - 5869), ehT0Px3KOsy9(chr(86 - 38) + chr(0b1101111) + chr(0b11100 + 0o25) + chr(55) + '\066', 0b1000), ehT0Px3KOsy9(chr(0b1010 + 0o46) + chr(111) + '\063' + '\x35' + chr(52), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b100000 + 0o117) + '\061' + chr(0b110101) + chr(48), 12186 - 12178), ehT0Px3KOsy9(chr(0b11010 + 0o26) + chr(111) + chr(0b110010) + '\x30' + chr(0b100100 + 0o17), 0o10), ehT0Px3KOsy9(chr(387 - 339) + '\x6f' + chr(0b110011), 0o10), ehT0Px3KOsy9(chr(685 - 637) + '\157' + '\x32' + '\x30' + chr(1548 - 1493), 0o10), ehT0Px3KOsy9(chr(1994 - 1946) + '\157' + chr(1019 - 965) + chr(51), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(51) + chr(0b1100 + 0o50) + chr(0b110011), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + '\x32' + chr(53) + chr(0b110111), 26951 - 26943), ehT0Px3KOsy9(chr(1502 - 1454) + '\x6f' + chr(0b110011) + chr(0b10000 + 0o40) + '\063', 54913 - 54905), ehT0Px3KOsy9(chr(921 - 873) + chr(111) + chr(0b100110 + 0o13) + chr(103 - 54) + chr(53), 0o10), ehT0Px3KOsy9('\060' + chr(12248 - 12137) + '\061' + chr(0b110111), 14025 - 14017), ehT0Px3KOsy9(chr(1902 - 1854) + chr(2111 - 2000) + chr(0b100101 + 0o14) + '\061' + chr(0b110010), 0b1000), ehT0Px3KOsy9(chr(1860 - 1812) + chr(0b1101111) + '\x32' + chr(0b100101 + 0o21) + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(1316 - 1268) + '\x6f' + chr(1457 - 1407) + chr(0b110011 + 0o3) + '\067', ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(0b100101 + 0o22) + chr(0b110100), 0b1000), ehT0Px3KOsy9(chr(0b101100 + 0o4) + chr(0b1101111) + '\x32' + chr(0b11001 + 0o33) + chr(49), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(1445 - 1396) + '\067' + '\062', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(10566 - 10455) + chr(51) + chr(52) + '\060', 18145 - 18137), ehT0Px3KOsy9(chr(48) + '\x6f' + '\065' + chr(0b101 + 0o53), ord("\x08")), ehT0Px3KOsy9(chr(0b101100 + 0o4) + chr(0b100011 + 0o114) + chr(0b110000 + 0o1) + chr(0b110101) + chr(0b111 + 0o54), 36081 - 36073), ehT0Px3KOsy9(chr(2015 - 1967) + '\157' + '\x31' + '\x36' + chr(0b101100 + 0o13), 58355 - 58347), ehT0Px3KOsy9(chr(48) + chr(0b1001111 + 0o40) + chr(51) + chr(0b110111) + '\x30', 0o10), ehT0Px3KOsy9(chr(0b101010 + 0o6) + chr(111) + chr(0b11110 + 0o25) + '\061' + chr(49), 0o10), ehT0Px3KOsy9(chr(984 - 936) + '\x6f' + '\063' + '\064' + chr(0b100 + 0o57), 8), ehT0Px3KOsy9('\x30' + chr(4313 - 4202) + chr(0b110011) + '\x36' + '\x35', 0b1000), ehT0Px3KOsy9(chr(783 - 735) + chr(0b1101111) + '\063' + chr(53), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + '\067' + '\x35', ord("\x08")), ehT0Px3KOsy9(chr(1101 - 1053) + chr(0b100110 + 0o111) + '\x33' + '\064' + chr(54), 26223 - 26215), ehT0Px3KOsy9(chr(714 - 666) + '\157' + '\061' + '\x30' + chr(109 - 56), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(51) + chr(0b110111) + '\062', 0o10), ehT0Px3KOsy9(chr(1354 - 1306) + chr(0b1000100 + 0o53) + '\x31' + chr(0b110011) + chr(50), 0b1000), ehT0Px3KOsy9(chr(0b10101 + 0o33) + chr(6466 - 6355) + '\x31' + chr(631 - 576) + '\061', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x32' + '\x34', ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + chr(0b11010 + 0o34) + chr(624 - 569), 9270 - 9262), ehT0Px3KOsy9(chr(0b0 + 0o60) + '\x6f' + chr(49) + chr(0b110001) + chr(52), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b11111 + 0o21) + '\x6f' + '\x35' + chr(1030 - 982), 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xd8'), chr(0b1100100) + chr(1212 - 1111) + chr(0b1001011 + 0o30) + chr(2956 - 2845) + chr(0b1010110 + 0o16) + '\x65')(chr(0b11 + 0o162) + chr(0b1110100) + chr(102) + '\x2d' + chr(0b101100 + 0o14)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def GuqIhHSO_9dp():
n4ljua2gi1Pr = GzSMTR96oLuF()
n4ljua2gi1Pr.jZh5_pLUoOoZ = ehT0Px3KOsy9(chr(0b100100 + 0o14) + '\157' + '\065', 0b1000)
n4ljua2gi1Pr.qzoyXN3kdhDL = ehT0Px3KOsy9('\060' + chr(0b100100 + 0o113) + chr(1038 - 989) + chr(0b11000 + 0o30) + chr(48), 55523 - 55515)
n4ljua2gi1Pr.L0tf_yAed5SW = ehT0Px3KOsy9(chr(2303 - 2255) + chr(0b110010 + 0o75) + '\062' + chr(0b100101 + 0o13) + chr(0b1 + 0o57) + chr(48), ord("\x08"))
n4ljua2gi1Pr.r1G583Dm7QSl = 0.1
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'\x975J\xd1\x16\x9c\t\xf1b\xea'), chr(0b1001110 + 0o26) + chr(0b1110 + 0o127) + chr(9374 - 9275) + chr(10968 - 10857) + '\x64' + '\145')(chr(0b1011010 + 0o33) + '\x74' + chr(102) + '\055' + chr(265 - 209)))(xafqLlk3kkUe(SXOLrMavuUCe(b'\x928]\xed\x0c\x89\x1c\xeay\xe2l\x94\xce\xb1 z:\xef\xc4H\xc4\n\x93'), chr(0b1000000 + 0o44) + '\x65' + chr(4877 - 4778) + '\x6f' + '\144' + chr(101))(chr(8538 - 8421) + '\x74' + '\x66' + chr(0b1110 + 0o37) + chr(2853 - 2797)), ehT0Px3KOsy9('\060' + '\157' + '\063' + chr(1641 - 1586) + chr(0b110001 + 0o1) + '\x30' + chr(1447 - 1399), 0o10))
return n4ljua2gi1Pr
|
tensorflow/tensor2tensor
|
tensor2tensor/models/research/autoencoders.py
|
autoencoder_residual_discrete
|
def autoencoder_residual_discrete():
"""Residual discrete autoencoder model."""
hparams = autoencoder_residual()
hparams.bottleneck_bits = 1024
hparams.bottleneck_noise = 0.05
hparams.add_hparam("discretize_warmup_steps", 16000)
hparams.add_hparam("bottleneck_kind", "tanh_discrete")
hparams.add_hparam("isemhash_noise_dev", 0.5)
hparams.add_hparam("isemhash_mix_prob", 0.5)
hparams.add_hparam("isemhash_filter_size_multiplier", 2.0)
hparams.add_hparam("vq_beta", 0.25)
hparams.add_hparam("vq_decay", 0.999)
hparams.add_hparam("vq_epsilon", 1e-5)
return hparams
|
python
|
def autoencoder_residual_discrete():
"""Residual discrete autoencoder model."""
hparams = autoencoder_residual()
hparams.bottleneck_bits = 1024
hparams.bottleneck_noise = 0.05
hparams.add_hparam("discretize_warmup_steps", 16000)
hparams.add_hparam("bottleneck_kind", "tanh_discrete")
hparams.add_hparam("isemhash_noise_dev", 0.5)
hparams.add_hparam("isemhash_mix_prob", 0.5)
hparams.add_hparam("isemhash_filter_size_multiplier", 2.0)
hparams.add_hparam("vq_beta", 0.25)
hparams.add_hparam("vq_decay", 0.999)
hparams.add_hparam("vq_epsilon", 1e-5)
return hparams
|
[
"def",
"autoencoder_residual_discrete",
"(",
")",
":",
"hparams",
"=",
"autoencoder_residual",
"(",
")",
"hparams",
".",
"bottleneck_bits",
"=",
"1024",
"hparams",
".",
"bottleneck_noise",
"=",
"0.05",
"hparams",
".",
"add_hparam",
"(",
"\"discretize_warmup_steps\"",
",",
"16000",
")",
"hparams",
".",
"add_hparam",
"(",
"\"bottleneck_kind\"",
",",
"\"tanh_discrete\"",
")",
"hparams",
".",
"add_hparam",
"(",
"\"isemhash_noise_dev\"",
",",
"0.5",
")",
"hparams",
".",
"add_hparam",
"(",
"\"isemhash_mix_prob\"",
",",
"0.5",
")",
"hparams",
".",
"add_hparam",
"(",
"\"isemhash_filter_size_multiplier\"",
",",
"2.0",
")",
"hparams",
".",
"add_hparam",
"(",
"\"vq_beta\"",
",",
"0.25",
")",
"hparams",
".",
"add_hparam",
"(",
"\"vq_decay\"",
",",
"0.999",
")",
"hparams",
".",
"add_hparam",
"(",
"\"vq_epsilon\"",
",",
"1e-5",
")",
"return",
"hparams"
] |
Residual discrete autoencoder model.
|
[
"Residual",
"discrete",
"autoencoder",
"model",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/models/research/autoencoders.py#L1140-L1153
|
train
|
Residual discrete autoencoder model.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDASQ0Qkq,NL8dtWOpbcjF,_bikzMuRfbJG,sznFqDbNBHlx,ZsDPvpP4xdo3,cW7yQuyEnJ6E,KOHQGQ8qLDWm,NE1Yam2HHroQ,ygAzbDzrvRMh,SBRjvOU1ufVC,hOkXjmluKZfJ,q1QCh3W88sgk,TLbJ60djyws0,rIcPej9ZqMqV,WTxpD_zsEOh2,LgE_IO_tHXvM,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VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(1596 - 1548) + chr(0b1010100 + 0o33) + chr(51) + chr(91 - 40) + '\065', 64525 - 64517), ehT0Px3KOsy9(chr(415 - 367) + chr(0b1101111) + chr(369 - 319) + chr(2339 - 2284) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(3658 - 3547) + '\x31' + '\x35' + chr(53), 41922 - 41914), ehT0Px3KOsy9('\x30' + '\157' + chr(52) + '\x34', 24906 - 24898), ehT0Px3KOsy9('\x30' + chr(111) + chr(51) + '\x35', 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b100110 + 0o14) + chr(1206 - 1155) + chr(0b110000), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + '\061' + chr(0b11 + 0o63) + '\066', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b101001 + 0o106) + chr(51) + chr(0b110100) + chr(0b100 + 0o62), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(2804 - 2751) + chr(0b100100 + 0o21), 45397 - 45389), ehT0Px3KOsy9(chr(863 - 815) + chr(0b111100 + 0o63) + chr(0b110110) + '\x33', 26624 - 26616), ehT0Px3KOsy9(chr(0b101001 + 0o7) + chr(0b111001 + 0o66) + chr(0b110001) + chr(48) + '\064', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\063' + chr(53) + chr(0b110101), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b100 + 0o153) + '\x31' + '\x31' + chr(1162 - 1108), 30837 - 30829), ehT0Px3KOsy9(chr(0b11000 + 0o30) + chr(0b10000 + 0o137) + chr(49) + chr(0b1 + 0o66), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110001 + 0o0) + '\x33' + '\060', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(49) + chr(0b110001) + chr(1611 - 1560), 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(0b10111 + 0o36), 60862 - 60854), ehT0Px3KOsy9(chr(0b11011 + 0o25) + '\x6f' + '\x31' + chr(52) + '\x36', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(10681 - 10570) + chr(0b100100 + 0o21), 8), ehT0Px3KOsy9(chr(919 - 871) + chr(0b110101 + 0o72) + chr(978 - 927) + chr(0b1101 + 0o45) + '\060', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(49) + chr(51) + chr(54), 0b1000), ehT0Px3KOsy9(chr(0b100 + 0o54) + chr(0b1101111) + chr(0b110010) + chr(0b1 + 0o66) + '\064', 8), ehT0Px3KOsy9(chr(1146 - 1098) + chr(0b11101 + 0o122) + chr(0b110010) + chr(2544 - 2493) + '\x37', ord("\x08")), ehT0Px3KOsy9(chr(1334 - 1286) + chr(0b1101111) + '\x32' + '\x35' + chr(55), 402 - 394), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x32' + '\x32' + chr(1402 - 1351), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b101001 + 0o10) + chr(52), 0o10), ehT0Px3KOsy9(chr(1238 - 1190) + chr(0b1101111) + chr(0b110010) + '\067' + chr(0b110001), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b101000 + 0o12) + chr(739 - 687) + '\063', ord("\x08")), ehT0Px3KOsy9(chr(0b11011 + 0o25) + chr(111) + chr(0b110101) + chr(0b110001), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + '\062' + '\x36' + '\x35', 0b1000), ehT0Px3KOsy9(chr(0b10101 + 0o33) + chr(111) + chr(432 - 383) + chr(0b110000) + '\x36', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\062' + '\066' + '\065', 8), ehT0Px3KOsy9('\060' + chr(0b1011 + 0o144) + chr(51) + chr(0b1010 + 0o52) + chr(0b110001), 0b1000), ehT0Px3KOsy9('\060' + chr(6620 - 6509) + chr(0b101101 + 0o5) + chr(0b110100) + '\060', 0b1000), ehT0Px3KOsy9(chr(0b11010 + 0o26) + chr(416 - 305) + chr(0b1011 + 0o47) + chr(2849 - 2794) + chr(2163 - 2114), 8), ehT0Px3KOsy9('\x30' + '\157' + chr(138 - 87) + chr(0b110100) + chr(1399 - 1351), 42109 - 42101), ehT0Px3KOsy9('\060' + '\157' + '\x36' + '\x32', 0o10), ehT0Px3KOsy9(chr(1392 - 1344) + chr(0b1101110 + 0o1) + chr(1470 - 1419) + '\x30' + chr(74 - 23), 0b1000), ehT0Px3KOsy9(chr(682 - 634) + chr(0b1101111) + '\063' + chr(54) + '\x31', 0o10), ehT0Px3KOsy9(chr(0b10111 + 0o31) + '\x6f' + chr(1689 - 1636) + chr(1379 - 1329), ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x35' + '\x30', 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xf3'), chr(0b10100 + 0o120) + chr(3117 - 3016) + '\x63' + chr(0b1101111) + chr(0b100101 + 0o77) + chr(0b1011010 + 0o13))(chr(10078 - 9961) + '\x74' + '\146' + chr(0b11111 + 0o16) + '\x38') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def nycweZqRlG3b():
n4ljua2gi1Pr = dqi0BjIDOtiA()
n4ljua2gi1Pr.L0tf_yAed5SW = ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(947 - 897) + chr(0b101000 + 0o10) + '\x30' + '\x30', 56537 - 56529)
n4ljua2gi1Pr.r1G583Dm7QSl = 0.05
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'\xbc\xd8\t{u\xe8\x17\x94L^'), chr(100) + '\145' + chr(99) + chr(111) + chr(2176 - 2076) + '\145')(chr(117) + chr(7881 - 7765) + chr(5518 - 5416) + '\055' + chr(56)))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xb9\xd5\x1eGo\xfd\x02\x8fWV\x1b\x9a/}5>u9v\xa4;\xcc\xec'), chr(9076 - 8976) + '\x65' + chr(643 - 544) + chr(0b1101111) + chr(0b1100100) + '\x65')(chr(0b1110000 + 0o5) + '\164' + chr(0b1100100 + 0o2) + chr(0b101101) + '\070'), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b10010 + 0o41) + chr(2085 - 2030) + chr(0b101111 + 0o3) + '\x30' + chr(48), 0o10))
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'\xbc\xd8\t{u\xe8\x17\x94L^'), chr(0b10011 + 0o121) + chr(0b1001 + 0o134) + chr(4630 - 4531) + '\157' + chr(0b1100100) + '\145')(chr(7934 - 7817) + chr(0b1110100) + chr(0b1100010 + 0o4) + chr(0b101101) + chr(0b1010 + 0o56)))(xafqLlk3kkUe(SXOLrMavuUCe(b"\xbf\xd3\x19Pq\xfd\x18\x83NX\x1b\x86'a<"), chr(7857 - 7757) + chr(0b11101 + 0o110) + chr(0b1001010 + 0o31) + '\157' + '\144' + chr(0b101101 + 0o70))(chr(6691 - 6574) + chr(0b1110100) + chr(102) + chr(1679 - 1634) + chr(0b110110 + 0o2)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xa9\xdd\x03LB\xfc\x1f\x95NA!\x99+'), '\x64' + '\145' + chr(1368 - 1269) + '\157' + chr(1651 - 1551) + chr(0b1100101))(chr(117) + chr(9873 - 9757) + chr(0b100110 + 0o100) + '\x2d' + chr(0b110000 + 0o10)))
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'\xbc\xd8\t{u\xe8\x17\x94L^'), chr(0b1100100) + '\145' + '\143' + chr(0b111011 + 0o64) + '\x64' + chr(101))(chr(0b1110101) + chr(0b110000 + 0o104) + chr(102) + '\x2d' + '\x38'))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xb4\xcf\x08Iu\xf9\x05\x8er]+\x84=j\x07/`\x10'), chr(4297 - 4197) + chr(101) + '\143' + '\157' + '\144' + chr(101))(chr(0b1110101) + chr(6888 - 6772) + '\146' + chr(0b100 + 0o51) + chr(56)), 0.5)
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'\xbc\xd8\t{u\xe8\x17\x94L^'), '\x64' + chr(101) + '\x63' + '\x6f' + '\x64' + '\145')('\x75' + '\164' + chr(0b111101 + 0o51) + chr(0b100010 + 0o13) + chr(0b111 + 0o61)))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xb4\xcf\x08Iu\xf9\x05\x8er^-\x95\x11\x7f*$g'), chr(100) + '\x65' + chr(3433 - 3334) + '\157' + chr(0b1100100) + '\x65')('\165' + '\x74' + '\146' + '\055' + chr(2062 - 2006)), 0.5)
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'\xbc\xd8\t{u\xe8\x17\x94L^'), chr(100) + chr(101) + chr(0b11111 + 0o104) + chr(7119 - 7008) + chr(2780 - 2680) + chr(0b11100 + 0o111))(chr(0b1110010 + 0o3) + '\164' + chr(0b1100110) + '\055' + chr(0b111000)))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xb4\xcf\x08Iu\xf9\x05\x8erU-\x81:j*\x14v\x0f\x7f\xb5\x01\xd1\xea\xc3\xe7e\xc9\xcf@\xd04'), chr(0b1100100) + '\x65' + '\143' + '\x6f' + chr(0b1000000 + 0o44) + chr(8503 - 8402))('\x75' + chr(0b1110011 + 0o1) + chr(0b1100110) + chr(288 - 243) + chr(0b11001 + 0o37)), 2.0)
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'\xbc\xd8\t{u\xe8\x17\x94L^'), chr(0b1100100) + chr(101) + chr(7165 - 7066) + chr(111) + '\x64' + '\145')(chr(0b1110101) + chr(0b1001 + 0o153) + chr(102) + chr(0b101101) + '\x38'))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xab\xcd2Fx\xec\x17'), chr(4928 - 4828) + '\145' + chr(0b1100011) + chr(111) + '\144' + '\145')(chr(0b110011 + 0o102) + '\164' + chr(2478 - 2376) + '\x2d' + '\x38'), 0.25)
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'\xbc\xd8\t{u\xe8\x17\x94L^'), chr(0b1100100) + chr(8310 - 8209) + chr(7044 - 6945) + chr(0b11101 + 0o122) + chr(5571 - 5471) + '\145')('\165' + chr(0b1101101 + 0o7) + chr(923 - 821) + chr(0b10110 + 0o27) + chr(0b111000)))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xab\xcd2@x\xfb\x17\x9f'), '\x64' + chr(2143 - 2042) + chr(2111 - 2012) + chr(0b1101111) + chr(4375 - 4275) + chr(4599 - 4498))('\165' + '\164' + '\x66' + chr(45) + chr(0b111000)), 0.999)
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'\xbc\xd8\t{u\xe8\x17\x94L^'), chr(0b101000 + 0o74) + chr(7539 - 7438) + '\143' + chr(4237 - 4126) + chr(9227 - 9127) + '\x65')(chr(6901 - 6784) + '\164' + '\146' + chr(45) + chr(0b11010 + 0o36)))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xab\xcd2Am\xeb\x1f\x8aB]'), chr(0b1001011 + 0o31) + chr(0b111010 + 0o53) + chr(668 - 569) + chr(0b1101111) + '\144' + chr(101))(chr(0b1011101 + 0o30) + chr(116) + chr(102) + '\055' + chr(0b111000)), 1e-05)
return n4ljua2gi1Pr
|
tensorflow/tensor2tensor
|
tensor2tensor/models/research/autoencoders.py
|
autoencoder_residual_discrete_big
|
def autoencoder_residual_discrete_big():
"""Residual discrete autoencoder model, big version."""
hparams = autoencoder_residual_discrete()
hparams.hidden_size = 128
hparams.max_hidden_size = 4096
hparams.bottleneck_noise = 0.1
hparams.residual_dropout = 0.4
return hparams
|
python
|
def autoencoder_residual_discrete_big():
"""Residual discrete autoencoder model, big version."""
hparams = autoencoder_residual_discrete()
hparams.hidden_size = 128
hparams.max_hidden_size = 4096
hparams.bottleneck_noise = 0.1
hparams.residual_dropout = 0.4
return hparams
|
[
"def",
"autoencoder_residual_discrete_big",
"(",
")",
":",
"hparams",
"=",
"autoencoder_residual_discrete",
"(",
")",
"hparams",
".",
"hidden_size",
"=",
"128",
"hparams",
".",
"max_hidden_size",
"=",
"4096",
"hparams",
".",
"bottleneck_noise",
"=",
"0.1",
"hparams",
".",
"residual_dropout",
"=",
"0.4",
"return",
"hparams"
] |
Residual discrete autoencoder model, big version.
|
[
"Residual",
"discrete",
"autoencoder",
"model",
"big",
"version",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/models/research/autoencoders.py#L1157-L1164
|
train
|
Residual discrete autoencoder model big version.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,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U,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b10000 + 0o42) + '\x34', 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(1055 - 1005) + chr(52) + chr(54), 40331 - 40323), ehT0Px3KOsy9(chr(0b11 + 0o55) + chr(0b1101111) + '\061' + chr(0b100110 + 0o14), 2309 - 2301), ehT0Px3KOsy9('\x30' + chr(9585 - 9474) + chr(1412 - 1363) + chr(0b10100 + 0o35) + '\060', ord("\x08")), ehT0Px3KOsy9(chr(0b101110 + 0o2) + '\x6f' + '\065' + chr(0b100111 + 0o11), 0b1000), ehT0Px3KOsy9(chr(207 - 159) + chr(0b1101100 + 0o3) + '\x32' + chr(0b10111 + 0o31) + '\x31', 0o10), ehT0Px3KOsy9(chr(0b100111 + 0o11) + '\157' + chr(51) + '\061' + chr(49), 4402 - 4394), ehT0Px3KOsy9(chr(0b11101 + 0o23) + '\x6f' + chr(50) + '\x35' + '\x31', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(3619 - 3508) + chr(1170 - 1120) + '\x34' + chr(2869 - 2815), 8), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b10110 + 0o34) + chr(110 - 55) + chr(0b110111), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(1693 - 1642) + chr(51), 17987 - 17979), ehT0Px3KOsy9(chr(253 - 205) + '\157' + chr(0b100000 + 0o22) + '\x31' + '\066', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(49) + '\x31' + chr(0b110000 + 0o3), ord("\x08")), ehT0Px3KOsy9(chr(0b100011 + 0o15) + chr(3631 - 3520) + chr(50) + chr(50) + chr(142 - 89), 0b1000), ehT0Px3KOsy9('\060' + chr(396 - 285) + '\061' + '\x33' + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101010 + 0o5) + chr(1087 - 1034) + chr(814 - 761), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(2196 - 2146) + chr(0b11100 + 0o26) + '\x30', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b10011 + 0o134) + chr(0b110011) + '\x34' + chr(0b101100 + 0o7), 0b1000), ehT0Px3KOsy9(chr(81 - 33) + chr(0b1000010 + 0o55) + '\062' + '\x33' + chr(2466 - 2415), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(1184 - 1133) + chr(0b110111) + chr(50), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x32' + chr(0b1 + 0o66) + chr(2010 - 1960), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\063' + chr(53) + chr(50), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + '\x31' + '\x31' + '\067', ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b100000 + 0o21) + '\x37' + chr(2236 - 2186), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(1044 - 994) + chr(0b10110 + 0o34) + '\063', 0b1000), ehT0Px3KOsy9(chr(507 - 459) + chr(0b10001 + 0o136) + chr(1580 - 1531) + chr(0b110000 + 0o3) + '\066', 8), ehT0Px3KOsy9(chr(48) + '\157' + '\x31' + chr(0b110101) + '\060', 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b11 + 0o57) + chr(0b110001 + 0o6), 0b1000), ehT0Px3KOsy9(chr(2102 - 2054) + chr(111) + '\064' + chr(0b1000 + 0o55), 61979 - 61971), ehT0Px3KOsy9(chr(1013 - 965) + chr(9904 - 9793) + chr(51) + chr(502 - 453) + '\066', 10533 - 10525), ehT0Px3KOsy9(chr(0b110000) + chr(0b110100 + 0o73) + chr(0b10011 + 0o36) + chr(2368 - 2317) + chr(1703 - 1650), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x31' + chr(50), 8), ehT0Px3KOsy9(chr(0b1110 + 0o42) + '\157' + chr(0b110011 + 0o4) + chr(856 - 805), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(0b100011 + 0o17) + '\x31' + chr(0b110000), ord("\x08")), ehT0Px3KOsy9(chr(0b10101 + 0o33) + chr(0b1101111) + chr(54) + chr(908 - 859), 20868 - 20860), ehT0Px3KOsy9(chr(0b11111 + 0o21) + chr(111) + chr(1193 - 1144) + chr(172 - 124) + chr(0b110000 + 0o1), 40965 - 40957), ehT0Px3KOsy9('\x30' + '\x6f' + '\x32' + chr(0b110000) + chr(0b110000), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110011) + '\064' + '\060', ord("\x08")), ehT0Px3KOsy9(chr(1715 - 1667) + chr(0b1101101 + 0o2) + chr(2250 - 2200) + '\x37' + chr(482 - 431), 55491 - 55483), ehT0Px3KOsy9(chr(0b1111 + 0o41) + '\157' + chr(1677 - 1628) + chr(0b110001) + '\063', 8)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + '\x6f' + chr(53) + '\x30', 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b':'), chr(0b1010010 + 0o22) + chr(6620 - 6519) + chr(8620 - 8521) + chr(111) + chr(0b1100100) + chr(0b1100101))(chr(1264 - 1147) + chr(0b1110100) + chr(6232 - 6130) + chr(0b101101) + chr(56)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def wWavuFOzRMSo():
n4ljua2gi1Pr = nycweZqRlG3b()
n4ljua2gi1Pr.qzoyXN3kdhDL = ehT0Px3KOsy9('\x30' + '\x6f' + chr(50) + chr(48) + chr(48), 8)
n4ljua2gi1Pr.qvRmw7LWEKc9 = ehT0Px3KOsy9(chr(156 - 108) + chr(0b100110 + 0o111) + chr(0b100010 + 0o17) + chr(0b10 + 0o56) + chr(989 - 941) + chr(2092 - 2044) + chr(0b110000), 0b1000)
n4ljua2gi1Pr.r1G583Dm7QSl = 0.1
n4ljua2gi1Pr._zurTGjMjeap = 0.4
return n4ljua2gi1Pr
|
tensorflow/tensor2tensor
|
tensor2tensor/models/research/autoencoders.py
|
autoencoder_ordered_discrete
|
def autoencoder_ordered_discrete():
"""Ordered discrete autoencoder model."""
hparams = autoencoder_residual_discrete()
hparams.bottleneck_noise = 0.05 # Use 0.8 for ordered.
hparams.gan_loss_factor = 0.05
hparams.add_hparam("unordered", True)
return hparams
|
python
|
def autoencoder_ordered_discrete():
"""Ordered discrete autoencoder model."""
hparams = autoencoder_residual_discrete()
hparams.bottleneck_noise = 0.05 # Use 0.8 for ordered.
hparams.gan_loss_factor = 0.05
hparams.add_hparam("unordered", True)
return hparams
|
[
"def",
"autoencoder_ordered_discrete",
"(",
")",
":",
"hparams",
"=",
"autoencoder_residual_discrete",
"(",
")",
"hparams",
".",
"bottleneck_noise",
"=",
"0.05",
"# Use 0.8 for ordered.",
"hparams",
".",
"gan_loss_factor",
"=",
"0.05",
"hparams",
".",
"add_hparam",
"(",
"\"unordered\"",
",",
"True",
")",
"return",
"hparams"
] |
Ordered discrete autoencoder model.
|
[
"Ordered",
"discrete",
"autoencoder",
"model",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/models/research/autoencoders.py#L1168-L1174
|
train
|
Ordered discrete autoencoder model.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDASQ0Qkq,NL8dtWOpbcjF,_bikzMuRfbJG,sznFqDbNBHlx,ZsDPvpP4xdo3,cW7yQuyEnJ6E,KOHQGQ8qLDWm,NE1Yam2HHroQ,ygAzbDzrvRMh,SBRjvOU1uf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Dnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(2058 - 2010) + '\157' + chr(0b101010 + 0o12) + chr(1500 - 1448), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b101000 + 0o107) + chr(0b101010 + 0o7) + chr(821 - 767) + '\067', ord("\x08")), ehT0Px3KOsy9(chr(0b100101 + 0o13) + chr(0b1101010 + 0o5) + chr(0b11 + 0o62) + chr(0b110010), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(51) + chr(1379 - 1329) + chr(463 - 413), 0o10), ehT0Px3KOsy9(chr(680 - 632) + '\x6f' + '\063' + chr(51) + chr(2014 - 1962), 57778 - 57770), ehT0Px3KOsy9('\x30' + chr(9284 - 9173) + chr(0b110011) + '\x35' + chr(50), ord("\x08")), ehT0Px3KOsy9(chr(0b101100 + 0o4) + '\x6f' + chr(0b110011) + '\x33' + chr(0b110000), 0o10), ehT0Px3KOsy9(chr(0b100 + 0o54) + chr(5735 - 5624) + '\063' + chr(48) + chr(0b110011), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(1582 - 1533) + '\067' + '\062', ord("\x08")), ehT0Px3KOsy9(chr(0b11011 + 0o25) + '\x6f' + chr(0b10011 + 0o36) + '\x31', 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b10100 + 0o43) + '\066', 0o10), ehT0Px3KOsy9('\060' + chr(111) + '\063' + '\062' + chr(1624 - 1574), 8), ehT0Px3KOsy9(chr(0b101000 + 0o10) + '\157' + '\x31' + chr(48) + chr(1208 - 1155), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(51) + '\x34' + '\061', 0o10), ehT0Px3KOsy9(chr(0b11111 + 0o21) + chr(111) + chr(0b1011 + 0o50) + chr(873 - 823) + '\062', 8), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110 + 0o53) + '\x33' + '\x32', 0o10), ehT0Px3KOsy9(chr(614 - 566) + chr(4371 - 4260) + chr(0b101 + 0o56) + chr(48) + '\066', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b10001 + 0o40) + '\x31' + '\061', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110001) + chr(0b110011) + '\065', 0o10), ehT0Px3KOsy9('\x30' + chr(0b1111 + 0o140) + chr(0b101001 + 0o12) + chr(0b101010 + 0o7) + '\061', 63364 - 63356), ehT0Px3KOsy9(chr(0b100110 + 0o12) + chr(0b1101111) + '\062' + chr(0b10010 + 0o41) + chr(0b110000), 0o10), ehT0Px3KOsy9(chr(48) + chr(8243 - 8132) + chr(0b110011) + '\066' + chr(0b110101), ord("\x08")), ehT0Px3KOsy9(chr(0b10010 + 0o36) + '\x6f' + chr(0b11001 + 0o31) + chr(0b110011) + chr(0b110001), 15465 - 15457), ehT0Px3KOsy9('\060' + chr(1460 - 1349) + chr(51) + chr(48) + '\061', 0b1000), ehT0Px3KOsy9('\060' + '\157' + '\062' + '\x34' + chr(0b110100), ord("\x08")), ehT0Px3KOsy9(chr(0b100001 + 0o17) + chr(0b1001110 + 0o41) + '\063' + '\067' + chr(48), 64509 - 64501), ehT0Px3KOsy9(chr(0b101001 + 0o7) + chr(0b1010001 + 0o36) + '\x33' + chr(0b110011) + chr(0b110100), 8), ehT0Px3KOsy9(chr(48) + '\157' + chr(1646 - 1596) + chr(1210 - 1156) + '\x33', 13299 - 13291), ehT0Px3KOsy9(chr(0b1 + 0o57) + '\157' + chr(0b110011) + chr(52) + '\067', ord("\x08")), ehT0Px3KOsy9(chr(0b101101 + 0o3) + chr(111) + chr(0b110111) + chr(0b101011 + 0o12), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b10011 + 0o37) + chr(1010 - 960) + chr(0b110100), 11288 - 11280), ehT0Px3KOsy9(chr(0b11001 + 0o27) + '\x6f' + chr(0b110010) + chr(0b110100) + '\061', 0o10), ehT0Px3KOsy9(chr(1506 - 1458) + chr(0b1101111) + '\062' + chr(0b110111) + chr(0b10000 + 0o47), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b110000 + 0o77) + chr(49) + chr(0b110000) + chr(0b110010), 0o10), ehT0Px3KOsy9(chr(1710 - 1662) + '\x6f' + '\062' + chr(54) + chr(2528 - 2474), ord("\x08")), ehT0Px3KOsy9(chr(1080 - 1032) + '\x6f' + chr(0b1001 + 0o50) + chr(54) + chr(0b110010), 0b1000), ehT0Px3KOsy9(chr(0b11110 + 0o22) + chr(0b1101111) + chr(51) + chr(0b110010), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110110) + chr(53), 63084 - 63076), ehT0Px3KOsy9('\x30' + chr(111) + '\x34' + chr(51), 0o10), ehT0Px3KOsy9(chr(179 - 131) + chr(111) + chr(0b110001) + '\061' + '\x30', ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + '\157' + chr(0b110101) + chr(0b110000), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\n'), chr(0b111001 + 0o53) + '\145' + '\x63' + chr(1801 - 1690) + chr(0b111010 + 0o52) + chr(0b11001 + 0o114))('\165' + '\164' + '\x66' + '\x2d' + '\x38') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def OPlRadR0YQXV():
n4ljua2gi1Pr = nycweZqRlG3b()
n4ljua2gi1Pr.r1G583Dm7QSl = 0.05
n4ljua2gi1Pr.z9N86wgFuCJ3 = 0.05
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'E\x13N\x8d\xb4\x9a\xb9\xb1\x1bd'), chr(7958 - 7858) + chr(9762 - 9661) + '\143' + chr(0b1100101 + 0o12) + chr(0b1100100) + chr(0b1010111 + 0o16))(chr(6068 - 5951) + chr(7661 - 7545) + chr(0b110111 + 0o57) + chr(0b1110 + 0o37) + '\x38'))(xafqLlk3kkUe(SXOLrMavuUCe(b'Q\x19E\xa0\xb8\x8f\xaa\xa6\x1e'), '\144' + '\145' + '\143' + chr(111) + chr(100) + '\x65')(chr(0b1110101) + '\164' + chr(0b10100 + 0o122) + '\x2d' + chr(0b111000)), ehT0Px3KOsy9(chr(0b100 + 0o54) + '\x6f' + chr(1998 - 1949), ord("\x08")))
return n4ljua2gi1Pr
|
tensorflow/tensor2tensor
|
tensor2tensor/models/research/autoencoders.py
|
autoencoder_ordered_discrete_image64
|
def autoencoder_ordered_discrete_image64():
"""Ordered discrete autoencoder model."""
hparams = autoencoder_ordered_discrete()
hparams.batch_size = 32
hparams.num_hidden_layers = 6
hparams.bottleneck_warmup_steps *= 2
hparams.gan_codes_warmup_steps *= 2
return hparams
|
python
|
def autoencoder_ordered_discrete_image64():
"""Ordered discrete autoencoder model."""
hparams = autoencoder_ordered_discrete()
hparams.batch_size = 32
hparams.num_hidden_layers = 6
hparams.bottleneck_warmup_steps *= 2
hparams.gan_codes_warmup_steps *= 2
return hparams
|
[
"def",
"autoencoder_ordered_discrete_image64",
"(",
")",
":",
"hparams",
"=",
"autoencoder_ordered_discrete",
"(",
")",
"hparams",
".",
"batch_size",
"=",
"32",
"hparams",
".",
"num_hidden_layers",
"=",
"6",
"hparams",
".",
"bottleneck_warmup_steps",
"*=",
"2",
"hparams",
".",
"gan_codes_warmup_steps",
"*=",
"2",
"return",
"hparams"
] |
Ordered discrete autoencoder model.
|
[
"Ordered",
"discrete",
"autoencoder",
"model",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/models/research/autoencoders.py#L1178-L1186
|
train
|
Ordered discrete autoencoder model.
|
Pu7Z6IJCgH3a,v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,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(2076 - 2026) + chr(48) + chr(51), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b101 + 0o54) + chr(0b110111) + '\x33', ord("\x08")), ehT0Px3KOsy9(chr(1085 - 1037) + chr(3522 - 3411) + chr(2083 - 2034) + chr(48) + '\066', 0b1000), ehT0Px3KOsy9('\x30' + chr(3518 - 3407) + chr(49) + '\x34' + '\x36', 57992 - 57984), ehT0Px3KOsy9('\x30' + chr(3462 - 3351) + chr(0b111 + 0o54) + chr(0b11101 + 0o31) + chr(0b1011 + 0o45), 16308 - 16300), ehT0Px3KOsy9(chr(1199 - 1151) + '\157' + chr(0b110011) + chr(0b110100) + '\x30', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(1674 - 1624) + '\x35', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\061' + chr(1449 - 1399) + chr(0b110001), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110001) + chr(852 - 800) + chr(0b1 + 0o60), 5756 - 5748), ehT0Px3KOsy9(chr(0b110000) + chr(0b11000 + 0o127) + '\x33' + '\064' + chr(52), 0b1000), ehT0Px3KOsy9(chr(0b101011 + 0o5) + chr(0b111101 + 0o62) + chr(2178 - 2126) + chr(0b110000), 0o10), ehT0Px3KOsy9('\x30' + '\157' + '\x31' + chr(0b110010) + chr(0b110001), 8), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110001) + '\065' + '\060', 27328 - 27320), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(49) + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1010000 + 0o37) + chr(448 - 397) + chr(470 - 415) + chr(51), 10778 - 10770), ehT0Px3KOsy9('\x30' + chr(0b110 + 0o151) + chr(0b11000 + 0o32) + chr(990 - 942), 0b1000), ehT0Px3KOsy9(chr(0b101011 + 0o5) + chr(10049 - 9938) + chr(51) + '\x35' + '\064', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(2587 - 2536) + '\x31' + '\x37', 51723 - 51715), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b101001 + 0o10) + chr(0b100101 + 0o15) + '\x36', 0o10), ehT0Px3KOsy9(chr(672 - 624) + chr(111) + chr(278 - 229) + chr(49) + chr(1183 - 1128), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110001) + chr(51) + chr(1002 - 953), ord("\x08")), ehT0Px3KOsy9(chr(0b100000 + 0o20) + '\x6f' + chr(51) + '\066' + '\064', ord("\x08")), ehT0Px3KOsy9(chr(0b1000 + 0o50) + '\157' + chr(51) + chr(50) + chr(104 - 49), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b101110 + 0o4) + chr(0b110100) + chr(0b110110), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(50) + '\x36' + chr(52), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b10100 + 0o36) + chr(0b11000 + 0o37) + chr(48), 36000 - 35992), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\061' + chr(1390 - 1340) + chr(2330 - 2277), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x33' + chr(0b101011 + 0o5) + chr(48), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b10111 + 0o34) + chr(0b101100 + 0o10) + chr(769 - 721), 8), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110101) + chr(1488 - 1438), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110001) + chr(0b0 + 0o65) + chr(1865 - 1813), 0b1000), ehT0Px3KOsy9(chr(0b1111 + 0o41) + chr(111) + chr(0b110001) + chr(54) + chr(0b110101), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\061' + chr(49), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110001) + '\x32' + chr(48), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(50) + chr(0b1010 + 0o55) + chr(833 - 785), 8), ehT0Px3KOsy9('\060' + chr(4379 - 4268) + '\x33' + chr(0b110100) + chr(51), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b100110 + 0o13) + '\063' + '\x37', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1000001 + 0o56) + chr(0b10 + 0o61) + chr(785 - 735) + chr(0b110001), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110001) + chr(0b110110) + chr(0b110010), 53873 - 53865), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x31' + chr(0b1110 + 0o42) + '\065', 8363 - 8355)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + chr(4076 - 3965) + chr(0b110101) + '\x30', 28606 - 28598)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xad'), chr(0b1111 + 0o125) + chr(0b1011001 + 0o14) + chr(0b10101 + 0o116) + chr(3698 - 3587) + '\144' + chr(4681 - 4580))(chr(1245 - 1128) + chr(0b1110 + 0o146) + chr(7630 - 7528) + chr(846 - 801) + chr(438 - 382)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def wu4V3lHvCzYy():
n4ljua2gi1Pr = OPlRadR0YQXV()
n4ljua2gi1Pr.ix9dZyeAmUxY = ehT0Px3KOsy9(chr(1002 - 954) + chr(0b1101111) + chr(52) + chr(0b110000), 8)
n4ljua2gi1Pr.jZh5_pLUoOoZ = ehT0Px3KOsy9(chr(0b110000) + chr(7631 - 7520) + '\066', ord("\x08"))
n4ljua2gi1Pr._bgUL5bKS4aC *= ehT0Px3KOsy9(chr(290 - 242) + chr(0b1101111) + '\x32', ord("\x08"))
n4ljua2gi1Pr.NWyBKAEDaEIK *= ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(50), 8)
return n4ljua2gi1Pr
|
tensorflow/tensor2tensor
|
tensor2tensor/models/research/autoencoders.py
|
autoencoder_ordered_text
|
def autoencoder_ordered_text():
"""Ordered discrete autoencoder model for text."""
hparams = autoencoder_ordered_discrete()
hparams.bottleneck_bits = 1024
hparams.bottleneck_shared_bits = 1024-64
hparams.bottleneck_shared_bits_start_warmup = 75000
hparams.bottleneck_shared_bits_stop_warmup = 275000
hparams.num_hidden_layers = 7
hparams.batch_size = 1024
hparams.autoregressive_mode = "conv5"
hparams.max_hidden_size = 1024
hparams.bottom = {
"inputs": modalities.identity_bottom,
"targets": modalities.identity_bottom,
}
hparams.top = {
"targets": modalities.identity_top,
}
hparams.sample_height = 128
hparams.sample_width = 1
return hparams
|
python
|
def autoencoder_ordered_text():
"""Ordered discrete autoencoder model for text."""
hparams = autoencoder_ordered_discrete()
hparams.bottleneck_bits = 1024
hparams.bottleneck_shared_bits = 1024-64
hparams.bottleneck_shared_bits_start_warmup = 75000
hparams.bottleneck_shared_bits_stop_warmup = 275000
hparams.num_hidden_layers = 7
hparams.batch_size = 1024
hparams.autoregressive_mode = "conv5"
hparams.max_hidden_size = 1024
hparams.bottom = {
"inputs": modalities.identity_bottom,
"targets": modalities.identity_bottom,
}
hparams.top = {
"targets": modalities.identity_top,
}
hparams.sample_height = 128
hparams.sample_width = 1
return hparams
|
[
"def",
"autoencoder_ordered_text",
"(",
")",
":",
"hparams",
"=",
"autoencoder_ordered_discrete",
"(",
")",
"hparams",
".",
"bottleneck_bits",
"=",
"1024",
"hparams",
".",
"bottleneck_shared_bits",
"=",
"1024",
"-",
"64",
"hparams",
".",
"bottleneck_shared_bits_start_warmup",
"=",
"75000",
"hparams",
".",
"bottleneck_shared_bits_stop_warmup",
"=",
"275000",
"hparams",
".",
"num_hidden_layers",
"=",
"7",
"hparams",
".",
"batch_size",
"=",
"1024",
"hparams",
".",
"autoregressive_mode",
"=",
"\"conv5\"",
"hparams",
".",
"max_hidden_size",
"=",
"1024",
"hparams",
".",
"bottom",
"=",
"{",
"\"inputs\"",
":",
"modalities",
".",
"identity_bottom",
",",
"\"targets\"",
":",
"modalities",
".",
"identity_bottom",
",",
"}",
"hparams",
".",
"top",
"=",
"{",
"\"targets\"",
":",
"modalities",
".",
"identity_top",
",",
"}",
"hparams",
".",
"sample_height",
"=",
"128",
"hparams",
".",
"sample_width",
"=",
"1",
"return",
"hparams"
] |
Ordered discrete autoencoder model for text.
|
[
"Ordered",
"discrete",
"autoencoder",
"model",
"for",
"text",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/models/research/autoencoders.py#L1214-L1234
|
train
|
Ordered discrete autoencoder model for text.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h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xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(2600 - 2549) + '\x34', 0b1000), ehT0Px3KOsy9(chr(0b101100 + 0o4) + '\157' + '\x31', 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + '\066' + '\x35', 0b1000), ehT0Px3KOsy9(chr(815 - 767) + chr(0b1101111) + chr(49) + chr(979 - 928) + chr(0b100011 + 0o16), 0b1000), ehT0Px3KOsy9(chr(1180 - 1132) + chr(0b1010100 + 0o33) + chr(0b110010) + chr(2396 - 2346), 0b1000), ehT0Px3KOsy9(chr(48) + chr(2847 - 2736) + chr(49) + '\x32' + '\061', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110110), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1010010 + 0o35) + '\062' + '\063', 13952 - 13944), ehT0Px3KOsy9('\060' + chr(11447 - 11336) + chr(1790 - 1740) + chr(0b110110) + chr(0b10000 + 0o47), 23052 - 23044), ehT0Px3KOsy9(chr(571 - 523) + '\x6f' + chr(0b110100) + chr(1320 - 1270), 0b1000), ehT0Px3KOsy9(chr(0b100 + 0o54) + chr(0b110 + 0o151) + '\x31' + chr(0b110100) + chr(0b100011 + 0o17), 0o10), ehT0Px3KOsy9('\x30' + chr(0b100101 + 0o112) + '\062' + '\x30' + chr(50), 0b1000), ehT0Px3KOsy9('\060' + chr(0b10 + 0o155) + chr(1251 - 1201) + chr(0b10100 + 0o37) + chr(53), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(49) + chr(0b110001) + chr(48), 7539 - 7531), ehT0Px3KOsy9(chr(48) + '\157' + '\x37' + '\066', 0o10), ehT0Px3KOsy9(chr(0b11000 + 0o30) + chr(111) + chr(0b110001) + chr(0b110101 + 0o2) + chr(48), 10031 - 10023), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\063' + chr(1242 - 1193), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + '\062' + chr(0b1111 + 0o41) + '\x30', ord("\x08")), ehT0Px3KOsy9(chr(1572 - 1524) + chr(111) + '\x32' + chr(0b110110) + chr(0b111 + 0o57), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110110), 8), ehT0Px3KOsy9(chr(0b100111 + 0o11) + '\x6f' + chr(1198 - 1149) + chr(0b110001) + '\062', 0b1000), ehT0Px3KOsy9('\060' + chr(10609 - 10498) + '\x31' + chr(54) + chr(1448 - 1396), 32390 - 32382), ehT0Px3KOsy9(chr(0b11101 + 0o23) + '\x6f' + chr(164 - 115) + chr(2084 - 2034) + chr(55), ord("\x08")), ehT0Px3KOsy9(chr(0b11110 + 0o22) + chr(111) + chr(0b10 + 0o61) + chr(0b101111 + 0o6) + chr(0b100 + 0o56), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110110) + chr(2395 - 2342), 8), ehT0Px3KOsy9(chr(0b1010 + 0o46) + chr(0b100110 + 0o111) + chr(0b110101) + '\x34', 0o10), ehT0Px3KOsy9(chr(0b11000 + 0o30) + chr(0b1101111) + chr(0b100100 + 0o17) + chr(53) + chr(2618 - 2565), 12629 - 12621), ehT0Px3KOsy9(chr(0b1101 + 0o43) + chr(11578 - 11467) + '\061' + chr(54) + '\x30', 0o10), ehT0Px3KOsy9('\060' + chr(0b1000101 + 0o52) + chr(0b110111) + chr(0b1110 + 0o43), 0o10), ehT0Px3KOsy9('\x30' + chr(7302 - 7191) + chr(0b10011 + 0o37) + '\063' + '\060', ord("\x08")), ehT0Px3KOsy9(chr(2162 - 2114) + chr(0b111111 + 0o60) + chr(0b110101) + chr(0b10 + 0o61), 62444 - 62436), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110010) + '\065' + '\067', ord("\x08")), ehT0Px3KOsy9(chr(0b11101 + 0o23) + chr(0b1101111) + chr(95 - 44) + '\066' + chr(1279 - 1229), 0b1000), ehT0Px3KOsy9(chr(268 - 220) + chr(111) + '\x31' + '\x32' + chr(1747 - 1694), 0b1000), ehT0Px3KOsy9(chr(545 - 497) + '\157' + chr(0b1000 + 0o53) + chr(0b100100 + 0o14) + chr(0b110100), 4917 - 4909), ehT0Px3KOsy9(chr(143 - 95) + chr(0b111101 + 0o62) + '\061', 8), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110001) + chr(0b110111) + chr(689 - 639), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(4206 - 4095) + chr(0b110011) + chr(0b11010 + 0o35) + chr(510 - 455), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b101100 + 0o103) + chr(51) + chr(0b110010) + chr(1175 - 1126), ord("\x08")), ehT0Px3KOsy9(chr(1046 - 998) + '\157' + chr(1635 - 1585) + chr(0b110100), 11074 - 11066)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b11100 + 0o31) + chr(0b11110 + 0o22), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'2'), '\x64' + chr(0b1100101) + chr(0b1100011) + chr(0b1101111) + chr(100) + '\x65')(chr(0b1110101) + chr(116) + chr(4963 - 4861) + '\x2d' + '\x38') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def _OqgVGOqOBIs():
n4ljua2gi1Pr = OPlRadR0YQXV()
n4ljua2gi1Pr.L0tf_yAed5SW = ehT0Px3KOsy9(chr(0b101010 + 0o6) + chr(111) + '\062' + chr(1796 - 1748) + chr(0b110000) + chr(320 - 272), ord("\x08"))
n4ljua2gi1Pr.e6Qwu74OkpHd = ehT0Px3KOsy9(chr(1775 - 1727) + chr(0b1101111) + chr(50) + chr(0b100101 + 0o13) + chr(0b110000) + '\x30', 8) - ehT0Px3KOsy9(chr(304 - 256) + chr(0b1101111) + '\061' + '\x30' + chr(1481 - 1433), ord("\x08"))
n4ljua2gi1Pr.D6wPgpeGVUiT = ehT0Px3KOsy9(chr(48) + '\157' + chr(0b101101 + 0o5) + '\062' + chr(0b110010) + '\063' + chr(854 - 799) + '\060', ord("\x08"))
n4ljua2gi1Pr.ls8eQ5_Tt5TD = ehT0Px3KOsy9(chr(1020 - 972) + chr(0b1101111) + '\x31' + chr(2226 - 2178) + '\063' + '\x31' + chr(0b11000 + 0o30) + chr(0b11000 + 0o37) + '\x30', 0b1000)
n4ljua2gi1Pr.jZh5_pLUoOoZ = ehT0Px3KOsy9(chr(955 - 907) + '\157' + '\x37', 0b1000)
n4ljua2gi1Pr.ix9dZyeAmUxY = ehT0Px3KOsy9('\x30' + '\x6f' + '\062' + chr(0b100 + 0o54) + chr(353 - 305) + chr(0b110000), 8)
n4ljua2gi1Pr.dVAeFZcIWq3s = xafqLlk3kkUe(SXOLrMavuUCe(b"\x7fn[/'"), chr(100) + '\145' + chr(0b1100011) + '\x6f' + chr(0b1100 + 0o130) + chr(101))(chr(117) + chr(0b1011110 + 0o26) + chr(0b111110 + 0o50) + chr(0b101101) + '\070')
n4ljua2gi1Pr.qvRmw7LWEKc9 = ehT0Px3KOsy9('\x30' + chr(0b1010100 + 0o33) + chr(50) + '\060' + '\060' + '\x30', 8)
n4ljua2gi1Pr.kXxsZxlIQUSQ = {xafqLlk3kkUe(SXOLrMavuUCe(b'uoE,f"'), chr(7119 - 7019) + chr(0b1100101) + chr(0b1100011) + chr(111) + '\144' + chr(0b1001001 + 0o34))('\x75' + '\164' + chr(1088 - 986) + chr(45) + chr(0b111000)): PuPeNl0CuqOQ.identity_bottom, xafqLlk3kkUe(SXOLrMavuUCe(b'h`G>w%u'), chr(100) + '\x65' + '\143' + chr(438 - 327) + '\144' + '\145')(chr(117) + chr(12086 - 11970) + chr(102) + '\055' + chr(2630 - 2574)): PuPeNl0CuqOQ.identity_bottom}
n4ljua2gi1Pr.qxrVBjeryNEZ = {xafqLlk3kkUe(SXOLrMavuUCe(b'h`G>w%u'), chr(0b1001 + 0o133) + '\x65' + chr(0b111100 + 0o47) + chr(111) + '\x64' + '\x65')(chr(117) + chr(0b1000111 + 0o55) + '\146' + '\055' + '\x38'): PuPeNl0CuqOQ.identity_top}
n4ljua2gi1Pr.x9qIvtbWQzPL = ehT0Px3KOsy9('\060' + '\157' + chr(0b110010) + chr(1210 - 1162) + chr(48), 8)
n4ljua2gi1Pr.hA8DhFV4eGXo = ehT0Px3KOsy9(chr(48) + chr(0b0 + 0o157) + chr(49), 8)
return n4ljua2gi1Pr
|
tensorflow/tensor2tensor
|
tensor2tensor/models/research/autoencoders.py
|
autoencoder_ordered_text_small
|
def autoencoder_ordered_text_small():
"""Ordered discrete autoencoder model for text, small version."""
hparams = autoencoder_ordered_text()
hparams.bottleneck_bits = 32
hparams.num_hidden_layers = 3
hparams.hidden_size = 64
hparams.max_hidden_size = 512
hparams.bottleneck_noise = 0.0
hparams.autoregressive_mode = "conv5"
hparams.sample_height = 4
return hparams
|
python
|
def autoencoder_ordered_text_small():
"""Ordered discrete autoencoder model for text, small version."""
hparams = autoencoder_ordered_text()
hparams.bottleneck_bits = 32
hparams.num_hidden_layers = 3
hparams.hidden_size = 64
hparams.max_hidden_size = 512
hparams.bottleneck_noise = 0.0
hparams.autoregressive_mode = "conv5"
hparams.sample_height = 4
return hparams
|
[
"def",
"autoencoder_ordered_text_small",
"(",
")",
":",
"hparams",
"=",
"autoencoder_ordered_text",
"(",
")",
"hparams",
".",
"bottleneck_bits",
"=",
"32",
"hparams",
".",
"num_hidden_layers",
"=",
"3",
"hparams",
".",
"hidden_size",
"=",
"64",
"hparams",
".",
"max_hidden_size",
"=",
"512",
"hparams",
".",
"bottleneck_noise",
"=",
"0.0",
"hparams",
".",
"autoregressive_mode",
"=",
"\"conv5\"",
"hparams",
".",
"sample_height",
"=",
"4",
"return",
"hparams"
] |
Ordered discrete autoencoder model for text, small version.
|
[
"Ordered",
"discrete",
"autoencoder",
"model",
"for",
"text",
"small",
"version",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/models/research/autoencoders.py#L1238-L1248
|
train
|
Ordered discrete autoencoder model for text small version.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0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kKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\063' + chr(1278 - 1227), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110010) + chr(1678 - 1627) + chr(0b110000), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x32' + chr(428 - 380) + '\060', 0b1000), ehT0Px3KOsy9(chr(0b11100 + 0o24) + '\157' + chr(1126 - 1075) + chr(1332 - 1281) + chr(0b11001 + 0o35), 0o10), ehT0Px3KOsy9(chr(543 - 495) + chr(111) + chr(0b11001 + 0o32) + chr(1770 - 1720) + '\x30', 0o10), ehT0Px3KOsy9(chr(0b0 + 0o60) + '\x6f' + chr(2197 - 2148) + chr(0b110100) + '\x33', ord("\x08")), ehT0Px3KOsy9(chr(0b1100 + 0o44) + '\x6f' + '\063' + chr(0b110111) + chr(54), 0o10), ehT0Px3KOsy9(chr(0b10 + 0o56) + '\x6f' + chr(0b110011) + '\x33' + chr(1314 - 1265), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b100000 + 0o117) + '\x31' + chr(2921 - 2866) + chr(0b1101 + 0o50), 0b1000), ehT0Px3KOsy9('\x30' + chr(10317 - 10206) + chr(0b10101 + 0o34) + chr(1057 - 1005) + chr(1811 - 1760), 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(49) + chr(1637 - 1588) + '\065', ord("\x08")), ehT0Px3KOsy9(chr(1386 - 1338) + chr(0b110 + 0o151) + chr(0b110001) + '\066' + chr(0b110011), 32679 - 32671), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(688 - 639) + '\x34' + chr(1870 - 1816), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1001010 + 0o45) + chr(0b10111 + 0o35) + chr(0b1011 + 0o47), ord("\x08")), ehT0Px3KOsy9(chr(1775 - 1727) + chr(0b100000 + 0o117) + chr(51) + '\x30' + chr(52), 0b1000), ehT0Px3KOsy9(chr(1713 - 1665) + chr(9147 - 9036) + '\x31' + chr(0b10 + 0o63) + chr(0b110001), 0o10), ehT0Px3KOsy9('\x30' + '\157' + '\065' + '\065', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(55) + chr(990 - 935), 3322 - 3314), ehT0Px3KOsy9(chr(1186 - 1138) + chr(2597 - 2486) + chr(2191 - 2142) + chr(0b110000) + '\063', 44686 - 44678), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(51) + '\064' + chr(2180 - 2131), 0o10), ehT0Px3KOsy9(chr(0b110000 + 0o0) + chr(0b1101111) + '\061' + '\x35' + chr(0b110011 + 0o4), 0o10), ehT0Px3KOsy9(chr(1501 - 1453) + '\157' + '\062' + chr(884 - 831) + chr(864 - 814), 0b1000), ehT0Px3KOsy9(chr(0b1110 + 0o42) + chr(415 - 304) + chr(2118 - 2067) + chr(2732 - 2677) + '\x37', 0o10), ehT0Px3KOsy9('\060' + chr(8496 - 8385) + chr(0b110010 + 0o1) + chr(612 - 561) + chr(0b10000 + 0o43), 0o10), ehT0Px3KOsy9(chr(0b10010 + 0o36) + chr(0b1101111) + '\062' + '\x33', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b100001 + 0o116) + '\x32' + '\x36', 0b1000), ehT0Px3KOsy9(chr(0b11111 + 0o21) + '\x6f' + chr(0b11010 + 0o31) + chr(55) + chr(50), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + '\x34' + chr(49), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + '\x32' + '\066' + chr(49), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\061' + chr(0b110111) + '\x31', 0o10), ehT0Px3KOsy9(chr(1622 - 1574) + chr(111) + '\x32' + chr(1969 - 1920) + '\066', 0b1000), ehT0Px3KOsy9(chr(48) + chr(10024 - 9913) + '\062' + chr(50) + chr(859 - 808), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\062' + chr(0b0 + 0o61) + chr(428 - 374), 8), ehT0Px3KOsy9(chr(1260 - 1212) + '\x6f' + chr(0b110010) + chr(48) + chr(246 - 197), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(5379 - 5268) + chr(2163 - 2112) + chr(0b110001), 2644 - 2636), ehT0Px3KOsy9(chr(268 - 220) + chr(111) + chr(49) + '\067' + chr(0b10000 + 0o44), ord("\x08")), ehT0Px3KOsy9(chr(0b11000 + 0o30) + chr(0b1101111) + chr(0b10011 + 0o37) + chr(48) + '\060', 8), ehT0Px3KOsy9(chr(0b100000 + 0o20) + chr(10772 - 10661) + '\062' + chr(0b10100 + 0o41) + '\060', 0b1000), ehT0Px3KOsy9(chr(48) + chr(9726 - 9615) + '\x32' + chr(0b101010 + 0o11) + '\062', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b100100 + 0o15) + chr(0b1100 + 0o45) + '\x34', 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + '\157' + '\x35' + chr(0b110000), 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'5'), chr(100) + chr(101) + '\x63' + '\157' + chr(0b1110 + 0o126) + chr(101))(chr(117) + '\x74' + '\146' + '\055' + '\x38') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def alYp8JklZish():
n4ljua2gi1Pr = _OqgVGOqOBIs()
n4ljua2gi1Pr.L0tf_yAed5SW = ehT0Px3KOsy9('\x30' + chr(7341 - 7230) + chr(969 - 917) + '\060', ord("\x08"))
n4ljua2gi1Pr.jZh5_pLUoOoZ = ehT0Px3KOsy9('\060' + '\x6f' + chr(0b10011 + 0o40), 8151 - 8143)
n4ljua2gi1Pr.qzoyXN3kdhDL = ehT0Px3KOsy9(chr(0b110000) + chr(8453 - 8342) + chr(1203 - 1154) + chr(0b1101 + 0o43) + chr(48), 0o10)
n4ljua2gi1Pr.qvRmw7LWEKc9 = ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110001) + chr(703 - 655) + chr(0b1111 + 0o41) + chr(48), 12216 - 12208)
n4ljua2gi1Pr.r1G583Dm7QSl = 0.0
n4ljua2gi1Pr.dVAeFZcIWq3s = xafqLlk3kkUe(SXOLrMavuUCe(b'x\xf7\xee\xa8\xe5'), chr(3662 - 3562) + '\x65' + chr(99) + chr(111) + chr(0b111111 + 0o45) + chr(0b11010 + 0o113))(chr(0b111010 + 0o73) + chr(116) + '\146' + chr(0b100111 + 0o6) + chr(0b0 + 0o70))
n4ljua2gi1Pr.x9qIvtbWQzPL = ehT0Px3KOsy9('\x30' + chr(8277 - 8166) + chr(0b101001 + 0o13), 0o10)
return n4ljua2gi1Pr
|
tensorflow/tensor2tensor
|
tensor2tensor/models/research/autoencoders.py
|
autoencoder_discrete_pong
|
def autoencoder_discrete_pong():
"""Discrete autoencoder model for compressing pong frames."""
hparams = autoencoder_ordered_discrete()
hparams.num_hidden_layers = 3
hparams.bottleneck_bits = 24
hparams.batch_size = 2
hparams.gan_loss_factor = 0.01
hparams.bottleneck_l2_factor = 0.001
hparams.add_hparam("video_modality_loss_cutoff", 0.02)
return hparams
|
python
|
def autoencoder_discrete_pong():
"""Discrete autoencoder model for compressing pong frames."""
hparams = autoencoder_ordered_discrete()
hparams.num_hidden_layers = 3
hparams.bottleneck_bits = 24
hparams.batch_size = 2
hparams.gan_loss_factor = 0.01
hparams.bottleneck_l2_factor = 0.001
hparams.add_hparam("video_modality_loss_cutoff", 0.02)
return hparams
|
[
"def",
"autoencoder_discrete_pong",
"(",
")",
":",
"hparams",
"=",
"autoencoder_ordered_discrete",
"(",
")",
"hparams",
".",
"num_hidden_layers",
"=",
"3",
"hparams",
".",
"bottleneck_bits",
"=",
"24",
"hparams",
".",
"batch_size",
"=",
"2",
"hparams",
".",
"gan_loss_factor",
"=",
"0.01",
"hparams",
".",
"bottleneck_l2_factor",
"=",
"0.001",
"hparams",
".",
"add_hparam",
"(",
"\"video_modality_loss_cutoff\"",
",",
"0.02",
")",
"return",
"hparams"
] |
Discrete autoencoder model for compressing pong frames.
|
[
"Discrete",
"autoencoder",
"model",
"for",
"compressing",
"pong",
"frames",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/models/research/autoencoders.py#L1261-L1270
|
train
|
Discrete autoencoder model for compressing pong frames.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9q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OH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + chr(3434 - 3323) + '\062' + '\x30' + chr(70 - 15), ord("\x08")), ehT0Px3KOsy9(chr(576 - 528) + '\157' + chr(49) + chr(326 - 278) + chr(1069 - 1018), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + '\x32' + chr(48) + chr(50), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110010) + '\067' + '\064', 42658 - 42650), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b100110 + 0o15) + chr(50) + '\x36', ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(54) + chr(1187 - 1137), 0o10), ehT0Px3KOsy9(chr(86 - 38) + chr(0b1101111) + chr(49) + chr(984 - 930) + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(0b101010 + 0o6) + chr(0b1101111) + chr(489 - 438) + '\x34' + chr(0b101 + 0o57), 10227 - 10219), ehT0Px3KOsy9('\060' + '\x6f' + '\062' + chr(48) + '\067', 8), ehT0Px3KOsy9('\060' + '\157' + chr(393 - 344) + '\x37', 0b1000), ehT0Px3KOsy9(chr(1195 - 1147) + '\x6f' + chr(0b110000 + 0o2) + chr(0b101010 + 0o15) + chr(0b110000), ord("\x08")), ehT0Px3KOsy9(chr(1867 - 1819) + chr(5488 - 5377) + '\062' + chr(52) + chr(0b110101), 0b1000), ehT0Px3KOsy9('\x30' + chr(3446 - 3335) + chr(0b11100 + 0o25) + chr(0b110010) + '\061', 63265 - 63257), ehT0Px3KOsy9(chr(0b100101 + 0o13) + '\x6f' + chr(2469 - 2418) + chr(0b10100 + 0o35) + chr(0b11000 + 0o33), ord("\x08")), ehT0Px3KOsy9(chr(0b10110 + 0o32) + chr(111) + chr(0b1111 + 0o42) + '\x37' + chr(0b111 + 0o55), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + '\062' + '\x31' + '\x33', 13500 - 13492), ehT0Px3KOsy9('\060' + '\x6f' + chr(1088 - 1037) + chr(52) + chr(49), 63203 - 63195), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(1791 - 1742) + chr(0b10010 + 0o40) + '\x30', 26781 - 26773), ehT0Px3KOsy9(chr(0b1011 + 0o45) + chr(10904 - 10793) + chr(0b111 + 0o56), 0b1000), ehT0Px3KOsy9(chr(0b101 + 0o53) + chr(0b1101111) + '\062' + chr(2088 - 2037) + chr(49), 0o10), ehT0Px3KOsy9(chr(1560 - 1512) + chr(0b100100 + 0o113) + chr(0b110111 + 0o0) + chr(0b10100 + 0o34), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b1 + 0o57), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(2096 - 2046) + '\067' + chr(837 - 783), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b101010 + 0o105) + '\x32' + chr(1133 - 1084) + chr(0b110101), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110101) + '\x34', ord("\x08")), ehT0Px3KOsy9(chr(0b101 + 0o53) + chr(0b1101111) + chr(0b110001) + chr(52) + chr(0b11010 + 0o27), 30630 - 30622), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b11110 + 0o25) + chr(55) + '\064', 0o10), ehT0Px3KOsy9('\x30' + chr(0b101110 + 0o101) + '\x31' + chr(788 - 737), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110001) + chr(50) + chr(0b110111), 32346 - 32338), ehT0Px3KOsy9('\060' + chr(111) + chr(49) + chr(2364 - 2314) + chr(0b110110), 4939 - 4931), ehT0Px3KOsy9(chr(0b100111 + 0o11) + chr(111) + chr(481 - 430) + '\066' + chr(0b101100 + 0o6), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(2517 - 2466) + chr(50) + chr(1731 - 1683), 0o10), ehT0Px3KOsy9(chr(614 - 566) + chr(111) + chr(0b100 + 0o55) + chr(0b110011) + '\060', ord("\x08")), ehT0Px3KOsy9(chr(828 - 780) + chr(3281 - 3170) + '\061' + chr(0b100000 + 0o25) + '\x35', 35869 - 35861), ehT0Px3KOsy9(chr(0b11011 + 0o25) + chr(0b1110 + 0o141) + '\063' + '\x34' + chr(492 - 443), 8), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x37' + chr(0b1 + 0o63), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1100 + 0o143) + chr(0b100111 + 0o14) + chr(0b110011) + '\066', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(50) + '\x32' + chr(0b110101), 0b1000), ehT0Px3KOsy9(chr(1427 - 1379) + chr(111) + chr(49) + chr(189 - 140), 12816 - 12808), ehT0Px3KOsy9('\x30' + chr(111) + '\062' + chr(0b110010) + chr(52), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(1166 - 1118) + '\x6f' + chr(0b110101) + '\x30', ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xa9'), chr(100) + chr(101) + '\143' + '\157' + '\x64' + chr(0b101001 + 0o74))(chr(10424 - 10307) + chr(0b1100011 + 0o21) + '\x66' + chr(0b1010 + 0o43) + '\x38') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def O1HbFV1j5OEi():
n4ljua2gi1Pr = OPlRadR0YQXV()
n4ljua2gi1Pr.jZh5_pLUoOoZ = ehT0Px3KOsy9(chr(0b101111 + 0o1) + '\x6f' + '\x33', ord("\x08"))
n4ljua2gi1Pr.L0tf_yAed5SW = ehT0Px3KOsy9(chr(0b110000) + chr(5774 - 5663) + chr(0b110011) + '\x30', 0b1000)
n4ljua2gi1Pr.ix9dZyeAmUxY = ehT0Px3KOsy9('\x30' + chr(0b110000 + 0o77) + '\x32', 0b1000)
n4ljua2gi1Pr.z9N86wgFuCJ3 = 0.01
n4ljua2gi1Pr.D7sYCuZ9Gd1t = 0.001
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b"\xe6'\xe6\xe3\xbeB\x11\x96\xe6b"), '\x64' + '\145' + chr(7517 - 7418) + chr(0b110 + 0o151) + '\x64' + '\145')('\x75' + chr(116) + chr(0b1100110) + chr(0b10111 + 0o26) + chr(1412 - 1356)))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xf1*\xe6\xd9\xb9m\x1d\x8b\xe3n\xd4\xcc%\xb2#\xe7\x8e#v\xc6[u\xca\xe2J\x07'), chr(0b1100100) + '\145' + chr(0b1001 + 0o132) + chr(111) + '\x64' + '\145')('\165' + chr(116) + '\x66' + chr(45) + chr(823 - 767)), 0.02)
return n4ljua2gi1Pr
|
tensorflow/tensor2tensor
|
tensor2tensor/models/research/autoencoders.py
|
autoencoder_discrete_tiny
|
def autoencoder_discrete_tiny():
"""Discrete autoencoder model for compressing pong frames for testing."""
hparams = autoencoder_ordered_discrete()
hparams.num_hidden_layers = 2
hparams.bottleneck_bits = 24
hparams.batch_size = 2
hparams.gan_loss_factor = 0.
hparams.bottleneck_l2_factor = 0.001
hparams.add_hparam("video_modality_loss_cutoff", 0.02)
hparams.num_residual_layers = 1
hparams.hidden_size = 32
hparams.max_hidden_size = 64
return hparams
|
python
|
def autoencoder_discrete_tiny():
"""Discrete autoencoder model for compressing pong frames for testing."""
hparams = autoencoder_ordered_discrete()
hparams.num_hidden_layers = 2
hparams.bottleneck_bits = 24
hparams.batch_size = 2
hparams.gan_loss_factor = 0.
hparams.bottleneck_l2_factor = 0.001
hparams.add_hparam("video_modality_loss_cutoff", 0.02)
hparams.num_residual_layers = 1
hparams.hidden_size = 32
hparams.max_hidden_size = 64
return hparams
|
[
"def",
"autoencoder_discrete_tiny",
"(",
")",
":",
"hparams",
"=",
"autoencoder_ordered_discrete",
"(",
")",
"hparams",
".",
"num_hidden_layers",
"=",
"2",
"hparams",
".",
"bottleneck_bits",
"=",
"24",
"hparams",
".",
"batch_size",
"=",
"2",
"hparams",
".",
"gan_loss_factor",
"=",
"0.",
"hparams",
".",
"bottleneck_l2_factor",
"=",
"0.001",
"hparams",
".",
"add_hparam",
"(",
"\"video_modality_loss_cutoff\"",
",",
"0.02",
")",
"hparams",
".",
"num_residual_layers",
"=",
"1",
"hparams",
".",
"hidden_size",
"=",
"32",
"hparams",
".",
"max_hidden_size",
"=",
"64",
"return",
"hparams"
] |
Discrete autoencoder model for compressing pong frames for testing.
|
[
"Discrete",
"autoencoder",
"model",
"for",
"compressing",
"pong",
"frames",
"for",
"testing",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/models/research/autoencoders.py#L1274-L1286
|
train
|
Discrete autoencoder model for compressing pong frames for testing.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOd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BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(50) + '\x35' + chr(50), 0b1000), ehT0Px3KOsy9(chr(0b100101 + 0o13) + '\157' + chr(0b1100 + 0o45) + '\x30' + '\067', 54191 - 54183), ehT0Px3KOsy9(chr(48) + chr(0b110100 + 0o73) + chr(0b110011) + chr(0b101110 + 0o11) + chr(1528 - 1473), 0b1000), ehT0Px3KOsy9(chr(1535 - 1487) + chr(10782 - 10671) + chr(0b110101) + chr(0b110010), 0o10), ehT0Px3KOsy9(chr(716 - 668) + '\x6f' + chr(942 - 893) + '\x37' + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110000), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(11053 - 10942) + '\x32' + chr(52) + '\x34', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1110 + 0o141) + chr(2469 - 2414) + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(0b1010 + 0o46) + '\x6f' + chr(50) + chr(0b110000), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110001) + chr(50) + chr(0b110000), 21531 - 21523), ehT0Px3KOsy9(chr(48) + chr(8900 - 8789) + '\x33' + '\x32' + '\x37', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(1983 - 1934) + '\x31' + chr(0b110111), 21521 - 21513), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(1483 - 1433) + chr(0b110100) + chr(1231 - 1178), 50990 - 50982), ehT0Px3KOsy9(chr(48) + chr(111) + '\062' + chr(0b110010) + chr(53), ord("\x08")), ehT0Px3KOsy9('\060' + chr(3849 - 3738) + '\x34' + chr(0b101 + 0o55), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b10110 + 0o37) + chr(0b110010), 8), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(50) + chr(49) + '\x31', 18391 - 18383), ehT0Px3KOsy9('\060' + chr(0b10 + 0o155) + chr(2016 - 1966) + '\060' + chr(0b1 + 0o62), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x31' + chr(48) + chr(55), 8), ehT0Px3KOsy9('\x30' + chr(2735 - 2624) + chr(1272 - 1221) + chr(55) + '\x35', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(10447 - 10336) + '\062' + chr(0b101001 + 0o12) + '\066', 0b1000), ehT0Px3KOsy9(chr(662 - 614) + chr(111) + '\x31' + chr(52) + chr(0b110001 + 0o4), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + '\063' + '\x34' + chr(55), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b10110 + 0o40) + chr(1284 - 1234), 0o10), ehT0Px3KOsy9('\x30' + chr(0b101 + 0o152) + chr(0b110010) + '\060' + '\x34', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110011) + chr(0b100001 + 0o17) + chr(0b110000), ord("\x08")), ehT0Px3KOsy9(chr(1856 - 1808) + chr(111) + chr(0b110010) + chr(1112 - 1062) + chr(55), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + '\x32' + chr(1618 - 1566) + chr(0b11000 + 0o34), 8), ehT0Px3KOsy9('\060' + '\x6f' + chr(161 - 110) + chr(0b110110) + '\x32', 0b1000), ehT0Px3KOsy9(chr(48) + chr(10493 - 10382) + chr(53) + '\063', 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + '\062' + chr(48) + chr(0b110011), 8), ehT0Px3KOsy9(chr(0b101100 + 0o4) + '\x6f' + '\x33' + chr(49) + chr(2243 - 2195), 0o10), ehT0Px3KOsy9('\060' + chr(2835 - 2724) + '\063' + chr(2190 - 2140) + chr(0b100011 + 0o22), 0b1000), ehT0Px3KOsy9(chr(847 - 799) + '\x6f' + chr(0b1010 + 0o53) + chr(2634 - 2581), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b1011 + 0o47) + chr(53) + chr(0b110000), 0b1000), ehT0Px3KOsy9(chr(1940 - 1892) + chr(111) + chr(882 - 832) + '\060' + chr(0b110101), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x32' + chr(49) + chr(0b100101 + 0o15), 0b1000), ehT0Px3KOsy9(chr(1158 - 1110) + chr(4403 - 4292) + chr(50) + '\x30', 8), ehT0Px3KOsy9('\x30' + '\x6f' + chr(49) + '\065' + chr(0b101110 + 0o6), 43619 - 43611), ehT0Px3KOsy9('\060' + '\157' + chr(0b1011 + 0o50) + chr(0b110111) + chr(0b10110 + 0o32), ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(1977 - 1924) + chr(846 - 798), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x84'), '\x64' + '\x65' + chr(0b10111 + 0o114) + chr(0b1101111) + '\x64' + chr(0b1100101))('\165' + chr(0b111011 + 0o71) + chr(7932 - 7830) + '\x2d' + chr(0b10100 + 0o44)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def EUI2oi9hwLC1():
n4ljua2gi1Pr = OPlRadR0YQXV()
n4ljua2gi1Pr.jZh5_pLUoOoZ = ehT0Px3KOsy9(chr(1950 - 1902) + '\x6f' + chr(0b110010), ord("\x08"))
n4ljua2gi1Pr.L0tf_yAed5SW = ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b11110 + 0o25) + '\x30', 0b1000)
n4ljua2gi1Pr.ix9dZyeAmUxY = ehT0Px3KOsy9('\x30' + chr(111) + chr(1025 - 975), 8)
n4ljua2gi1Pr.z9N86wgFuCJ3 = 0.0
n4ljua2gi1Pr.D7sYCuZ9Gd1t = 0.001
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'\xcb#\x9bu\x16p\xc5Nq='), chr(0b1100100) + '\145' + chr(0b101100 + 0o67) + '\157' + chr(0b10100 + 0o120) + '\x65')(chr(117) + '\164' + chr(102) + '\x2d' + '\070'))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xdc.\x9bO\x11_\xc9St1\xbb&\xd1\xec}F\xe6\xf04\xa2\xfd\x10\x93]\xe2\xa6'), chr(100) + chr(0b1001101 + 0o30) + chr(9644 - 9545) + chr(1630 - 1519) + '\x64' + '\145')('\165' + chr(0b1110100) + '\146' + '\x2d' + chr(0b111000)), 0.02)
n4ljua2gi1Pr.lYVM1gC3G8ZJ = ehT0Px3KOsy9('\x30' + chr(0b1010101 + 0o32) + '\x31', ord("\x08"))
n4ljua2gi1Pr.qzoyXN3kdhDL = ehT0Px3KOsy9(chr(0b100100 + 0o14) + chr(7531 - 7420) + chr(0b110100) + chr(0b110000), 30947 - 30939)
n4ljua2gi1Pr.qvRmw7LWEKc9 = ehT0Px3KOsy9(chr(0b10100 + 0o34) + chr(0b111101 + 0o62) + chr(0b101010 + 0o7) + '\x30' + chr(0b110000), 0b1000)
return n4ljua2gi1Pr
|
tensorflow/tensor2tensor
|
tensor2tensor/models/research/autoencoders.py
|
autoencoder_discrete_cifar
|
def autoencoder_discrete_cifar():
"""Discrete autoencoder model for compressing cifar."""
hparams = autoencoder_ordered_discrete()
hparams.bottleneck_noise = 0.0
hparams.bottleneck_bits = 90
hparams.num_hidden_layers = 2
hparams.hidden_size = 256
hparams.num_residual_layers = 4
hparams.batch_size = 32
hparams.learning_rate_constant = 1.0
return hparams
|
python
|
def autoencoder_discrete_cifar():
"""Discrete autoencoder model for compressing cifar."""
hparams = autoencoder_ordered_discrete()
hparams.bottleneck_noise = 0.0
hparams.bottleneck_bits = 90
hparams.num_hidden_layers = 2
hparams.hidden_size = 256
hparams.num_residual_layers = 4
hparams.batch_size = 32
hparams.learning_rate_constant = 1.0
return hparams
|
[
"def",
"autoencoder_discrete_cifar",
"(",
")",
":",
"hparams",
"=",
"autoencoder_ordered_discrete",
"(",
")",
"hparams",
".",
"bottleneck_noise",
"=",
"0.0",
"hparams",
".",
"bottleneck_bits",
"=",
"90",
"hparams",
".",
"num_hidden_layers",
"=",
"2",
"hparams",
".",
"hidden_size",
"=",
"256",
"hparams",
".",
"num_residual_layers",
"=",
"4",
"hparams",
".",
"batch_size",
"=",
"32",
"hparams",
".",
"learning_rate_constant",
"=",
"1.0",
"return",
"hparams"
] |
Discrete autoencoder model for compressing cifar.
|
[
"Discrete",
"autoencoder",
"model",
"for",
"compressing",
"cifar",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/models/research/autoencoders.py#L1290-L1300
|
train
|
Discrete autoencoder model for compressing cifar.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDASQ0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9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\060' + '\157' + '\063' + chr(0b110 + 0o52) + '\066', ord("\x08")), ehT0Px3KOsy9(chr(0b10101 + 0o33) + chr(10347 - 10236) + '\x32' + '\067' + '\066', 0b1000), ehT0Px3KOsy9(chr(1632 - 1584) + '\x6f' + '\x32' + chr(1650 - 1600) + chr(0b110011), 40015 - 40007), ehT0Px3KOsy9(chr(0b1000 + 0o50) + chr(0b1100001 + 0o16) + chr(0b110011) + chr(0b10001 + 0o42) + chr(2843 - 2788), 27637 - 27629), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(53) + chr(681 - 630), 33040 - 33032), ehT0Px3KOsy9(chr(1264 - 1216) + chr(0b1101111) + chr(746 - 696) + chr(0b101010 + 0o6) + chr(48), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110001) + '\x35' + chr(0b1011 + 0o50), 0b1000), ehT0Px3KOsy9(chr(0b100001 + 0o17) + '\157' + '\062' + '\066' + chr(0b110110), 56067 - 56059), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110011) + chr(0b110000), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(51) + chr(54) + chr(50), 18667 - 18659), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\063' + chr(55) + chr(2433 - 2380), 0o10), ehT0Px3KOsy9(chr(534 - 486) + chr(3654 - 3543) + chr(0b101111 + 0o2) + chr(0b1000 + 0o53) + chr(0b110101 + 0o0), 0b1000), ehT0Px3KOsy9(chr(0b11 + 0o55) + chr(0b1101111) + '\062', 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110011) + '\x31', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(49) + chr(0b110110) + chr(0b101 + 0o54), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(49) + chr(2436 - 2383) + '\063', 8), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\061' + chr(0b100101 + 0o15) + '\062', 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x33' + chr(54) + chr(50), 8), ehT0Px3KOsy9('\x30' + '\157' + chr(1777 - 1729), 0o10), ehT0Px3KOsy9('\x30' + '\157' + '\x33' + '\062' + chr(52), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1011010 + 0o25) + chr(2256 - 2207) + chr(0b10 + 0o61) + chr(2595 - 2540), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(1529 - 1479) + chr(0b11011 + 0o26) + chr(54), 0o10), ehT0Px3KOsy9(chr(1112 - 1064) + chr(2100 - 1989) + '\061' + '\x31' + '\066', 48899 - 48891), ehT0Px3KOsy9('\x30' + chr(111) + chr(55), 10712 - 10704), ehT0Px3KOsy9(chr(0b11010 + 0o26) + chr(111) + chr(1636 - 1585) + chr(0b11 + 0o64) + '\065', 8), ehT0Px3KOsy9('\060' + chr(111) + chr(51) + chr(0b11000 + 0o36) + chr(0b100011 + 0o22), 6552 - 6544), ehT0Px3KOsy9('\060' + chr(2150 - 2039) + '\x33' + '\061' + chr(1927 - 1873), 0o10), ehT0Px3KOsy9(chr(519 - 471) + chr(0b1101111) + chr(0b110001) + chr(0b10101 + 0o37) + chr(1415 - 1361), 34215 - 34207), ehT0Px3KOsy9(chr(0b110000) + chr(0b1110 + 0o141) + chr(673 - 624) + '\064' + chr(0b10010 + 0o37), 0o10), ehT0Px3KOsy9(chr(0b100101 + 0o13) + chr(0b1101111) + chr(0b110001) + chr(0b110111) + chr(1260 - 1205), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\061' + chr(0b10110 + 0o35), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b110011 + 0o74) + chr(49) + '\065' + chr(0b101 + 0o57), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b1000 + 0o53) + chr(1951 - 1899) + chr(0b0 + 0o63), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\063' + chr(0b110101) + '\x34', 0o10), ehT0Px3KOsy9(chr(1319 - 1271) + chr(111) + chr(1144 - 1095) + chr(0b1000 + 0o54) + chr(0b101010 + 0o13), ord("\x08")), ehT0Px3KOsy9(chr(1141 - 1093) + chr(0b1101111) + chr(1140 - 1089) + chr(726 - 671) + chr(0b110011), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(3930 - 3819) + chr(0b10010 + 0o37) + '\x37' + '\x36', 0b1000), ehT0Px3KOsy9(chr(964 - 916) + chr(111) + chr(50) + '\x36' + chr(48), 0o10), ehT0Px3KOsy9(chr(0b101111 + 0o1) + chr(6500 - 6389) + '\062' + chr(0b10 + 0o62) + chr(51), 0b1000), ehT0Px3KOsy9('\060' + chr(0b110110 + 0o71) + chr(0b100101 + 0o14) + '\062' + chr(2271 - 2223), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + chr(0b101 + 0o152) + chr(1858 - 1805) + '\x30', 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xe8'), chr(0b1001011 + 0o31) + '\145' + chr(8914 - 8815) + chr(0b1101111) + chr(8443 - 8343) + chr(3388 - 3287))('\165' + chr(9524 - 9408) + chr(0b1001110 + 0o30) + '\x2d' + '\x38') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def a0bSUqTwIEHW():
n4ljua2gi1Pr = OPlRadR0YQXV()
n4ljua2gi1Pr.r1G583Dm7QSl = 0.0
n4ljua2gi1Pr.L0tf_yAed5SW = ehT0Px3KOsy9(chr(0b1111 + 0o41) + chr(0b1101111) + chr(0b110001) + '\063' + chr(0b110010), ord("\x08"))
n4ljua2gi1Pr.jZh5_pLUoOoZ = ehT0Px3KOsy9(chr(48) + chr(0b1000100 + 0o53) + chr(50), 8)
n4ljua2gi1Pr.qzoyXN3kdhDL = ehT0Px3KOsy9(chr(0b101110 + 0o2) + chr(111) + chr(52) + chr(165 - 117) + chr(145 - 97), 0b1000)
n4ljua2gi1Pr.lYVM1gC3G8ZJ = ehT0Px3KOsy9(chr(48) + '\157' + '\x34', 0o10)
n4ljua2gi1Pr.ix9dZyeAmUxY = ehT0Px3KOsy9(chr(0b1110 + 0o42) + '\157' + '\064' + '\060', 0b1000)
n4ljua2gi1Pr.Ot9HUjnkxXA_ = 1.0
return n4ljua2gi1Pr
|
tensorflow/tensor2tensor
|
tensor2tensor/models/research/autoencoders.py
|
autoencoder_range
|
def autoencoder_range(rhp):
"""Tuning grid of the main autoencoder params."""
rhp.set_float("dropout", 0.01, 0.3)
rhp.set_float("gan_loss_factor", 0.01, 0.1)
rhp.set_float("bottleneck_l2_factor", 0.001, 0.1, scale=rhp.LOG_SCALE)
rhp.set_discrete("bottleneck_warmup_steps", [200, 2000])
rhp.set_float("gumbel_temperature", 0, 1)
rhp.set_float("gumbel_noise_factor", 0, 0.5)
|
python
|
def autoencoder_range(rhp):
"""Tuning grid of the main autoencoder params."""
rhp.set_float("dropout", 0.01, 0.3)
rhp.set_float("gan_loss_factor", 0.01, 0.1)
rhp.set_float("bottleneck_l2_factor", 0.001, 0.1, scale=rhp.LOG_SCALE)
rhp.set_discrete("bottleneck_warmup_steps", [200, 2000])
rhp.set_float("gumbel_temperature", 0, 1)
rhp.set_float("gumbel_noise_factor", 0, 0.5)
|
[
"def",
"autoencoder_range",
"(",
"rhp",
")",
":",
"rhp",
".",
"set_float",
"(",
"\"dropout\"",
",",
"0.01",
",",
"0.3",
")",
"rhp",
".",
"set_float",
"(",
"\"gan_loss_factor\"",
",",
"0.01",
",",
"0.1",
")",
"rhp",
".",
"set_float",
"(",
"\"bottleneck_l2_factor\"",
",",
"0.001",
",",
"0.1",
",",
"scale",
"=",
"rhp",
".",
"LOG_SCALE",
")",
"rhp",
".",
"set_discrete",
"(",
"\"bottleneck_warmup_steps\"",
",",
"[",
"200",
",",
"2000",
"]",
")",
"rhp",
".",
"set_float",
"(",
"\"gumbel_temperature\"",
",",
"0",
",",
"1",
")",
"rhp",
".",
"set_float",
"(",
"\"gumbel_noise_factor\"",
",",
"0",
",",
"0.5",
")"
] |
Tuning grid of the main autoencoder params.
|
[
"Tuning",
"grid",
"of",
"the",
"main",
"autoencoder",
"params",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/models/research/autoencoders.py#L1304-L1311
|
train
|
Tuning grid of the main autoencoder params.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4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SM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + chr(903 - 792) + chr(0b101 + 0o56) + '\064' + chr(48), 63160 - 63152), ehT0Px3KOsy9('\x30' + chr(111) + '\062' + chr(0b110001) + '\x31', 0b1000), ehT0Px3KOsy9(chr(0b100011 + 0o15) + chr(10297 - 10186) + chr(0b11011 + 0o26) + chr(48) + '\x33', 63319 - 63311), ehT0Px3KOsy9(chr(48) + '\157' + '\066' + chr(0b110111), 59276 - 59268), ehT0Px3KOsy9('\060' + chr(2560 - 2449) + '\x31' + chr(50) + '\x34', 0b1000), ehT0Px3KOsy9(chr(0b101 + 0o53) + chr(111) + chr(1872 - 1823) + chr(49) + '\x30', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b111111 + 0o60) + chr(1489 - 1439) + chr(53) + '\062', ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + chr(466 - 416) + chr(0b110101), 56154 - 56146), ehT0Px3KOsy9(chr(0b11100 + 0o24) + '\x6f' + '\064' + chr(1596 - 1544), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b101 + 0o152) + chr(0b101010 + 0o7) + chr(1951 - 1899) + chr(0b110001), ord("\x08")), ehT0Px3KOsy9(chr(0b110000 + 0o0) + '\157' + chr(645 - 595) + '\067' + chr(0b110101), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(2334 - 2281) + chr(1563 - 1514), 0b1000), ehT0Px3KOsy9(chr(2157 - 2109) + chr(0b1101111) + '\062' + '\062' + chr(55), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(1708 - 1657) + chr(0b10000 + 0o41) + '\x33', 0o10), ehT0Px3KOsy9(chr(291 - 243) + '\x6f' + chr(50) + chr(0b110000) + '\062', 0o10), ehT0Px3KOsy9(chr(1516 - 1468) + chr(0b0 + 0o157) + '\061' + '\x35' + chr(0b100011 + 0o20), 0o10), ehT0Px3KOsy9('\x30' + chr(0b10000 + 0o137) + chr(0b110111) + '\062', 0o10), ehT0Px3KOsy9(chr(0b11000 + 0o30) + '\x6f' + '\x32' + '\x32' + chr(2266 - 2218), 57215 - 57207), ehT0Px3KOsy9(chr(766 - 718) + chr(111) + '\x35' + chr(0b110001), 8), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\066' + chr(0b101001 + 0o11), ord("\x08")), ehT0Px3KOsy9(chr(1047 - 999) + chr(0b1001011 + 0o44) + chr(626 - 576) + '\061' + '\067', 0o10), ehT0Px3KOsy9('\060' + chr(0b1011011 + 0o24) + '\x37' + chr(1489 - 1440), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1010001 + 0o36) + chr(49) + chr(1068 - 1015) + '\062', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(2744 - 2633) + '\x33' + chr(512 - 463) + '\060', 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(51) + chr(50) + '\067', 0o10), ehT0Px3KOsy9('\060' + chr(753 - 642) + chr(49) + chr(399 - 351) + chr(2189 - 2135), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(746 - 693) + chr(50), ord("\x08")), ehT0Px3KOsy9(chr(450 - 402) + chr(0b110001 + 0o76) + chr(0b110010) + chr(0b11101 + 0o23) + '\061', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(644 - 593) + chr(0b110011) + chr(0b110010), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + '\062' + chr(0b11110 + 0o31) + chr(52), 0b1000), ehT0Px3KOsy9(chr(0b11 + 0o55) + chr(0b110111 + 0o70) + chr(1306 - 1257) + chr(0b1100 + 0o46), 0b1000), ehT0Px3KOsy9(chr(0b11111 + 0o21) + '\157' + '\x31' + chr(600 - 551), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110001) + '\062' + chr(53), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(50) + chr(0b10110 + 0o34) + chr(0b110101), 0b1000), ehT0Px3KOsy9(chr(943 - 895) + '\157' + chr(0b100110 + 0o15) + chr(2103 - 2054) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110101) + chr(0b11010 + 0o27), 8), ehT0Px3KOsy9(chr(48) + chr(7352 - 7241) + chr(0b1011 + 0o47) + chr(0b1000 + 0o56) + chr(0b110110), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(1110 - 1056) + chr(0b110001), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b1110 + 0o44) + chr(0b110011) + '\063', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110010) + chr(2044 - 1994) + '\x36', 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + chr(111) + '\065' + chr(48), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xce'), '\x64' + chr(0b1100101) + chr(0b110111 + 0o54) + chr(0b1101111) + '\x64' + chr(101))(chr(0b1110101) + chr(0b1100 + 0o150) + chr(102) + chr(968 - 923) + '\070') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def XGjOoQFWwjmu(IwsgmEzQknPc):
xafqLlk3kkUe(IwsgmEzQknPc, xafqLlk3kkUe(SXOLrMavuUCe(b'\x93\xec7h2$\xc5tP'), chr(0b1100100) + chr(0b1100101) + chr(0b10001 + 0o122) + '\x6f' + '\144' + '\145')('\x75' + chr(0b1110100) + chr(0b1000000 + 0o46) + '\055' + '\x38'))(xafqLlk3kkUe(SXOLrMavuUCe(b'\x84\xfb,G;=\xde'), chr(1599 - 1499) + '\145' + chr(0b1100011) + chr(0b1101111) + '\x64' + '\x65')('\x75' + chr(0b1110100) + chr(0b1100110) + chr(45) + '\x38'), 0.01, 0.3)
xafqLlk3kkUe(IwsgmEzQknPc, xafqLlk3kkUe(SXOLrMavuUCe(b'\x93\xec7h2$\xc5tP'), '\x64' + chr(0b1100101) + chr(2724 - 2625) + chr(0b110100 + 0o73) + chr(0b1100100) + chr(593 - 492))('\165' + '\164' + chr(0b1100110) + '\055' + chr(56)))(xafqLlk3kkUe(SXOLrMavuUCe(b"\x87\xe8-h8'\xd9f{\x07\xdcJ\xe3\xa4\xf0"), '\144' + chr(101) + '\143' + chr(111) + chr(100) + chr(101))(chr(0b11000 + 0o135) + chr(116) + chr(102) + chr(45) + chr(56)), 0.01, 0.1)
xafqLlk3kkUe(IwsgmEzQknPc, xafqLlk3kkUe(SXOLrMavuUCe(b'\x93\xec7h2$\xc5tP'), '\x64' + '\x65' + chr(2084 - 1985) + chr(0b1101111) + chr(100) + '\x65')('\165' + '\x74' + '\x66' + '\x2d' + chr(0b111 + 0o61)))(xafqLlk3kkUe(SXOLrMavuUCe(b'\x82\xe67C8-\xc4pG\n\xe2E\xa5\x94\xe4\nY\xe4F@'), '\x64' + chr(0b1011 + 0o132) + chr(0b1100011) + '\157' + chr(0b1100001 + 0o3) + chr(0b100 + 0o141))(chr(0b1110101) + chr(0b1010101 + 0o37) + chr(0b1010100 + 0o22) + chr(0b110 + 0o47) + chr(0b111000)), 0.001, 0.1, scale=xafqLlk3kkUe(IwsgmEzQknPc, xafqLlk3kkUe(SXOLrMavuUCe(b'\xac\xc6\x04h\x07\x0b\xebYa'), chr(0b1010010 + 0o22) + '\145' + chr(0b1100011) + chr(0b1101111) + chr(0b1100100) + '\145')(chr(0b1110101) + chr(0b1110100) + chr(0b1100110) + chr(0b1110 + 0o37) + chr(56))))
xafqLlk3kkUe(IwsgmEzQknPc, xafqLlk3kkUe(SXOLrMavuUCe(b'\x93\xec7h0!\xd9vV\x04\xc9L'), '\144' + chr(101) + chr(2579 - 2480) + chr(0b111110 + 0o61) + '\x64' + chr(0b1100101))(chr(117) + chr(0b1110100) + chr(9057 - 8955) + '\x2d' + '\x38'))(xafqLlk3kkUe(SXOLrMavuUCe(b'\x82\xe67C8-\xc4pG\n\xe2^\xf6\xb9\xef\x1eJ\xcfZF\xeaI\x19'), '\x64' + chr(101) + chr(4095 - 3996) + '\x6f' + chr(8674 - 8574) + chr(5656 - 5555))(chr(117) + chr(0b1110100) + chr(102) + '\x2d' + '\x38'), [ehT0Px3KOsy9(chr(0b110000) + chr(11142 - 11031) + chr(0b110011) + '\x31' + chr(48), 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b1100101 + 0o12) + chr(51) + chr(806 - 751) + chr(232 - 182) + chr(48), 0o10)])
xafqLlk3kkUe(IwsgmEzQknPc, xafqLlk3kkUe(SXOLrMavuUCe(b'\x93\xec7h2$\xc5tP'), chr(100) + chr(0b110100 + 0o61) + chr(99) + '\x6f' + chr(7802 - 7702) + chr(0b10110 + 0o117))('\x75' + chr(0b1110100) + chr(0b1100110) + chr(1903 - 1858) + chr(56)))(xafqLlk3kkUe(SXOLrMavuUCe(b'\x87\xfc.U1$\xf5aA\x0c\xcdL\xe5\xaa\xf6\x1eH\xf5'), chr(100) + chr(101) + chr(0b1001111 + 0o24) + chr(0b1011011 + 0o24) + chr(0b1000110 + 0o36) + chr(0b1100101))('\165' + chr(11790 - 11674) + '\146' + chr(1996 - 1951) + chr(0b11 + 0o65)), ehT0Px3KOsy9('\x30' + chr(0b1011010 + 0o25) + chr(0b111 + 0o51), 33610 - 33602), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110001), 0o10))
xafqLlk3kkUe(IwsgmEzQknPc, xafqLlk3kkUe(SXOLrMavuUCe(b'\x93\xec7h2$\xc5tP'), '\x64' + '\145' + chr(99) + '\x6f' + chr(0b111100 + 0o50) + chr(1770 - 1669))(chr(0b1110101) + '\164' + chr(102) + '\055' + chr(0b111000)))(xafqLlk3kkUe(SXOLrMavuUCe(b'\x87\xfc.U1$\xf5{K\x08\xceL\xc8\xad\xe3\x08N\xff['), '\x64' + chr(0b110100 + 0o61) + '\143' + chr(3038 - 2927) + chr(0b111011 + 0o51) + '\145')(chr(0b1101111 + 0o6) + chr(116) + '\146' + chr(0b101101) + chr(56)), ehT0Px3KOsy9('\x30' + chr(111) + '\060', 8), 0.5)
|
tensorflow/tensor2tensor
|
tensor2tensor/models/research/vqa_attention.py
|
image_encoder
|
def image_encoder(image_feat,
hparams,
name="image_encoder",
save_weights_to=None,
make_image_summary=True):
"""A stack of self attention layers."""
x = image_feat
with tf.variable_scope(name):
for layer in range(hparams.num_encoder_layers or hparams.num_hidden_layers):
with tf.variable_scope("layer_%d" % layer):
with tf.variable_scope("self_attention"):
y = vqa_layers.multihead_attention(
common_layers.layer_preprocess(x, hparams),
None,
None,
hparams.attention_key_channels or hparams.image_hidden_size,
hparams.attention_value_channels or hparams.image_hidden_size,
hparams.image_hidden_size,
hparams.num_heads,
hparams.attention_dropout,
attention_type=hparams.self_attention_type,
save_weights_to=save_weights_to,
max_relative_position=None,
make_image_summary=make_image_summary,
dropout_broadcast_dims=None,
max_length=None,
vars_3d=False,
scale_otproduct=hparams.scale_dotproduct)
utils.collect_named_outputs("norms", "image_feat_self_attention",
tf.norm(y, axis=-1))
x = common_layers.layer_postprocess(x, y, hparams)
utils.collect_named_outputs(
"norms", "image_feat_self_attention_zero_add",
tf.norm(x, axis=-1))
with tf.variable_scope("ffn"):
y = common_layers.dense_relu_dense(
common_layers.layer_preprocess(x, hparams),
hparams.image_filter_size,
hparams.image_hidden_size,
dropout=hparams.relu_dropout,
dropout_broadcast_dims=None)
utils.collect_named_outputs("norms", "image_feat_ffn",
tf.norm(y, axis=-1))
x = common_layers.layer_postprocess(x, y, hparams)
utils.collect_named_outputs("norms", "image_feat_ffn_zero_add",
tf.norm(x, axis=-1))
# if normalization is done in layer_preprocess, then it should also be done
# on the output, since the output can grow very large, being the sum of
# a whole stack of unnormalized layer outputs.
return common_layers.layer_preprocess(x, hparams)
|
python
|
def image_encoder(image_feat,
hparams,
name="image_encoder",
save_weights_to=None,
make_image_summary=True):
"""A stack of self attention layers."""
x = image_feat
with tf.variable_scope(name):
for layer in range(hparams.num_encoder_layers or hparams.num_hidden_layers):
with tf.variable_scope("layer_%d" % layer):
with tf.variable_scope("self_attention"):
y = vqa_layers.multihead_attention(
common_layers.layer_preprocess(x, hparams),
None,
None,
hparams.attention_key_channels or hparams.image_hidden_size,
hparams.attention_value_channels or hparams.image_hidden_size,
hparams.image_hidden_size,
hparams.num_heads,
hparams.attention_dropout,
attention_type=hparams.self_attention_type,
save_weights_to=save_weights_to,
max_relative_position=None,
make_image_summary=make_image_summary,
dropout_broadcast_dims=None,
max_length=None,
vars_3d=False,
scale_otproduct=hparams.scale_dotproduct)
utils.collect_named_outputs("norms", "image_feat_self_attention",
tf.norm(y, axis=-1))
x = common_layers.layer_postprocess(x, y, hparams)
utils.collect_named_outputs(
"norms", "image_feat_self_attention_zero_add",
tf.norm(x, axis=-1))
with tf.variable_scope("ffn"):
y = common_layers.dense_relu_dense(
common_layers.layer_preprocess(x, hparams),
hparams.image_filter_size,
hparams.image_hidden_size,
dropout=hparams.relu_dropout,
dropout_broadcast_dims=None)
utils.collect_named_outputs("norms", "image_feat_ffn",
tf.norm(y, axis=-1))
x = common_layers.layer_postprocess(x, y, hparams)
utils.collect_named_outputs("norms", "image_feat_ffn_zero_add",
tf.norm(x, axis=-1))
# if normalization is done in layer_preprocess, then it should also be done
# on the output, since the output can grow very large, being the sum of
# a whole stack of unnormalized layer outputs.
return common_layers.layer_preprocess(x, hparams)
|
[
"def",
"image_encoder",
"(",
"image_feat",
",",
"hparams",
",",
"name",
"=",
"\"image_encoder\"",
",",
"save_weights_to",
"=",
"None",
",",
"make_image_summary",
"=",
"True",
")",
":",
"x",
"=",
"image_feat",
"with",
"tf",
".",
"variable_scope",
"(",
"name",
")",
":",
"for",
"layer",
"in",
"range",
"(",
"hparams",
".",
"num_encoder_layers",
"or",
"hparams",
".",
"num_hidden_layers",
")",
":",
"with",
"tf",
".",
"variable_scope",
"(",
"\"layer_%d\"",
"%",
"layer",
")",
":",
"with",
"tf",
".",
"variable_scope",
"(",
"\"self_attention\"",
")",
":",
"y",
"=",
"vqa_layers",
".",
"multihead_attention",
"(",
"common_layers",
".",
"layer_preprocess",
"(",
"x",
",",
"hparams",
")",
",",
"None",
",",
"None",
",",
"hparams",
".",
"attention_key_channels",
"or",
"hparams",
".",
"image_hidden_size",
",",
"hparams",
".",
"attention_value_channels",
"or",
"hparams",
".",
"image_hidden_size",
",",
"hparams",
".",
"image_hidden_size",
",",
"hparams",
".",
"num_heads",
",",
"hparams",
".",
"attention_dropout",
",",
"attention_type",
"=",
"hparams",
".",
"self_attention_type",
",",
"save_weights_to",
"=",
"save_weights_to",
",",
"max_relative_position",
"=",
"None",
",",
"make_image_summary",
"=",
"make_image_summary",
",",
"dropout_broadcast_dims",
"=",
"None",
",",
"max_length",
"=",
"None",
",",
"vars_3d",
"=",
"False",
",",
"scale_otproduct",
"=",
"hparams",
".",
"scale_dotproduct",
")",
"utils",
".",
"collect_named_outputs",
"(",
"\"norms\"",
",",
"\"image_feat_self_attention\"",
",",
"tf",
".",
"norm",
"(",
"y",
",",
"axis",
"=",
"-",
"1",
")",
")",
"x",
"=",
"common_layers",
".",
"layer_postprocess",
"(",
"x",
",",
"y",
",",
"hparams",
")",
"utils",
".",
"collect_named_outputs",
"(",
"\"norms\"",
",",
"\"image_feat_self_attention_zero_add\"",
",",
"tf",
".",
"norm",
"(",
"x",
",",
"axis",
"=",
"-",
"1",
")",
")",
"with",
"tf",
".",
"variable_scope",
"(",
"\"ffn\"",
")",
":",
"y",
"=",
"common_layers",
".",
"dense_relu_dense",
"(",
"common_layers",
".",
"layer_preprocess",
"(",
"x",
",",
"hparams",
")",
",",
"hparams",
".",
"image_filter_size",
",",
"hparams",
".",
"image_hidden_size",
",",
"dropout",
"=",
"hparams",
".",
"relu_dropout",
",",
"dropout_broadcast_dims",
"=",
"None",
")",
"utils",
".",
"collect_named_outputs",
"(",
"\"norms\"",
",",
"\"image_feat_ffn\"",
",",
"tf",
".",
"norm",
"(",
"y",
",",
"axis",
"=",
"-",
"1",
")",
")",
"x",
"=",
"common_layers",
".",
"layer_postprocess",
"(",
"x",
",",
"y",
",",
"hparams",
")",
"utils",
".",
"collect_named_outputs",
"(",
"\"norms\"",
",",
"\"image_feat_ffn_zero_add\"",
",",
"tf",
".",
"norm",
"(",
"x",
",",
"axis",
"=",
"-",
"1",
")",
")",
"# if normalization is done in layer_preprocess, then it should also be done",
"# on the output, since the output can grow very large, being the sum of",
"# a whole stack of unnormalized layer outputs.",
"return",
"common_layers",
".",
"layer_preprocess",
"(",
"x",
",",
"hparams",
")"
] |
A stack of self attention layers.
|
[
"A",
"stack",
"of",
"self",
"attention",
"layers",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/models/research/vqa_attention.py#L182-L232
|
train
|
A stack of self - attention and fermipy - dense image encoder layers.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKK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ildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b11001 + 0o27) + '\x6f' + '\065' + chr(49), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x32' + '\062' + chr(1518 - 1463), 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(0b11101 + 0o25) + chr(49) + chr(1947 - 1894), 0o10), ehT0Px3KOsy9(chr(0b100111 + 0o11) + chr(5935 - 5824) + chr(2531 - 2480) + chr(0b10101 + 0o35) + chr(1964 - 1912), 0o10), ehT0Px3KOsy9(chr(0b1000 + 0o50) + '\x6f' + chr(51) + chr(0b110101) + chr(51), 9372 - 9364), ehT0Px3KOsy9(chr(0b10110 + 0o32) + '\157' + '\x33' + '\x32' + chr(0b110100), 8), ehT0Px3KOsy9(chr(0b1 + 0o57) + '\x6f' + chr(50) + '\x36' + chr(1797 - 1742), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(8556 - 8445) + chr(0b110001) + chr(0b110011) + chr(1290 - 1238), 0o10), ehT0Px3KOsy9(chr(0b1000 + 0o50) + '\x6f' + '\x31' + chr(53) + '\x36', 0o10), ehT0Px3KOsy9('\060' + chr(0b11110 + 0o121) + chr(0b110010) + chr(0b10100 + 0o37) + chr(0b101011 + 0o14), 0o10), ehT0Px3KOsy9('\x30' + chr(0b101101 + 0o102) + chr(0b110101) + chr(2417 - 2367), ord("\x08")), ehT0Px3KOsy9(chr(0b100011 + 0o15) + chr(0b1100000 + 0o17) + chr(0b110011) + chr(0b110010) + chr(2483 - 2429), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b10111 + 0o32) + chr(884 - 832) + chr(0b11000 + 0o31), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(0b110011) + chr(0b10100 + 0o43) + '\x30', 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110011) + '\062' + chr(0b10001 + 0o41), 25467 - 25459), ehT0Px3KOsy9('\060' + '\x6f' + '\062' + chr(361 - 313) + '\x31', 0b1000), ehT0Px3KOsy9('\x30' + chr(8369 - 8258) + chr(50) + '\060' + chr(1757 - 1703), 32610 - 32602), ehT0Px3KOsy9(chr(805 - 757) + chr(0b1101111) + '\062' + chr(624 - 571) + chr(0b1010 + 0o52), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110011) + chr(51) + chr(0b1110 + 0o43), 19550 - 19542), ehT0Px3KOsy9(chr(48) + '\157' + chr(1877 - 1826) + chr(1095 - 1045) + chr(0b110000), 0b1000), ehT0Px3KOsy9(chr(0b100011 + 0o15) + '\157' + chr(0b110001) + chr(52) + chr(54), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1100000 + 0o17) + '\061' + chr(51) + chr(0b110100), 8), ehT0Px3KOsy9(chr(48) + chr(111) + '\x33' + chr(0b110011) + chr(49), 8), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110010) + chr(0b10001 + 0o43), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1100010 + 0o15) + chr(0b1101 + 0o45) + chr(0b101010 + 0o11) + '\x30', 0o10), ehT0Px3KOsy9(chr(1975 - 1927) + chr(111) + chr(55) + '\062', 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b11000 + 0o31) + chr(2059 - 2006) + chr(51), 0o10), ehT0Px3KOsy9(chr(0b10110 + 0o32) + '\x6f' + chr(50) + chr(0b110110) + chr(1913 - 1862), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b111010 + 0o65) + '\x32' + chr(0b1111 + 0o50) + '\063', ord("\x08")), ehT0Px3KOsy9(chr(924 - 876) + chr(0b10010 + 0o135) + chr(0b11001 + 0o32) + chr(1059 - 1011) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(11926 - 11815) + chr(0b100001 + 0o25) + '\x36', 0b1000), ehT0Px3KOsy9(chr(0b101001 + 0o7) + '\x6f' + '\063' + chr(2659 - 2604) + chr(0b101100 + 0o5), 0b1000), ehT0Px3KOsy9(chr(0b100010 + 0o16) + chr(111) + chr(0b10010 + 0o40) + chr(144 - 95) + chr(0b110100), 0b1000), ehT0Px3KOsy9('\x30' + chr(9734 - 9623) + chr(0b1000 + 0o51) + '\066' + '\x37', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\062' + '\x31' + chr(2061 - 2010), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110001) + chr(0b110010) + chr(0b110000 + 0o1), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x32' + '\x30' + chr(0b11000 + 0o37), 0o10), ehT0Px3KOsy9(chr(1673 - 1625) + chr(111) + chr(0b10 + 0o61) + chr(1160 - 1112) + '\060', 0b1000), ehT0Px3KOsy9('\060' + chr(194 - 83) + '\067' + chr(55), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + '\062' + chr(0b110010) + '\066', 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + chr(111) + chr(1773 - 1720) + chr(1411 - 1363), 9861 - 9853)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x07'), chr(0b1100010 + 0o2) + '\145' + '\x63' + '\x6f' + chr(0b1100100) + '\145')(chr(117) + '\164' + '\146' + '\x2d' + chr(200 - 144)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def BXbuAGLms8Uz(UKiMPArCVK05, n4ljua2gi1Pr, AIvJRzLdDfgF=xafqLlk3kkUe(SXOLrMavuUCe(b'@\xfa\xec\xb3\x8e\x8b\xd22\r\xf0N\xb3\x13'), chr(4271 - 4171) + chr(0b1100011 + 0o2) + '\x63' + chr(0b1011100 + 0o23) + '\144' + chr(101))('\165' + chr(116) + '\x66' + chr(380 - 335) + chr(0b111000)), zWaF_2VBEDjk=None, NC2xHNLwzxcH=ehT0Px3KOsy9('\x30' + chr(11142 - 11031) + chr(0b110001), 0b1000)):
OeWW0F1dBPRQ = UKiMPArCVK05
with xafqLlk3kkUe(IDJ2eXGCBCDu, xafqLlk3kkUe(SXOLrMavuUCe(b'_\xf6\xff\xbd\x8a\xb6\xdb91\xecI\xb9\x11\x9d'), '\144' + chr(0b1100101) + chr(0b10011 + 0o120) + '\157' + chr(100) + chr(0b0 + 0o145))(chr(0b1110101) + '\x74' + '\146' + chr(253 - 208) + chr(0b101101 + 0o13)))(AIvJRzLdDfgF):
for wgamNHppspXj in vQr8gNKaIaWE(xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'{\xc4\xbb\x8d\x80\x95\xe53:\xf3O\x98'), '\144' + chr(0b1100101) + '\143' + chr(0b100111 + 0o110) + chr(6384 - 6284) + chr(0b10001 + 0o124))(chr(0b1101010 + 0o13) + chr(0b1110100) + chr(7632 - 7530) + '\055' + '\x38')) or xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'C\xcd\xe5\xe1\xb4\xa4\xfb\t\x01\xd0E\x8c'), '\144' + chr(0b1011000 + 0o15) + chr(0b101110 + 0o65) + '\157' + '\144' + chr(9332 - 9231))(chr(0b1110101) + '\x74' + chr(0b1100110) + '\055' + chr(1148 - 1092)))):
with xafqLlk3kkUe(IDJ2eXGCBCDu, xafqLlk3kkUe(SXOLrMavuUCe(b'_\xf6\xff\xbd\x8a\xb6\xdb91\xecI\xb9\x11\x9d'), chr(100) + chr(0b1001 + 0o134) + chr(0b1100011) + '\157' + chr(0b1100100) + '\145')(chr(117) + chr(6576 - 6460) + '\146' + '\055' + '\x38'))(xafqLlk3kkUe(SXOLrMavuUCe(b'E\xf6\xf4\xb1\x99\x8b\x928'), chr(0b1100100) + chr(0b1100101) + chr(707 - 608) + chr(0b1101111) + chr(100) + '\145')(chr(0b1100111 + 0o16) + chr(4175 - 4059) + chr(102) + chr(0b11 + 0o52) + chr(0b110010 + 0o6)) % wgamNHppspXj):
with xafqLlk3kkUe(IDJ2eXGCBCDu, xafqLlk3kkUe(SXOLrMavuUCe(b'_\xf6\xff\xbd\x8a\xb6\xdb91\xecI\xb9\x11\x9d'), chr(0b1100100) + chr(0b11111 + 0o106) + '\143' + '\157' + chr(0b1100100) + '\x65')('\165' + chr(0b1110100) + chr(102) + chr(0b1000 + 0o45) + chr(56)))(xafqLlk3kkUe(SXOLrMavuUCe(b'Z\xf2\xe1\xb2\xb4\xb5\xc3(\x0b\xf1^\xbf\x0e\x96'), chr(0b1100000 + 0o4) + chr(391 - 290) + '\x63' + chr(0b1101111) + chr(0b1100100) + chr(0b10111 + 0o116))('\165' + chr(943 - 827) + chr(0b1010 + 0o134) + '\055' + chr(0b11110 + 0o32))):
SqiSOtYOqOJH = HD_xNZzVlWnR.multihead_attention(jSKPaHwSAfVv.layer_preprocess(OeWW0F1dBPRQ, n4ljua2gi1Pr), None, None, n4ljua2gi1Pr.Hj_JCZasfmqG or n4ljua2gi1Pr.image_hidden_size, n4ljua2gi1Pr.PZHUuenu09ti or n4ljua2gi1Pr.image_hidden_size, n4ljua2gi1Pr.image_hidden_size, n4ljua2gi1Pr.vRVqPOZ1hUG7, n4ljua2gi1Pr.RdMRr3qkYioQ, attention_type=n4ljua2gi1Pr.tbgb2B3hnGPW, save_weights_to=zWaF_2VBEDjk, max_relative_position=None, make_image_summary=NC2xHNLwzxcH, dropout_broadcast_dims=None, max_length=None, vars_3d=ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(2213 - 2165), ord("\x08")), scale_otproduct=n4ljua2gi1Pr.scale_dotproduct)
xafqLlk3kkUe(bdVxKm4tezOp, xafqLlk3kkUe(SXOLrMavuUCe(b'J\xf8\xe1\xb8\x8e\xb7\xc3\x03\x00\xfeG\xb3\x05\xa7\xbd\xf4\xf2\xdc\xac\xa4\x15'), chr(0b1100100) + '\x65' + chr(1138 - 1039) + chr(111) + chr(2750 - 2650) + '\145')(chr(0b1110101) + chr(0b1110100) + chr(7185 - 7083) + chr(147 - 102) + chr(287 - 231)))(xafqLlk3kkUe(SXOLrMavuUCe(b'G\xf8\xff\xb9\x98'), '\144' + chr(0b1100101) + '\143' + chr(554 - 443) + '\144' + '\x65')(chr(0b1110101) + chr(8293 - 8177) + '\x66' + '\x2d' + chr(0b10101 + 0o43)), xafqLlk3kkUe(SXOLrMavuUCe(b'@\xfa\xec\xb3\x8e\x8b\xd19\x0f\xebu\xa5\x04\x94\xb4\xde\xe7\xd8\xad\xb5\x08(\xb0{\xf6'), chr(0b10 + 0o142) + '\x65' + chr(0b1100011) + chr(0b1001001 + 0o46) + '\144' + chr(101))('\165' + chr(0b1110100) + chr(0b1100110) + '\x2d' + '\x38'), xafqLlk3kkUe(IDJ2eXGCBCDu, xafqLlk3kkUe(SXOLrMavuUCe(b'L\xc3\xc2\xa3\xa4\x8c\xc5?\x05\xceD\xa5'), chr(0b1100100) + chr(0b100100 + 0o101) + chr(0b1100011) + '\x6f' + chr(0b10011 + 0o121) + chr(0b100011 + 0o102))('\x75' + chr(0b100111 + 0o115) + chr(7935 - 7833) + chr(998 - 953) + chr(0b11101 + 0o33)))(SqiSOtYOqOJH, axis=-ehT0Px3KOsy9(chr(0b110000) + chr(10717 - 10606) + '\x31', 8)))
OeWW0F1dBPRQ = jSKPaHwSAfVv.layer_postprocess(OeWW0F1dBPRQ, SqiSOtYOqOJH, n4ljua2gi1Pr)
xafqLlk3kkUe(bdVxKm4tezOp, xafqLlk3kkUe(SXOLrMavuUCe(b'J\xf8\xe1\xb8\x8e\xb7\xc3\x03\x00\xfeG\xb3\x05\xa7\xbd\xf4\xf2\xdc\xac\xa4\x15'), chr(0b1000111 + 0o35) + '\145' + chr(0b1100011) + chr(0b1001011 + 0o44) + chr(100) + chr(101))('\165' + '\164' + '\x66' + chr(0b101101) + chr(0b101 + 0o63)))(xafqLlk3kkUe(SXOLrMavuUCe(b'G\xf8\xff\xb9\x98'), chr(7717 - 7617) + '\145' + '\x63' + '\157' + '\x64' + '\145')('\165' + chr(0b11101 + 0o127) + chr(102) + '\x2d' + chr(2075 - 2019)), xafqLlk3kkUe(SXOLrMavuUCe(b'@\xfa\xec\xb3\x8e\x8b\xd19\x0f\xebu\xa5\x04\x94\xb4\xde\xe7\xd8\xad\xb5\x08(\xb0{\xf6e\x11\xd6\xc9\xadi\x98\xe8\x13'), '\x64' + chr(0b1100101) + chr(3254 - 3155) + chr(0b1101111) + chr(100) + '\145')(chr(0b1110101) + chr(116) + '\x66' + chr(0b1100 + 0o41) + '\x38'), xafqLlk3kkUe(IDJ2eXGCBCDu, xafqLlk3kkUe(SXOLrMavuUCe(b'L\xc3\xc2\xa3\xa4\x8c\xc5?\x05\xceD\xa5'), chr(100) + chr(101) + chr(99) + '\x6f' + chr(8456 - 8356) + chr(4291 - 4190))(chr(0b1110101) + chr(116) + '\x66' + chr(45) + '\070'))(OeWW0F1dBPRQ, axis=-ehT0Px3KOsy9('\060' + chr(0b1010101 + 0o32) + '\x31', 8)))
with xafqLlk3kkUe(IDJ2eXGCBCDu, xafqLlk3kkUe(SXOLrMavuUCe(b'_\xf6\xff\xbd\x8a\xb6\xdb91\xecI\xb9\x11\x9d'), '\x64' + chr(0b101110 + 0o67) + chr(99) + '\157' + chr(0b110010 + 0o62) + chr(101))(chr(0b1001001 + 0o54) + chr(0b1110100 + 0o0) + chr(0b10100 + 0o122) + chr(0b0 + 0o55) + '\070'))(xafqLlk3kkUe(SXOLrMavuUCe(b'O\xf1\xe3'), chr(0b1100100) + chr(101) + '\143' + chr(111) + chr(100) + '\145')(chr(117) + chr(1042 - 926) + '\x66' + '\x2d' + chr(0b1010 + 0o56))):
SqiSOtYOqOJH = jSKPaHwSAfVv.dense_relu_dense(jSKPaHwSAfVv.layer_preprocess(OeWW0F1dBPRQ, n4ljua2gi1Pr), n4ljua2gi1Pr.image_filter_size, n4ljua2gi1Pr.image_hidden_size, dropout=n4ljua2gi1Pr.PJc0PNdBnSag, dropout_broadcast_dims=None)
xafqLlk3kkUe(bdVxKm4tezOp, xafqLlk3kkUe(SXOLrMavuUCe(b'J\xf8\xe1\xb8\x8e\xb7\xc3\x03\x00\xfeG\xb3\x05\xa7\xbd\xf4\xf2\xdc\xac\xa4\x15'), chr(0b1001110 + 0o26) + chr(0b1100101) + '\x63' + chr(111) + chr(0b101 + 0o137) + chr(101))(chr(11759 - 11642) + chr(12336 - 12220) + '\146' + chr(0b101010 + 0o3) + '\x38'))(xafqLlk3kkUe(SXOLrMavuUCe(b'G\xf8\xff\xb9\x98'), chr(9612 - 9512) + '\x65' + chr(9035 - 8936) + chr(0b1101111) + '\x64' + '\x65')('\165' + chr(0b1010000 + 0o44) + chr(7692 - 7590) + '\055' + chr(56)), xafqLlk3kkUe(SXOLrMavuUCe(b'@\xfa\xec\xb3\x8e\x8b\xd19\x0f\xebu\xb0\x07\x96'), chr(0b1100100) + '\145' + chr(99) + '\157' + chr(8797 - 8697) + chr(0b1100 + 0o131))(chr(13530 - 13413) + chr(3968 - 3852) + '\146' + '\x2d' + '\070'), xafqLlk3kkUe(IDJ2eXGCBCDu, xafqLlk3kkUe(SXOLrMavuUCe(b'L\xc3\xc2\xa3\xa4\x8c\xc5?\x05\xceD\xa5'), chr(0b1100100) + chr(0b1100101) + chr(0b1100011) + chr(0b11011 + 0o124) + chr(5263 - 5163) + chr(3260 - 3159))('\165' + chr(0b1001110 + 0o46) + chr(102) + chr(45) + chr(0b10100 + 0o44)))(SqiSOtYOqOJH, axis=-ehT0Px3KOsy9(chr(48) + chr(111) + chr(49), 8)))
OeWW0F1dBPRQ = jSKPaHwSAfVv.layer_postprocess(OeWW0F1dBPRQ, SqiSOtYOqOJH, n4ljua2gi1Pr)
xafqLlk3kkUe(bdVxKm4tezOp, xafqLlk3kkUe(SXOLrMavuUCe(b'J\xf8\xe1\xb8\x8e\xb7\xc3\x03\x00\xfeG\xb3\x05\xa7\xbd\xf4\xf2\xdc\xac\xa4\x15'), chr(0b1011000 + 0o14) + '\145' + chr(99) + chr(0b10101 + 0o132) + chr(100) + '\x65')('\x75' + chr(0b110111 + 0o75) + '\x66' + '\055' + '\x38'))(xafqLlk3kkUe(SXOLrMavuUCe(b'G\xf8\xff\xb9\x98'), chr(3225 - 3125) + chr(0b1001010 + 0o33) + chr(0b11010 + 0o111) + chr(111) + chr(4372 - 4272) + chr(101))(chr(0b1110101) + '\x74' + '\x66' + chr(0b100000 + 0o15) + chr(0b11100 + 0o34)), xafqLlk3kkUe(SXOLrMavuUCe(b'@\xfa\xec\xb3\x8e\x8b\xd19\x0f\xebu\xb0\x07\x96\x8d\xfb\xe3\xde\xb6\x8f\x078\xbd'), chr(0b111100 + 0o50) + '\145' + chr(6111 - 6012) + chr(1191 - 1080) + chr(0b101 + 0o137) + '\x65')('\x75' + chr(12080 - 11964) + '\x66' + '\x2d' + chr(56)), xafqLlk3kkUe(IDJ2eXGCBCDu, xafqLlk3kkUe(SXOLrMavuUCe(b'L\xc3\xc2\xa3\xa4\x8c\xc5?\x05\xceD\xa5'), chr(100) + '\145' + '\143' + chr(0b111110 + 0o61) + chr(0b1100100) + chr(0b100010 + 0o103))(chr(11294 - 11177) + chr(0b1110100) + chr(3254 - 3152) + '\x2d' + '\070'))(OeWW0F1dBPRQ, axis=-ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110001), 8)))
return xafqLlk3kkUe(jSKPaHwSAfVv, xafqLlk3kkUe(SXOLrMavuUCe(b'E\xf6\xf4\xb1\x99\x8b\xc7.\x0b\xefX\xb9\x02\x9d\xa1\xf2'), chr(4633 - 4533) + chr(1704 - 1603) + '\143' + '\157' + '\144' + chr(0b1001100 + 0o31))(chr(0b1110101) + '\164' + '\x66' + chr(0b101101) + chr(56)))(OeWW0F1dBPRQ, n4ljua2gi1Pr)
|
tensorflow/tensor2tensor
|
tensor2tensor/models/research/vqa_attention.py
|
question_encoder
|
def question_encoder(question, hparams, name="encoder"):
"""Question encoder, run LSTM encoder and get the last output as encoding."""
with tf.variable_scope(name, "encoder", values=[question]):
question = common_layers.flatten4d3d(question)
padding = common_attention.embedding_to_padding(question)
length = common_attention.padding_to_length(padding)
max_question_length = hparams.max_question_length
question = question[:, :max_question_length, :]
actual_question_length = common_layers.shape_list(question)[1]
length = tf.minimum(length, max_question_length)
padding = [[0, 0],
[0, max_question_length-actual_question_length],
[0, 0]]
question = tf.pad(question, padding)
question_shape = question.get_shape().as_list()
question_shape[1] = max_question_length
question.set_shape(question_shape)
# apply tanh dropout on question embedding
question = tf.tanh(question)
question = tf.nn.dropout(question, keep_prob=1.-hparams.dropout)
question = [question[:, i, :] for i in range(max_question_length)]
# rnn_layers = [_get_rnn_cell(hparams)
# for _ in range(hparams.num_rnn_layers)]
# rnn_multi_cell = tf.nn.rnn_cell.MultiRNNCell(rnn_layers)
rnn_cell = _get_rnn_cell(hparams)
# outputs, _ = tf.nn.dynamic_rnn(
# rnn_cell, question, length, dtype=tf.float32)
_, state = tf.nn.static_rnn(rnn_cell, question, sequence_length=length,
dtype=tf.float32)
# outputs = [tf.expand_dims(output, axis=1) for output in outputs]
# outputs = tf.concat(outputs, axis=1)
# utils.collect_named_outputs("vqa_attention_debug", "question_output",
# outputs)
# utils.collect_named_outputs("vqa_attention_debug", "question_state",
# state.h)
# batch_size = common_layers.shape_list(outputs)[0]
# row_indices = tf.range(batch_size)
# # length - 1 as index
# indices = tf.transpose([row_indices, tf.maximum(length-1, 0)])
# last_output = tf.gather_nd(outputs, indices)
# utils.collect_named_outputs("vqa_attention_debug",
# "question_final_output", last_output)
return state.h
|
python
|
def question_encoder(question, hparams, name="encoder"):
"""Question encoder, run LSTM encoder and get the last output as encoding."""
with tf.variable_scope(name, "encoder", values=[question]):
question = common_layers.flatten4d3d(question)
padding = common_attention.embedding_to_padding(question)
length = common_attention.padding_to_length(padding)
max_question_length = hparams.max_question_length
question = question[:, :max_question_length, :]
actual_question_length = common_layers.shape_list(question)[1]
length = tf.minimum(length, max_question_length)
padding = [[0, 0],
[0, max_question_length-actual_question_length],
[0, 0]]
question = tf.pad(question, padding)
question_shape = question.get_shape().as_list()
question_shape[1] = max_question_length
question.set_shape(question_shape)
# apply tanh dropout on question embedding
question = tf.tanh(question)
question = tf.nn.dropout(question, keep_prob=1.-hparams.dropout)
question = [question[:, i, :] for i in range(max_question_length)]
# rnn_layers = [_get_rnn_cell(hparams)
# for _ in range(hparams.num_rnn_layers)]
# rnn_multi_cell = tf.nn.rnn_cell.MultiRNNCell(rnn_layers)
rnn_cell = _get_rnn_cell(hparams)
# outputs, _ = tf.nn.dynamic_rnn(
# rnn_cell, question, length, dtype=tf.float32)
_, state = tf.nn.static_rnn(rnn_cell, question, sequence_length=length,
dtype=tf.float32)
# outputs = [tf.expand_dims(output, axis=1) for output in outputs]
# outputs = tf.concat(outputs, axis=1)
# utils.collect_named_outputs("vqa_attention_debug", "question_output",
# outputs)
# utils.collect_named_outputs("vqa_attention_debug", "question_state",
# state.h)
# batch_size = common_layers.shape_list(outputs)[0]
# row_indices = tf.range(batch_size)
# # length - 1 as index
# indices = tf.transpose([row_indices, tf.maximum(length-1, 0)])
# last_output = tf.gather_nd(outputs, indices)
# utils.collect_named_outputs("vqa_attention_debug",
# "question_final_output", last_output)
return state.h
|
[
"def",
"question_encoder",
"(",
"question",
",",
"hparams",
",",
"name",
"=",
"\"encoder\"",
")",
":",
"with",
"tf",
".",
"variable_scope",
"(",
"name",
",",
"\"encoder\"",
",",
"values",
"=",
"[",
"question",
"]",
")",
":",
"question",
"=",
"common_layers",
".",
"flatten4d3d",
"(",
"question",
")",
"padding",
"=",
"common_attention",
".",
"embedding_to_padding",
"(",
"question",
")",
"length",
"=",
"common_attention",
".",
"padding_to_length",
"(",
"padding",
")",
"max_question_length",
"=",
"hparams",
".",
"max_question_length",
"question",
"=",
"question",
"[",
":",
",",
":",
"max_question_length",
",",
":",
"]",
"actual_question_length",
"=",
"common_layers",
".",
"shape_list",
"(",
"question",
")",
"[",
"1",
"]",
"length",
"=",
"tf",
".",
"minimum",
"(",
"length",
",",
"max_question_length",
")",
"padding",
"=",
"[",
"[",
"0",
",",
"0",
"]",
",",
"[",
"0",
",",
"max_question_length",
"-",
"actual_question_length",
"]",
",",
"[",
"0",
",",
"0",
"]",
"]",
"question",
"=",
"tf",
".",
"pad",
"(",
"question",
",",
"padding",
")",
"question_shape",
"=",
"question",
".",
"get_shape",
"(",
")",
".",
"as_list",
"(",
")",
"question_shape",
"[",
"1",
"]",
"=",
"max_question_length",
"question",
".",
"set_shape",
"(",
"question_shape",
")",
"# apply tanh dropout on question embedding",
"question",
"=",
"tf",
".",
"tanh",
"(",
"question",
")",
"question",
"=",
"tf",
".",
"nn",
".",
"dropout",
"(",
"question",
",",
"keep_prob",
"=",
"1.",
"-",
"hparams",
".",
"dropout",
")",
"question",
"=",
"[",
"question",
"[",
":",
",",
"i",
",",
":",
"]",
"for",
"i",
"in",
"range",
"(",
"max_question_length",
")",
"]",
"# rnn_layers = [_get_rnn_cell(hparams)",
"# for _ in range(hparams.num_rnn_layers)]",
"# rnn_multi_cell = tf.nn.rnn_cell.MultiRNNCell(rnn_layers)",
"rnn_cell",
"=",
"_get_rnn_cell",
"(",
"hparams",
")",
"# outputs, _ = tf.nn.dynamic_rnn(",
"# rnn_cell, question, length, dtype=tf.float32)",
"_",
",",
"state",
"=",
"tf",
".",
"nn",
".",
"static_rnn",
"(",
"rnn_cell",
",",
"question",
",",
"sequence_length",
"=",
"length",
",",
"dtype",
"=",
"tf",
".",
"float32",
")",
"# outputs = [tf.expand_dims(output, axis=1) for output in outputs]",
"# outputs = tf.concat(outputs, axis=1)",
"# utils.collect_named_outputs(\"vqa_attention_debug\", \"question_output\",",
"# outputs)",
"# utils.collect_named_outputs(\"vqa_attention_debug\", \"question_state\",",
"# state.h)",
"# batch_size = common_layers.shape_list(outputs)[0]",
"# row_indices = tf.range(batch_size)",
"# # length - 1 as index",
"# indices = tf.transpose([row_indices, tf.maximum(length-1, 0)])",
"# last_output = tf.gather_nd(outputs, indices)",
"# utils.collect_named_outputs(\"vqa_attention_debug\",",
"# \"question_final_output\", last_output)",
"return",
"state",
".",
"h"
] |
Question encoder, run LSTM encoder and get the last output as encoding.
|
[
"Question",
"encoder",
"run",
"LSTM",
"encoder",
"and",
"get",
"the",
"last",
"output",
"as",
"encoding",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/t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3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b100100 + 0o17) + '\x33' + '\065', ord("\x08")), ehT0Px3KOsy9(chr(0b11010 + 0o26) + chr(111) + '\063' + '\061' + chr(728 - 680), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b101011 + 0o10) + chr(0b110100 + 0o3), 0o10), ehT0Px3KOsy9(chr(0b100101 + 0o13) + '\x6f' + '\x32' + '\066' + '\060', 61851 - 61843), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(50) + '\067' + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(0b100101 + 0o13) + chr(5548 - 5437) + chr(0b110100) + '\x36', 0o10), ehT0Px3KOsy9(chr(48) + chr(2577 - 2466) + chr(0b110011) + chr(0b0 + 0o65) + chr(1480 - 1429), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(1167 - 1117) + chr(733 - 683) + chr(0b110011), 0b1000), ehT0Px3KOsy9(chr(0b10000 + 0o40) + chr(2236 - 2125) + '\063' + '\066' + chr(0b1100 + 0o53), 48147 - 48139), ehT0Px3KOsy9('\x30' + chr(6150 - 6039) + '\067' + '\x34', 0o10), ehT0Px3KOsy9(chr(1873 - 1825) + chr(111) + chr(0b110001) + '\x36' + '\062', 0o10), ehT0Px3KOsy9(chr(0b11010 + 0o26) + chr(6829 - 6718) + '\x31' + chr(0b110011) + '\063', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x31' + chr(741 - 687) + chr(2500 - 2448), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1010111 + 0o30) + chr(0b110011) + chr(1030 - 979) + chr(1313 - 1263), 54359 - 54351), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(82 - 32) + chr(2105 - 2057) + chr(0b100010 + 0o25), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110001) + chr(49) + chr(0b100111 + 0o15), 13224 - 13216), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\061' + '\x31' + chr(1562 - 1512), 16615 - 16607), ehT0Px3KOsy9(chr(2001 - 1953) + chr(0b1101111) + '\x32' + chr(0b110100) + '\063', 0o10), ehT0Px3KOsy9('\060' + chr(0b1101001 + 0o6) + '\x33' + chr(0b1000 + 0o55) + chr(1992 - 1943), 63441 - 63433), ehT0Px3KOsy9(chr(48) + chr(6812 - 6701) + chr(0b110111), 12437 - 12429), ehT0Px3KOsy9('\x30' + '\x6f' + '\063' + chr(49) + chr(1223 - 1168), 56675 - 56667), ehT0Px3KOsy9('\x30' + chr(111) + chr(432 - 381) + chr(1068 - 1015) + chr(51), 8), ehT0Px3KOsy9(chr(48) + chr(0b11111 + 0o120) + chr(49) + '\060' + chr(49), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(51) + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(0b1101 + 0o43) + chr(0b10011 + 0o134) + chr(0b110001 + 0o1) + chr(0b101011 + 0o13) + chr(0b110011), 63574 - 63566), ehT0Px3KOsy9(chr(440 - 392) + '\157' + chr(658 - 608) + chr(238 - 185) + chr(1238 - 1183), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1011010 + 0o25) + chr(0b110001) + chr(83 - 30) + '\x37', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1100100 + 0o13) + chr(0b101000 + 0o15) + chr(915 - 862), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(55) + chr(2110 - 2061), 0b1000), ehT0Px3KOsy9('\x30' + chr(6269 - 6158) + chr(0b1101 + 0o46) + chr(930 - 875) + chr(82 - 33), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + '\x33' + chr(55) + chr(0b110010), 60912 - 60904), ehT0Px3KOsy9('\060' + '\x6f' + chr(49) + '\x37' + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(0b0 + 0o60) + '\x6f' + '\x31' + chr(2203 - 2154) + chr(0b110100), 8), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b100 + 0o55) + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(135 - 86) + '\x31' + '\x35', 33426 - 33418), ehT0Px3KOsy9(chr(48) + chr(10326 - 10215) + chr(53) + chr(51), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1100001 + 0o16) + chr(50) + '\x32' + chr(55), 63382 - 63374), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b1000 + 0o51) + chr(50) + chr(51), 0o10), ehT0Px3KOsy9(chr(0b0 + 0o60) + chr(111) + chr(0b101010 + 0o10) + chr(2212 - 2160) + chr(0b110010), 15777 - 15769), ehT0Px3KOsy9(chr(0b10010 + 0o36) + '\157' + chr(0b11110 + 0o26) + chr(2094 - 2040), 8)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(865 - 817) + chr(0b1101111) + chr(0b110101) + '\060', 30349 - 30341)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xf3'), chr(0b110110 + 0o56) + chr(1035 - 934) + chr(99) + chr(0b1010100 + 0o33) + '\x64' + chr(1786 - 1685))('\165' + '\x74' + chr(0b110001 + 0o65) + '\x2d' + chr(0b111000)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def bI2fyTM52NTU(hiLkQHDHvP4B, n4ljua2gi1Pr, AIvJRzLdDfgF=xafqLlk3kkUe(SXOLrMavuUCe(b'\xb8\xa6|\xdf\xdbC\x99'), '\x64' + '\x65' + '\x63' + '\x6f' + '\x64' + chr(0b10011 + 0o122))(chr(117) + chr(116) + chr(102) + '\x2d' + chr(0b11000 + 0o40))):
with xafqLlk3kkUe(IDJ2eXGCBCDu, xafqLlk3kkUe(SXOLrMavuUCe(b'\xab\xa9m\xd9\xdeD\x87\xf6\xa8O\x114\x04\xbf'), chr(7518 - 7418) + chr(101) + chr(0b1011001 + 0o12) + '\157' + '\x64' + chr(0b110011 + 0o62))(chr(0b1110101) + chr(0b1110100) + '\x66' + chr(0b100110 + 0o7) + '\070'))(AIvJRzLdDfgF, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb8\xa6|\xdf\xdbC\x99'), chr(8232 - 8132) + chr(0b1100101) + chr(0b1001100 + 0o27) + chr(0b1101111) + '\144' + chr(7034 - 6933))(chr(0b1101111 + 0o6) + '\x74' + chr(0b110 + 0o140) + chr(0b101101) + '\x38'), values=[hiLkQHDHvP4B]):
hiLkQHDHvP4B = jSKPaHwSAfVv.flatten4d3d(hiLkQHDHvP4B)
TFLseEYASEKG = WOnrfm4dlYcf.embedding_to_padding(hiLkQHDHvP4B)
CHAOgk5VCHH_ = WOnrfm4dlYcf.padding_to_length(TFLseEYASEKG)
UooxTiYy6tiO = n4ljua2gi1Pr.max_question_length
hiLkQHDHvP4B = hiLkQHDHvP4B[:, :UooxTiYy6tiO, :]
hrQ7ECtOQugz = jSKPaHwSAfVv.shape_list(hiLkQHDHvP4B)[ehT0Px3KOsy9(chr(689 - 641) + chr(0b1100101 + 0o12) + chr(0b110001), ord("\x08"))]
CHAOgk5VCHH_ = IDJ2eXGCBCDu.minimum(CHAOgk5VCHH_, UooxTiYy6tiO)
TFLseEYASEKG = [[ehT0Px3KOsy9(chr(0b100 + 0o54) + chr(0b1101111) + '\x30', 0b1000), ehT0Px3KOsy9('\060' + '\157' + '\x30', 8)], [ehT0Px3KOsy9(chr(2221 - 2173) + '\x6f' + chr(0b110000), 8), UooxTiYy6tiO - hrQ7ECtOQugz], [ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b100010 + 0o16), 8), ehT0Px3KOsy9(chr(0b1111 + 0o41) + chr(0b1101111) + chr(115 - 67), 8)]]
hiLkQHDHvP4B = IDJ2eXGCBCDu.pad(hiLkQHDHvP4B, TFLseEYASEKG)
h_Gv5_GTGRgD = hiLkQHDHvP4B.get_shape().as_list()
h_Gv5_GTGRgD[ehT0Px3KOsy9('\x30' + chr(7258 - 7147) + '\x31', 8)] = UooxTiYy6tiO
xafqLlk3kkUe(hiLkQHDHvP4B, xafqLlk3kkUe(SXOLrMavuUCe(b'\xae\xadk\xef\xccN\x8a\xe3\x92'), chr(100) + chr(4432 - 4331) + '\143' + '\x6f' + chr(100) + chr(101))('\x75' + chr(116) + chr(0b0 + 0o146) + chr(1824 - 1779) + chr(56)))(h_Gv5_GTGRgD)
hiLkQHDHvP4B = IDJ2eXGCBCDu.tanh(hiLkQHDHvP4B)
hiLkQHDHvP4B = IDJ2eXGCBCDu.nn.ag0mwEgWzjYv(hiLkQHDHvP4B, keep_prob=1.0 - n4ljua2gi1Pr.ag0mwEgWzjYv)
hiLkQHDHvP4B = [hiLkQHDHvP4B[:, WVxHKyX45z_L, :] for WVxHKyX45z_L in vQr8gNKaIaWE(UooxTiYy6tiO)]
CCU1lF1kcm5_ = EsIbTXVrccif(n4ljua2gi1Pr)
(VNGQdHSFPrso, KKFQISrGeiAm) = IDJ2eXGCBCDu.nn.static_rnn(CCU1lF1kcm5_, hiLkQHDHvP4B, sequence_length=CHAOgk5VCHH_, dtype=IDJ2eXGCBCDu.float32)
return xafqLlk3kkUe(KKFQISrGeiAm, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb5'), chr(0b1100100) + chr(101) + chr(0b1100011) + '\x6f' + chr(100) + chr(101))('\x75' + chr(0b1110100) + chr(0b1100110) + '\055' + '\x38'))
|
tensorflow/tensor2tensor
|
tensor2tensor/models/research/vqa_attention.py
|
attn
|
def attn(image_feat, query, hparams, name="attn"):
"""Attention on image feature with question as query."""
with tf.variable_scope(name, "attn", values=[image_feat, query]):
attn_dim = hparams.attn_dim
num_glimps = hparams.num_glimps
num_channels = common_layers.shape_list(image_feat)[-1]
if len(common_layers.shape_list(image_feat)) == 4:
image_feat = common_layers.flatten4d3d(image_feat)
query = tf.expand_dims(query, 1)
image_proj = common_attention.compute_attention_component(
image_feat, attn_dim, name="image_proj")
query_proj = common_attention.compute_attention_component(
query, attn_dim, name="query_proj")
h = tf.nn.relu(image_proj + query_proj)
h_proj = common_attention.compute_attention_component(
h, num_glimps, name="h_proj")
p = tf.nn.softmax(h_proj, axis=1)
image_ave = tf.matmul(image_feat, p, transpose_a=True)
image_ave = tf.reshape(image_ave, [-1, num_channels*num_glimps])
return image_ave
|
python
|
def attn(image_feat, query, hparams, name="attn"):
"""Attention on image feature with question as query."""
with tf.variable_scope(name, "attn", values=[image_feat, query]):
attn_dim = hparams.attn_dim
num_glimps = hparams.num_glimps
num_channels = common_layers.shape_list(image_feat)[-1]
if len(common_layers.shape_list(image_feat)) == 4:
image_feat = common_layers.flatten4d3d(image_feat)
query = tf.expand_dims(query, 1)
image_proj = common_attention.compute_attention_component(
image_feat, attn_dim, name="image_proj")
query_proj = common_attention.compute_attention_component(
query, attn_dim, name="query_proj")
h = tf.nn.relu(image_proj + query_proj)
h_proj = common_attention.compute_attention_component(
h, num_glimps, name="h_proj")
p = tf.nn.softmax(h_proj, axis=1)
image_ave = tf.matmul(image_feat, p, transpose_a=True)
image_ave = tf.reshape(image_ave, [-1, num_channels*num_glimps])
return image_ave
|
[
"def",
"attn",
"(",
"image_feat",
",",
"query",
",",
"hparams",
",",
"name",
"=",
"\"attn\"",
")",
":",
"with",
"tf",
".",
"variable_scope",
"(",
"name",
",",
"\"attn\"",
",",
"values",
"=",
"[",
"image_feat",
",",
"query",
"]",
")",
":",
"attn_dim",
"=",
"hparams",
".",
"attn_dim",
"num_glimps",
"=",
"hparams",
".",
"num_glimps",
"num_channels",
"=",
"common_layers",
".",
"shape_list",
"(",
"image_feat",
")",
"[",
"-",
"1",
"]",
"if",
"len",
"(",
"common_layers",
".",
"shape_list",
"(",
"image_feat",
")",
")",
"==",
"4",
":",
"image_feat",
"=",
"common_layers",
".",
"flatten4d3d",
"(",
"image_feat",
")",
"query",
"=",
"tf",
".",
"expand_dims",
"(",
"query",
",",
"1",
")",
"image_proj",
"=",
"common_attention",
".",
"compute_attention_component",
"(",
"image_feat",
",",
"attn_dim",
",",
"name",
"=",
"\"image_proj\"",
")",
"query_proj",
"=",
"common_attention",
".",
"compute_attention_component",
"(",
"query",
",",
"attn_dim",
",",
"name",
"=",
"\"query_proj\"",
")",
"h",
"=",
"tf",
".",
"nn",
".",
"relu",
"(",
"image_proj",
"+",
"query_proj",
")",
"h_proj",
"=",
"common_attention",
".",
"compute_attention_component",
"(",
"h",
",",
"num_glimps",
",",
"name",
"=",
"\"h_proj\"",
")",
"p",
"=",
"tf",
".",
"nn",
".",
"softmax",
"(",
"h_proj",
",",
"axis",
"=",
"1",
")",
"image_ave",
"=",
"tf",
".",
"matmul",
"(",
"image_feat",
",",
"p",
",",
"transpose_a",
"=",
"True",
")",
"image_ave",
"=",
"tf",
".",
"reshape",
"(",
"image_ave",
",",
"[",
"-",
"1",
",",
"num_channels",
"*",
"num_glimps",
"]",
")",
"return",
"image_ave"
] |
Attention on image feature with question as query.
|
[
"Attention",
"on",
"image",
"feature",
"with",
"question",
"as",
"query",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/models/research/vqa_attention.py#L298-L318
|
train
|
Attention on image feature with question as query.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLt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tLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\x30' + chr(0b100011 + 0o114) + chr(1130 - 1081) + chr(0b110010) + chr(50), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110001) + chr(49), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + '\063' + chr(53) + chr(0b110000 + 0o1), 43181 - 43173), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110111), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b100011 + 0o17) + '\065' + chr(0b110011), 32455 - 32447), ehT0Px3KOsy9('\060' + '\157' + '\063' + chr(0b10 + 0o65) + '\067', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(2794 - 2741) + chr(2467 - 2415), ord("\x08")), ehT0Px3KOsy9(chr(0b100010 + 0o16) + chr(0b101100 + 0o103) + chr(0b110010) + chr(57 - 4) + chr(0b1101 + 0o46), 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b111001 + 0o66) + chr(0b10011 + 0o37) + chr(49) + chr(0b110001), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + '\061' + chr(48) + chr(0b110111), 13328 - 13320), ehT0Px3KOsy9('\060' + chr(111) + chr(51) + '\x34' + chr(2737 - 2684), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + '\063' + chr(0b110010) + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b101 + 0o56) + chr(0b110000) + '\x35', 22165 - 22157), ehT0Px3KOsy9(chr(0b1000 + 0o50) + '\157' + chr(0b110110) + chr(0b110101), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x32' + chr(0b100110 + 0o13) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(893 - 845) + chr(111) + chr(0b110011) + chr(0b110101) + '\065', 3006 - 2998), ehT0Px3KOsy9('\x30' + chr(0b111110 + 0o61) + '\061' + '\x32' + chr(54), 0o10), ehT0Px3KOsy9(chr(0b110000 + 0o0) + '\x6f' + chr(1733 - 1684) + chr(52) + chr(1191 - 1138), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110010) + '\x33' + '\x35', 0b1000), ehT0Px3KOsy9(chr(0b110 + 0o52) + chr(0b1101111) + chr(0b10000 + 0o41) + chr(48) + chr(55), 8), ehT0Px3KOsy9(chr(0b11001 + 0o27) + '\x6f' + chr(51) + chr(55) + '\064', ord("\x08")), ehT0Px3KOsy9(chr(0b11110 + 0o22) + '\x6f' + chr(50) + chr(130 - 79) + '\060', 0o10), ehT0Px3KOsy9(chr(0b10111 + 0o31) + '\x6f' + '\x31' + '\060' + chr(0b110110), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(50) + '\x32' + chr(2591 - 2540), 0o10), ehT0Px3KOsy9('\060' + '\157' + '\x37' + '\x34', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x33', 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(662 - 611) + chr(0b100100 + 0o15) + chr(0b110110), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(50) + '\x36' + '\x30', 62338 - 62330), ehT0Px3KOsy9('\x30' + chr(7365 - 7254) + chr(0b110010) + chr(55) + chr(406 - 351), 44245 - 44237), ehT0Px3KOsy9(chr(1366 - 1318) + chr(0b1101111) + chr(55) + chr(881 - 833), 31674 - 31666), ehT0Px3KOsy9(chr(0b11011 + 0o25) + chr(0b1101111) + chr(0b101 + 0o56) + chr(0b110101) + chr(2091 - 2037), 33090 - 33082), ehT0Px3KOsy9('\060' + '\157' + chr(49) + chr(0b110000 + 0o5), 0o10), ehT0Px3KOsy9(chr(1441 - 1393) + chr(0b1101111) + chr(455 - 406) + chr(0b1010 + 0o47) + '\066', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(49) + '\x31' + chr(0b110000), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\062' + '\x31' + chr(0b110000), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(2166 - 2113) + '\x37', 0b1000), ehT0Px3KOsy9(chr(141 - 93) + '\x6f' + chr(609 - 558) + '\x36' + '\061', 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(51) + chr(1227 - 1174) + chr(52), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110011) + '\x36', 46411 - 46403), ehT0Px3KOsy9('\060' + '\157' + '\x32' + '\x36' + chr(0b110000), 8)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + chr(753 - 642) + '\065' + chr(1207 - 1159), 61112 - 61104)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'|'), chr(0b1000111 + 0o35) + chr(0b100100 + 0o101) + chr(0b1001001 + 0o32) + '\157' + '\x64' + chr(101))('\165' + '\164' + chr(102) + '\055' + chr(1820 - 1764)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def LC5ZZ0hS8TJB(UKiMPArCVK05, MgmdEYXEleNe, n4ljua2gi1Pr, AIvJRzLdDfgF=xafqLlk3kkUe(SXOLrMavuUCe(b'3}\x9di'), '\144' + '\x65' + chr(0b1100011) + chr(0b101100 + 0o103) + '\x64' + chr(0b10111 + 0o116))(chr(0b1110101) + '\x74' + chr(8976 - 8874) + chr(45) + '\x38')):
with xafqLlk3kkUe(IDJ2eXGCBCDu, xafqLlk3kkUe(SXOLrMavuUCe(b'$h\x9bn\xca\x9d@\xce\xd64\x86\xba\xb5P'), chr(0b111000 + 0o54) + chr(3633 - 3532) + chr(250 - 151) + chr(111) + chr(100) + chr(0b1100101))(chr(0b1000011 + 0o62) + '\x74' + chr(0b1011111 + 0o7) + chr(45) + '\070'))(AIvJRzLdDfgF, xafqLlk3kkUe(SXOLrMavuUCe(b'3}\x9di'), '\144' + chr(101) + chr(0b1100011) + chr(2690 - 2579) + '\x64' + '\x65')(chr(8562 - 8445) + chr(6634 - 6518) + '\146' + chr(1496 - 1451) + '\x38'), values=[UKiMPArCVK05, MgmdEYXEleNe]):
K7EhPHTzENTy = n4ljua2gi1Pr.attn_dim
JapBcRdmLFhT = n4ljua2gi1Pr.num_glimps
X1ZpHSxyKbHn = jSKPaHwSAfVv.shape_list(UKiMPArCVK05)[-ehT0Px3KOsy9('\x30' + chr(1609 - 1498) + '\x31', 0o10)]
if c2A0yzQpDQB3(xafqLlk3kkUe(jSKPaHwSAfVv, xafqLlk3kkUe(SXOLrMavuUCe(b'!a\x88w\xce\xa0@\xc2\xfa3'), chr(100) + chr(3053 - 2952) + '\x63' + chr(0b100010 + 0o115) + chr(8364 - 8264) + chr(101))(chr(0b1110101) + chr(8689 - 8573) + chr(0b1100110) + chr(0b100 + 0o51) + '\x38'))(UKiMPArCVK05)) == ehT0Px3KOsy9('\060' + chr(1731 - 1620) + '\x34', ord("\x08")):
UKiMPArCVK05 = jSKPaHwSAfVv.flatten4d3d(UKiMPArCVK05)
MgmdEYXEleNe = IDJ2eXGCBCDu.expand_dims(MgmdEYXEleNe, ehT0Px3KOsy9(chr(48) + chr(0b101110 + 0o101) + chr(0b10 + 0o57), 8))
oo3ofAW_lSmp = WOnrfm4dlYcf.compute_attention_component(UKiMPArCVK05, K7EhPHTzENTy, name=xafqLlk3kkUe(SXOLrMavuUCe(b';d\x88`\xce\xa0\\\xd9\xe6-'), chr(100) + chr(101) + '\143' + chr(0b1100101 + 0o12) + chr(100) + '\x65')(chr(12498 - 12381) + chr(9699 - 9583) + chr(0b1110 + 0o130) + chr(0b101101) + chr(56)))
H3Nll1Ay2f3I = WOnrfm4dlYcf.compute_attention_component(MgmdEYXEleNe, K7EhPHTzENTy, name=xafqLlk3kkUe(SXOLrMavuUCe(b'#|\x8cu\xd2\xa0\\\xd9\xe6-'), '\x64' + chr(0b110100 + 0o61) + chr(8848 - 8749) + chr(0b1101111) + '\144' + chr(0b1100101))(chr(0b1001100 + 0o51) + '\164' + chr(0b10010 + 0o124) + chr(45) + chr(56)))
sz4HVsFVF8nL = IDJ2eXGCBCDu.nn.relu(oo3ofAW_lSmp + H3Nll1Ay2f3I)
aL4T8S7K2oKX = WOnrfm4dlYcf.compute_attention_component(sz4HVsFVF8nL, JapBcRdmLFhT, name=xafqLlk3kkUe(SXOLrMavuUCe(b':V\x99u\xc4\x95'), chr(0b1100100) + chr(101) + chr(99) + '\157' + chr(0b1100100) + chr(101))(chr(117) + chr(2835 - 2719) + '\x66' + chr(50 - 5) + chr(0b111000)))
UyakMW2IMFEj = IDJ2eXGCBCDu.nn.softmax(aL4T8S7K2oKX, axis=ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(2337 - 2288), 8))
M33ErfZasgWK = IDJ2eXGCBCDu.matmul(UKiMPArCVK05, UyakMW2IMFEj, transpose_a=ehT0Px3KOsy9(chr(48) + chr(0b100000 + 0o117) + chr(2363 - 2314), 8))
M33ErfZasgWK = IDJ2eXGCBCDu.reshape(M33ErfZasgWK, [-ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(418 - 369), 8), X1ZpHSxyKbHn * JapBcRdmLFhT])
return M33ErfZasgWK
|
tensorflow/tensor2tensor
|
tensor2tensor/models/research/vqa_attention.py
|
mlp
|
def mlp(feature, hparams, name="mlp"):
"""Multi layer perceptron with dropout and relu activation."""
with tf.variable_scope(name, "mlp", values=[feature]):
num_mlp_layers = hparams.num_mlp_layers
mlp_dim = hparams.mlp_dim
for _ in range(num_mlp_layers):
feature = common_layers.dense(feature, mlp_dim, activation=tf.nn.relu)
feature = tf.nn.dropout(feature, keep_prob=1.-hparams.dropout)
return feature
|
python
|
def mlp(feature, hparams, name="mlp"):
"""Multi layer perceptron with dropout and relu activation."""
with tf.variable_scope(name, "mlp", values=[feature]):
num_mlp_layers = hparams.num_mlp_layers
mlp_dim = hparams.mlp_dim
for _ in range(num_mlp_layers):
feature = common_layers.dense(feature, mlp_dim, activation=tf.nn.relu)
feature = tf.nn.dropout(feature, keep_prob=1.-hparams.dropout)
return feature
|
[
"def",
"mlp",
"(",
"feature",
",",
"hparams",
",",
"name",
"=",
"\"mlp\"",
")",
":",
"with",
"tf",
".",
"variable_scope",
"(",
"name",
",",
"\"mlp\"",
",",
"values",
"=",
"[",
"feature",
"]",
")",
":",
"num_mlp_layers",
"=",
"hparams",
".",
"num_mlp_layers",
"mlp_dim",
"=",
"hparams",
".",
"mlp_dim",
"for",
"_",
"in",
"range",
"(",
"num_mlp_layers",
")",
":",
"feature",
"=",
"common_layers",
".",
"dense",
"(",
"feature",
",",
"mlp_dim",
",",
"activation",
"=",
"tf",
".",
"nn",
".",
"relu",
")",
"feature",
"=",
"tf",
".",
"nn",
".",
"dropout",
"(",
"feature",
",",
"keep_prob",
"=",
"1.",
"-",
"hparams",
".",
"dropout",
")",
"return",
"feature"
] |
Multi layer perceptron with dropout and relu activation.
|
[
"Multi",
"layer",
"perceptron",
"with",
"dropout",
"and",
"relu",
"activation",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/models/research/vqa_attention.py#L321-L329
|
train
|
Multi layer perceptron with dropout and relu activation.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXI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mUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(330 - 282) + chr(0b1101111) + chr(2935 - 2880) + chr(49), 15839 - 15831), ehT0Px3KOsy9(chr(183 - 135) + chr(3615 - 3504) + chr(49) + chr(712 - 659) + '\x32', 0o10), ehT0Px3KOsy9('\060' + chr(0b111011 + 0o64) + chr(0b110011) + chr(0b1111 + 0o42) + '\065', 0o10), ehT0Px3KOsy9(chr(1243 - 1195) + chr(0b1011111 + 0o20) + '\063' + '\065' + chr(50), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(51) + chr(0b100100 + 0o17) + chr(0b110001), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110010) + '\066' + chr(0b110100), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b100101 + 0o112) + chr(49) + chr(54) + chr(0b10101 + 0o42), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110001 + 0o1) + '\x32' + '\x33', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b100111 + 0o110) + chr(0b110010) + chr(2142 - 2091) + '\062', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + '\x31' + '\x32' + chr(54), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101101 + 0o2) + chr(0b10000 + 0o42) + chr(0b110101) + chr(0b11010 + 0o30), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\063' + chr(825 - 773) + chr(689 - 639), 2185 - 2177), ehT0Px3KOsy9('\060' + chr(4953 - 4842) + chr(1493 - 1444) + '\063' + chr(54), 3273 - 3265), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x32' + chr(1467 - 1415) + '\x33', ord("\x08")), ehT0Px3KOsy9(chr(1112 - 1064) + '\157' + chr(1343 - 1292) + chr(0b100 + 0o55) + chr(0b110110), 0b1000), ehT0Px3KOsy9(chr(48) + chr(5569 - 5458) + '\x33' + chr(1170 - 1118) + chr(1554 - 1502), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(1051 - 940) + chr(67 - 15) + chr(51), 0o10), ehT0Px3KOsy9(chr(0b101010 + 0o6) + '\157' + chr(0b110010) + '\x34' + chr(0b110100), 40174 - 40166), ehT0Px3KOsy9(chr(48) + chr(111) + '\062' + chr(0b1 + 0o61) + chr(2271 - 2220), 8), ehT0Px3KOsy9(chr(0b100101 + 0o13) + '\157' + '\x31' + '\065' + '\060', 0o10), ehT0Px3KOsy9(chr(0b11101 + 0o23) + chr(111) + '\x33' + '\x32' + chr(0b110111), 41706 - 41698), ehT0Px3KOsy9(chr(48) + chr(0b110101 + 0o72) + chr(0b110001) + chr(51) + '\x30', 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(52) + chr(0b101111 + 0o1), 0b1000), ehT0Px3KOsy9(chr(270 - 222) + chr(0b1101111) + chr(0b101100 + 0o5) + chr(2676 - 2621) + '\061', 326 - 318), ehT0Px3KOsy9('\060' + '\157' + chr(51) + chr(48) + '\061', 11174 - 11166), ehT0Px3KOsy9(chr(1304 - 1256) + '\157' + chr(50) + chr(0b1110 + 0o44) + chr(0b1110 + 0o44), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1011010 + 0o25) + chr(0b110100) + chr(0b110110), 0b1000), ehT0Px3KOsy9('\060' + chr(9169 - 9058) + chr(0b100011 + 0o20) + '\067' + chr(49), ord("\x08")), ehT0Px3KOsy9(chr(1092 - 1044) + chr(5079 - 4968) + chr(0b1100 + 0o47) + chr(2220 - 2165) + chr(0b110110), 19565 - 19557), ehT0Px3KOsy9(chr(0b11010 + 0o26) + chr(0b1010110 + 0o31) + chr(0b110001) + '\064' + chr(0b100101 + 0o17), 10418 - 10410), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b10100 + 0o37) + chr(0b110101) + chr(0b110101), ord("\x08")), ehT0Px3KOsy9(chr(0b1101 + 0o43) + '\157' + '\x32' + chr(48) + chr(0b110000), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(2903 - 2792) + chr(51) + '\x30' + chr(0b110001), 8), ehT0Px3KOsy9(chr(48) + chr(0b110010 + 0o75) + chr(0b100000 + 0o22) + chr(0b110101) + '\x32', 8), ehT0Px3KOsy9(chr(1510 - 1462) + chr(111) + chr(0b111 + 0o53) + '\062', 50238 - 50230), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(799 - 749) + chr(55) + chr(0b101000 + 0o17), 0b1000), ehT0Px3KOsy9(chr(0b100 + 0o54) + chr(0b101000 + 0o107) + chr(572 - 522) + '\064' + chr(499 - 447), 8), ehT0Px3KOsy9(chr(239 - 191) + chr(0b1101111) + '\x34' + chr(49), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b110010 + 0o75) + chr(50) + chr(0b110111) + chr(0b10010 + 0o42), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(49) + '\x35' + '\066', 52231 - 52223)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + '\157' + '\x35' + chr(48), ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x17'), chr(100) + chr(0b1100101) + chr(0b1010111 + 0o14) + '\157' + chr(0b1100100) + chr(0b1100101))('\165' + chr(8024 - 7908) + '\x66' + chr(45) + '\070') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def J5VLRlHnOa0g(fVxZREPfp9Oo, n4ljua2gi1Pr, AIvJRzLdDfgF=xafqLlk3kkUe(SXOLrMavuUCe(b'T\x06\xbd'), '\144' + '\x65' + '\143' + '\x6f' + chr(7971 - 7871) + '\x65')('\165' + chr(0b1110100) + chr(102) + chr(45) + chr(0b111000))):
with xafqLlk3kkUe(IDJ2eXGCBCDu, xafqLlk3kkUe(SXOLrMavuUCe(b'O\x0b\xbf\x83\xb8\xd6\x1b\xf6\xc5%\xc9\x8d.\xc6'), '\144' + chr(0b1100001 + 0o4) + chr(99) + chr(0b1101111) + '\x64' + chr(101))(chr(117) + chr(116) + chr(0b1100110) + '\055' + chr(56)))(AIvJRzLdDfgF, xafqLlk3kkUe(SXOLrMavuUCe(b'T\x06\xbd'), chr(9990 - 9890) + chr(5537 - 5436) + chr(0b1100011) + chr(806 - 695) + '\144' + chr(9375 - 9274))(chr(0b1010111 + 0o36) + chr(0b1110100) + chr(0b1100110) + '\x2d' + '\070'), values=[fVxZREPfp9Oo]):
rUEG44JtyB2E = n4ljua2gi1Pr.num_mlp_layers
LEmYGdXaJEgN = n4ljua2gi1Pr.mlp_dim
for VNGQdHSFPrso in vQr8gNKaIaWE(rUEG44JtyB2E):
fVxZREPfp9Oo = jSKPaHwSAfVv.dense(fVxZREPfp9Oo, LEmYGdXaJEgN, activation=IDJ2eXGCBCDu.nn.relu)
fVxZREPfp9Oo = IDJ2eXGCBCDu.nn.ag0mwEgWzjYv(fVxZREPfp9Oo, keep_prob=1.0 - n4ljua2gi1Pr.ag0mwEgWzjYv)
return fVxZREPfp9Oo
|
tensorflow/tensor2tensor
|
tensor2tensor/models/research/vqa_attention.py
|
vqa_attention_base
|
def vqa_attention_base():
"""VQA attention baseline hparams."""
hparams = common_hparams.basic_params1()
hparams.batch_size = 128
hparams.use_fixed_batch_size = True,
hparams.optimizer = "adam"
hparams.optimizer_adam_beta1 = 0.9
hparams.optimizer_adam_beta2 = 0.999
hparams.optimizer_adam_epsilon = 1e-8
hparams.weight_decay = 0.
hparams.clip_grad_norm = 0.
hparams.initializer = "xavier"
hparams.learning_rate = 0.5
hparams.learning_rate_schedule = "legacy"
hparams.learning_rate_warmup_steps = 0
hparams.learning_rate_decay_scheme = "exp"
hparams.learning_rate_decay_rate = 0.5
hparams.learning_rate_decay_steps = 50000
hparams.dropout = 0.5
hparams.summarize_grads = True
hparams.summarize_vars = True
# not used hparams
hparams.label_smoothing = 0.
hparams.multiply_embedding_mode = ""
# add new hparams
# preprocess
hparams.add_hparam("resize_side", 512)
hparams.add_hparam("height", 448)
hparams.add_hparam("width", 448)
hparams.add_hparam("distort", True)
hparams.add_hparam("train_resnet", False)
hparams.add_hparam("rnn_type", "lstm")
hparams.add_hparam("num_rnn_layers", 1)
hparams.add_hparam("max_question_length", 15)
# lstm hidden size
hparams.hidden_size = 512
hparams.add_hparam("attn_dim", 512)
hparams.add_hparam("num_glimps", 2)
hparams.add_hparam("num_mlp_layers", 1)
hparams.add_hparam("mlp_dim", 1024)
hparams.add_hparam("image_input_type", "image")
hparams.add_hparam("image_model_fn", "resnet_v1_152")
hparams.add_hparam("image_feat_size", 0)
# self attention parts
hparams.norm_type = "layer"
hparams.layer_preprocess_sequence = "n"
hparams.layer_postprocess_sequence = "da"
hparams.layer_prepostprocess_dropout = 0.3
hparams.attention_dropout = 0.1
hparams.relu_dropout = 0.1
hparams.image_hidden_size = 2048
hparams.add_hparam("num_encoder_layers", 1)
# Attention-related flags.
hparams.add_hparam("num_heads", 8)
hparams.add_hparam("attention_key_channels", 0)
hparams.add_hparam("attention_value_channels", 0)
hparams.add_hparam("image_filter_size", 1024)
hparams.add_hparam("self_attention_type", "dot_product")
hparams.add_hparam("scale_dotproduct", True)
return hparams
|
python
|
def vqa_attention_base():
"""VQA attention baseline hparams."""
hparams = common_hparams.basic_params1()
hparams.batch_size = 128
hparams.use_fixed_batch_size = True,
hparams.optimizer = "adam"
hparams.optimizer_adam_beta1 = 0.9
hparams.optimizer_adam_beta2 = 0.999
hparams.optimizer_adam_epsilon = 1e-8
hparams.weight_decay = 0.
hparams.clip_grad_norm = 0.
hparams.initializer = "xavier"
hparams.learning_rate = 0.5
hparams.learning_rate_schedule = "legacy"
hparams.learning_rate_warmup_steps = 0
hparams.learning_rate_decay_scheme = "exp"
hparams.learning_rate_decay_rate = 0.5
hparams.learning_rate_decay_steps = 50000
hparams.dropout = 0.5
hparams.summarize_grads = True
hparams.summarize_vars = True
# not used hparams
hparams.label_smoothing = 0.
hparams.multiply_embedding_mode = ""
# add new hparams
# preprocess
hparams.add_hparam("resize_side", 512)
hparams.add_hparam("height", 448)
hparams.add_hparam("width", 448)
hparams.add_hparam("distort", True)
hparams.add_hparam("train_resnet", False)
hparams.add_hparam("rnn_type", "lstm")
hparams.add_hparam("num_rnn_layers", 1)
hparams.add_hparam("max_question_length", 15)
# lstm hidden size
hparams.hidden_size = 512
hparams.add_hparam("attn_dim", 512)
hparams.add_hparam("num_glimps", 2)
hparams.add_hparam("num_mlp_layers", 1)
hparams.add_hparam("mlp_dim", 1024)
hparams.add_hparam("image_input_type", "image")
hparams.add_hparam("image_model_fn", "resnet_v1_152")
hparams.add_hparam("image_feat_size", 0)
# self attention parts
hparams.norm_type = "layer"
hparams.layer_preprocess_sequence = "n"
hparams.layer_postprocess_sequence = "da"
hparams.layer_prepostprocess_dropout = 0.3
hparams.attention_dropout = 0.1
hparams.relu_dropout = 0.1
hparams.image_hidden_size = 2048
hparams.add_hparam("num_encoder_layers", 1)
# Attention-related flags.
hparams.add_hparam("num_heads", 8)
hparams.add_hparam("attention_key_channels", 0)
hparams.add_hparam("attention_value_channels", 0)
hparams.add_hparam("image_filter_size", 1024)
hparams.add_hparam("self_attention_type", "dot_product")
hparams.add_hparam("scale_dotproduct", True)
return hparams
|
[
"def",
"vqa_attention_base",
"(",
")",
":",
"hparams",
"=",
"common_hparams",
".",
"basic_params1",
"(",
")",
"hparams",
".",
"batch_size",
"=",
"128",
"hparams",
".",
"use_fixed_batch_size",
"=",
"True",
",",
"hparams",
".",
"optimizer",
"=",
"\"adam\"",
"hparams",
".",
"optimizer_adam_beta1",
"=",
"0.9",
"hparams",
".",
"optimizer_adam_beta2",
"=",
"0.999",
"hparams",
".",
"optimizer_adam_epsilon",
"=",
"1e-8",
"hparams",
".",
"weight_decay",
"=",
"0.",
"hparams",
".",
"clip_grad_norm",
"=",
"0.",
"hparams",
".",
"initializer",
"=",
"\"xavier\"",
"hparams",
".",
"learning_rate",
"=",
"0.5",
"hparams",
".",
"learning_rate_schedule",
"=",
"\"legacy\"",
"hparams",
".",
"learning_rate_warmup_steps",
"=",
"0",
"hparams",
".",
"learning_rate_decay_scheme",
"=",
"\"exp\"",
"hparams",
".",
"learning_rate_decay_rate",
"=",
"0.5",
"hparams",
".",
"learning_rate_decay_steps",
"=",
"50000",
"hparams",
".",
"dropout",
"=",
"0.5",
"hparams",
".",
"summarize_grads",
"=",
"True",
"hparams",
".",
"summarize_vars",
"=",
"True",
"# not used hparams",
"hparams",
".",
"label_smoothing",
"=",
"0.",
"hparams",
".",
"multiply_embedding_mode",
"=",
"\"\"",
"# add new hparams",
"# preprocess",
"hparams",
".",
"add_hparam",
"(",
"\"resize_side\"",
",",
"512",
")",
"hparams",
".",
"add_hparam",
"(",
"\"height\"",
",",
"448",
")",
"hparams",
".",
"add_hparam",
"(",
"\"width\"",
",",
"448",
")",
"hparams",
".",
"add_hparam",
"(",
"\"distort\"",
",",
"True",
")",
"hparams",
".",
"add_hparam",
"(",
"\"train_resnet\"",
",",
"False",
")",
"hparams",
".",
"add_hparam",
"(",
"\"rnn_type\"",
",",
"\"lstm\"",
")",
"hparams",
".",
"add_hparam",
"(",
"\"num_rnn_layers\"",
",",
"1",
")",
"hparams",
".",
"add_hparam",
"(",
"\"max_question_length\"",
",",
"15",
")",
"# lstm hidden size",
"hparams",
".",
"hidden_size",
"=",
"512",
"hparams",
".",
"add_hparam",
"(",
"\"attn_dim\"",
",",
"512",
")",
"hparams",
".",
"add_hparam",
"(",
"\"num_glimps\"",
",",
"2",
")",
"hparams",
".",
"add_hparam",
"(",
"\"num_mlp_layers\"",
",",
"1",
")",
"hparams",
".",
"add_hparam",
"(",
"\"mlp_dim\"",
",",
"1024",
")",
"hparams",
".",
"add_hparam",
"(",
"\"image_input_type\"",
",",
"\"image\"",
")",
"hparams",
".",
"add_hparam",
"(",
"\"image_model_fn\"",
",",
"\"resnet_v1_152\"",
")",
"hparams",
".",
"add_hparam",
"(",
"\"image_feat_size\"",
",",
"0",
")",
"# self attention parts",
"hparams",
".",
"norm_type",
"=",
"\"layer\"",
"hparams",
".",
"layer_preprocess_sequence",
"=",
"\"n\"",
"hparams",
".",
"layer_postprocess_sequence",
"=",
"\"da\"",
"hparams",
".",
"layer_prepostprocess_dropout",
"=",
"0.3",
"hparams",
".",
"attention_dropout",
"=",
"0.1",
"hparams",
".",
"relu_dropout",
"=",
"0.1",
"hparams",
".",
"image_hidden_size",
"=",
"2048",
"hparams",
".",
"add_hparam",
"(",
"\"num_encoder_layers\"",
",",
"1",
")",
"# Attention-related flags.",
"hparams",
".",
"add_hparam",
"(",
"\"num_heads\"",
",",
"8",
")",
"hparams",
".",
"add_hparam",
"(",
"\"attention_key_channels\"",
",",
"0",
")",
"hparams",
".",
"add_hparam",
"(",
"\"attention_value_channels\"",
",",
"0",
")",
"hparams",
".",
"add_hparam",
"(",
"\"image_filter_size\"",
",",
"1024",
")",
"hparams",
".",
"add_hparam",
"(",
"\"self_attention_type\"",
",",
"\"dot_product\"",
")",
"hparams",
".",
"add_hparam",
"(",
"\"scale_dotproduct\"",
",",
"True",
")",
"return",
"hparams"
] |
VQA attention baseline hparams.
|
[
"VQA",
"attention",
"baseline",
"hparams",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/models/research/vqa_attention.py#L333-L400
|
train
|
VQA attention base hparams.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,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Exception,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(48) + '\x6f' + '\062' + chr(2016 - 1962) + chr(0b101111 + 0o4), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b101010 + 0o12) + '\060', ord("\x08")), ehT0Px3KOsy9(chr(0b101 + 0o53) + chr(111) + chr(2265 - 2214) + chr(53) + '\064', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110001) + chr(138 - 84) + '\x33', 0o10), ehT0Px3KOsy9(chr(48) + chr(999 - 888) + chr(1145 - 1094) + '\061' + '\x30', 0o10), ehT0Px3KOsy9(chr(325 - 277) + chr(0b1010000 + 0o37) + chr(0b110011) + '\x30' + chr(0b110111), 16448 - 16440), ehT0Px3KOsy9(chr(0b11010 + 0o26) + chr(0b1011000 + 0o27) + chr(407 - 357) + chr(0b110011) + chr(0b110111), 0o10), ehT0Px3KOsy9('\x30' + chr(0b110001 + 0o76) + chr(0b110100) + chr(1095 - 1046), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x36', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(286 - 235) + '\x35', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(1659 - 1610) + chr(0b101011 + 0o13), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x34' + '\065', 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110011) + '\x37' + '\066', 20110 - 20102), ehT0Px3KOsy9(chr(48) + '\x6f' + '\062' + '\x34' + chr(1439 - 1388), 8710 - 8702), ehT0Px3KOsy9(chr(48) + chr(0b1000110 + 0o51) + chr(0b110010) + chr(53) + '\064', ord("\x08")), ehT0Px3KOsy9(chr(0b110 + 0o52) + chr(0b1101111) + chr(50) + chr(0b110001) + chr(258 - 206), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x37' + chr(1193 - 1140), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b11010 + 0o32) + '\x31', 8), ehT0Px3KOsy9('\x30' + '\x6f' + chr(50) + chr(1036 - 986) + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(0b10111 + 0o31) + chr(3383 - 3272) + chr(54) + chr(0b110110), 0o10), ehT0Px3KOsy9(chr(0b1100 + 0o44) + chr(0b1101111) + '\061' + '\064' + '\067', 43537 - 43529), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b1011 + 0o46) + '\062' + '\065', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110 + 0o54) + chr(825 - 774) + '\x35', 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b101100 + 0o5) + '\x34' + chr(898 - 848), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(51) + chr(2582 - 2528), 6251 - 6243), ehT0Px3KOsy9(chr(1809 - 1761) + chr(0b1000111 + 0o50) + chr(0b110001) + chr(0b110101) + chr(0b110100), 53582 - 53574), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b101010 + 0o11) + chr(1489 - 1439) + chr(447 - 397), 0o10), ehT0Px3KOsy9(chr(1925 - 1877) + chr(111) + chr(0b110 + 0o54) + chr(48) + '\x30', 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(1403 - 1351) + chr(54), 64578 - 64570), ehT0Px3KOsy9('\060' + chr(723 - 612) + chr(50) + chr(49) + chr(0b110011), ord("\x08")), ehT0Px3KOsy9(chr(0b101110 + 0o2) + '\x6f' + chr(0b1100 + 0o47) + chr(0b110110) + chr(1278 - 1226), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x35' + '\x35', 0o10), ehT0Px3KOsy9('\060' + '\x6f' + '\061' + '\x35' + chr(0b101011 + 0o6), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x32' + '\066', 35859 - 35851), ehT0Px3KOsy9('\060' + '\157' + '\061' + '\x32', 0b1000), ehT0Px3KOsy9(chr(1548 - 1500) + chr(11349 - 11238) + chr(0b100011 + 0o16) + '\065' + chr(0b110011), 0o10), ehT0Px3KOsy9(chr(1258 - 1210) + chr(0b1101110 + 0o1) + '\x33' + chr(0b110000) + chr(0b110010), 37391 - 37383), ehT0Px3KOsy9(chr(48) + chr(4660 - 4549) + '\x37' + chr(2122 - 2067), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b10001 + 0o136) + '\062' + chr(49), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110001) + chr(0b110011) + chr(0b101000 + 0o14), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + chr(0b1011001 + 0o26) + chr(1662 - 1609) + chr(0b110000), ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x9d'), chr(100) + '\145' + chr(5867 - 5768) + '\x6f' + chr(0b1100100) + chr(4524 - 4423))('\x75' + '\x74' + chr(8134 - 8032) + chr(0b1010 + 0o43) + chr(0b100 + 0o64)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def hgosTcfjgBpW():
n4ljua2gi1Pr = vLnG3ZpOXWXZ.basic_params1()
n4ljua2gi1Pr.ix9dZyeAmUxY = ehT0Px3KOsy9(chr(795 - 747) + chr(0b1101111) + chr(0b100 + 0o56) + chr(48) + chr(1589 - 1541), 8)
n4ljua2gi1Pr.V9YwhDsFOlGK = (ehT0Px3KOsy9('\060' + chr(0b1100010 + 0o15) + chr(672 - 623), 0b1000),)
n4ljua2gi1Pr.XdKNcYRObPK3 = xafqLlk3kkUe(SXOLrMavuUCe(b'\xd2D\x8d\x1e'), chr(100) + '\x65' + '\x63' + '\157' + chr(100) + chr(9307 - 9206))(chr(8453 - 8336) + chr(0b111011 + 0o71) + '\146' + chr(0b100 + 0o51) + '\070')
n4ljua2gi1Pr.GcOjyd7zcDH8 = 0.9
n4ljua2gi1Pr.CBOVKNT0M9cG = 0.999
n4ljua2gi1Pr.o17O_bIptWdl = 1e-08
n4ljua2gi1Pr.eB4rJl6fUxw9 = 0.0
n4ljua2gi1Pr.SdNSZNVkVjLh = 0.0
n4ljua2gi1Pr.kwfuYzkY5C57 = xafqLlk3kkUe(SXOLrMavuUCe(b'\xcbA\x9a\x1a\xad\xb5'), '\x64' + chr(0b1100101) + '\143' + chr(111) + chr(0b0 + 0o144) + chr(0b1001001 + 0o34))(chr(0b1011110 + 0o27) + chr(0b1110100) + chr(0b1001010 + 0o34) + chr(45) + chr(0b100111 + 0o21))
n4ljua2gi1Pr.QGSIpd_yUNzU = 0.5
n4ljua2gi1Pr.Lz_s7neUzM5V = xafqLlk3kkUe(SXOLrMavuUCe(b'\xdfE\x8b\x12\xab\xbe'), chr(4835 - 4735) + '\145' + '\143' + chr(0b110010 + 0o75) + chr(0b1000010 + 0o42) + chr(0b1100101))(chr(0b1110101) + '\x74' + chr(0b1001 + 0o135) + chr(45) + chr(2220 - 2164))
n4ljua2gi1Pr.fHyhoyGmdvM9 = ehT0Px3KOsy9(chr(566 - 518) + '\x6f' + '\060', 0o10)
n4ljua2gi1Pr.v3ZnJE9Hdub1 = xafqLlk3kkUe(SXOLrMavuUCe(b'\xd6X\x9c'), '\x64' + '\x65' + '\143' + '\x6f' + '\144' + '\x65')(chr(0b1110101) + chr(301 - 185) + '\x66' + chr(0b100010 + 0o13) + '\x38')
n4ljua2gi1Pr.cp7EqSq4klv1 = 0.5
n4ljua2gi1Pr.YBAB1XyoxOc5 = ehT0Px3KOsy9(chr(0b110000) + '\157' + '\061' + chr(0b110100) + chr(629 - 580) + '\065' + chr(1641 - 1591) + '\060', 0b1000)
n4ljua2gi1Pr.ag0mwEgWzjYv = 0.5
n4ljua2gi1Pr.g1CKJR0X4YHm = ehT0Px3KOsy9('\060' + chr(644 - 533) + chr(0b110001), 8)
n4ljua2gi1Pr.rMHVOllrHaoo = ehT0Px3KOsy9('\060' + '\x6f' + '\061', 8)
n4ljua2gi1Pr.FSjUgdaczzRk = 0.0
n4ljua2gi1Pr.q5UEpHM7ZIlT = xafqLlk3kkUe(SXOLrMavuUCe(b''), chr(0b1100100) + '\145' + chr(99) + '\157' + chr(0b110000 + 0o64) + '\145')(chr(0b1110101) + '\x74' + '\x66' + chr(45) + '\x38')
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd2D\x88,\xa0\xb7\xfeSgp'), chr(0b100101 + 0o77) + chr(0b1100101) + '\x63' + chr(0b1000011 + 0o54) + chr(0b11111 + 0o105) + chr(2940 - 2839))(chr(0b1100 + 0o151) + chr(116) + chr(102) + chr(0b101101) + chr(2203 - 2147)))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xc1E\x9f\x1a\xb2\xa2\xc0Royk'), chr(100) + chr(101) + chr(0b1100011) + chr(0b1101111) + chr(0b1100100) + '\145')(chr(0b1001010 + 0o53) + '\164' + chr(0b1100110) + chr(0b101101) + '\x38'), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(49) + chr(48) + '\x30' + chr(49 - 1), ord("\x08")))
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd2D\x88,\xa0\xb7\xfeSgp'), chr(0b1010001 + 0o23) + '\145' + '\x63' + chr(0b1000101 + 0o52) + chr(0b11101 + 0o107) + '\145')('\x75' + '\164' + '\146' + chr(0b101101) + '\070'))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xdbE\x85\x14\xa0\xb3'), '\x64' + chr(9992 - 9891) + chr(0b1100011) + '\x6f' + chr(100) + chr(7950 - 7849))('\x75' + chr(0b1110100) + chr(1805 - 1703) + chr(772 - 727) + '\x38'), ehT0Px3KOsy9('\060' + chr(11412 - 11301) + '\x37' + '\x30' + chr(0b10100 + 0o34), ord("\x08")))
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd2D\x88,\xa0\xb7\xfeSgp'), chr(3814 - 3714) + chr(0b101000 + 0o75) + chr(0b1000010 + 0o41) + chr(0b1101111) + chr(0b1100100) + '\145')('\x75' + chr(0b1110100) + chr(0b1100110) + chr(1966 - 1921) + chr(1188 - 1132)))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xc4I\x88\x07\xa0'), chr(5934 - 5834) + chr(0b1100101) + '\143' + '\x6f' + chr(100) + chr(6176 - 6075))(chr(117) + '\x74' + chr(0b110110 + 0o60) + chr(0b101101) + '\070'), ehT0Px3KOsy9(chr(48) + chr(111) + '\x37' + '\x30' + chr(0b110000), 8))
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd2D\x88,\xa0\xb7\xfeSgp'), chr(3383 - 3283) + '\145' + chr(99) + '\x6f' + chr(0b10110 + 0o116) + chr(0b1000101 + 0o40))('\x75' + chr(116) + '\146' + chr(1006 - 961) + chr(0b111000)))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xd7I\x9f\x07\xa7\xb5\xeb'), chr(0b1010011 + 0o21) + chr(0b1011101 + 0o10) + chr(0b1100011) + chr(0b110001 + 0o76) + chr(0b110101 + 0o57) + chr(0b1100101))(chr(117) + chr(0b101010 + 0o112) + chr(0b1000101 + 0o41) + chr(0b101101) + '\x38'), ehT0Px3KOsy9(chr(0b10011 + 0o35) + chr(0b1101111) + '\x31', 8))
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd2D\x88,\xa0\xb7\xfeSgp'), chr(5466 - 5366) + chr(101) + chr(5811 - 5712) + '\x6f' + '\144' + chr(0b1100101))('\165' + chr(116) + chr(0b1011100 + 0o12) + chr(204 - 159) + chr(436 - 380)))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xc7R\x8d\x1a\xa6\x98\xedDuskQ'), chr(0b1 + 0o143) + '\145' + '\143' + '\157' + chr(0b1100100) + '\x65')(chr(3546 - 3429) + chr(116) + '\146' + chr(1824 - 1779) + chr(0b111000)), ehT0Px3KOsy9(chr(0b10100 + 0o34) + '\x6f' + chr(2110 - 2062), 8))
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd2D\x88,\xa0\xb7\xfeSgp'), chr(100) + '\145' + chr(1719 - 1620) + '\157' + chr(0b1100100) + '\x65')(chr(4320 - 4203) + '\x74' + '\x66' + chr(0b10001 + 0o34) + chr(0b111000)))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xc1N\x82,\xbc\xbe\xefD'), '\144' + '\x65' + chr(99) + chr(1029 - 918) + '\x64' + chr(101))(chr(117) + chr(0b1110100) + '\x66' + chr(45) + chr(56)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xdfS\x98\x1e'), chr(3807 - 3707) + chr(4220 - 4119) + chr(99) + chr(0b11110 + 0o121) + chr(1909 - 1809) + '\145')(chr(0b1110101) + chr(0b100000 + 0o124) + '\x66' + chr(0b101101) + '\070'))
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd2D\x88,\xa0\xb7\xfeSgp'), '\144' + chr(101) + chr(3636 - 3537) + chr(111) + chr(1527 - 1427) + chr(0b111110 + 0o47))('\165' + '\x74' + '\146' + '\x2d' + chr(0b11001 + 0o37)))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xddU\x81,\xba\xa9\xf1~j|w@\x8c\xd0'), '\144' + chr(0b1011011 + 0o12) + chr(0b1100011) + chr(0b1100000 + 0o17) + '\144' + '\145')(chr(11004 - 10887) + '\164' + chr(0b1011010 + 0o14) + chr(0b101101) + chr(0b1111 + 0o51)), ehT0Px3KOsy9(chr(0b110000) + chr(9970 - 9859) + chr(0b1100 + 0o45), 8))
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd2D\x88,\xa0\xb7\xfeSgp'), '\144' + chr(101) + chr(6118 - 6019) + chr(111) + chr(7307 - 7207) + chr(0b111010 + 0o53))('\165' + chr(0b1100011 + 0o21) + '\146' + chr(45) + chr(1156 - 1100)))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xdeA\x94,\xb9\xb2\xfaRrtaK\xa1\xcf\xc9\xe2ZU\xfd'), '\x64' + chr(0b1100100 + 0o1) + chr(0b1100011) + '\x6f' + chr(100) + chr(101))('\x75' + chr(1662 - 1546) + '\146' + chr(1303 - 1258) + '\x38'), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110001) + chr(0b1111 + 0o50), ord("\x08")))
n4ljua2gi1Pr.qzoyXN3kdhDL = ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(49) + chr(0b110000) + chr(48) + '\060', 8)
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd2D\x88,\xa0\xb7\xfeSgp'), chr(0b1100100) + chr(0b11011 + 0o112) + chr(99) + '\x6f' + chr(0b1100100) + '\145')(chr(1466 - 1349) + chr(0b1001001 + 0o53) + '\146' + chr(0b10 + 0o53) + chr(0b111000)))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xd2T\x98\x1d\x97\xa3\xf6L'), '\x64' + chr(3709 - 3608) + chr(99) + '\x6f' + chr(0b1100100) + '\x65')('\165' + chr(0b110110 + 0o76) + chr(0b1011110 + 0o10) + chr(0b1011 + 0o42) + chr(2712 - 2656)), ehT0Px3KOsy9(chr(214 - 166) + '\157' + '\x31' + chr(48) + chr(0b110000) + '\x30', 8))
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd2D\x88,\xa0\xb7\xfeSgp'), '\144' + chr(0b11100 + 0o111) + chr(0b1100 + 0o127) + '\157' + '\x64' + chr(265 - 164))(chr(0b1110101) + '\x74' + chr(7286 - 7184) + '\x2d' + '\070'))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xddU\x81,\xaf\xab\xf6Lvn'), chr(0b1011011 + 0o11) + chr(0b1100101) + '\x63' + chr(0b111011 + 0o64) + '\x64' + chr(3529 - 3428))('\165' + '\164' + chr(0b1100110) + chr(45) + chr(0b111000)), ehT0Px3KOsy9('\060' + chr(456 - 345) + chr(50), 49275 - 49267))
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd2D\x88,\xa0\xb7\xfeSgp'), chr(0b1011000 + 0o14) + chr(101) + chr(0b1100011) + chr(4217 - 4106) + chr(100) + '\x65')('\x75' + '\x74' + chr(0b1100110) + '\x2d' + chr(0b1 + 0o67)))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xddU\x81,\xa5\xab\xef~j|w@\x8c\xd0'), chr(0b1100100) + chr(0b1000100 + 0o41) + '\143' + '\157' + chr(4615 - 4515) + chr(0b110110 + 0o57))('\165' + chr(0b1011001 + 0o33) + chr(0b1000011 + 0o43) + chr(737 - 692) + chr(56)), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(49), 8))
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd2D\x88,\xa0\xb7\xfeSgp'), '\144' + chr(0b1100101) + '\x63' + chr(0b1001001 + 0o46) + chr(100) + chr(101))('\165' + chr(0b1110100) + chr(4494 - 4392) + chr(1160 - 1115) + chr(56)))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xdeL\x9c,\xac\xae\xf2'), chr(100) + chr(0b1001001 + 0o34) + chr(0b110001 + 0o62) + chr(0b1101111) + chr(1595 - 1495) + chr(101))(chr(0b1110101) + chr(116) + chr(0b110001 + 0o65) + chr(0b101101) + '\070'), ehT0Px3KOsy9(chr(1789 - 1741) + chr(10500 - 10389) + '\062' + chr(0b11 + 0o55) + chr(0b110000) + chr(0b110000), 0o10))
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd2D\x88,\xa0\xb7\xfeSgp'), chr(0b1001010 + 0o32) + '\145' + '\143' + chr(0b111001 + 0o66) + chr(0b10101 + 0o117) + chr(0b100001 + 0o104))('\165' + chr(9755 - 9639) + chr(0b101100 + 0o72) + chr(1301 - 1256) + chr(2655 - 2599)))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xdaM\x8d\x14\xad\x98\xf6Ovhzz\x8a\xda\xdc\xe9'), '\x64' + chr(7668 - 7567) + chr(99) + chr(0b101001 + 0o106) + chr(0b110000 + 0o64) + chr(101))(chr(117) + chr(961 - 845) + chr(7427 - 7325) + chr(45) + chr(0b111000)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xdaM\x8d\x14\xad'), '\x64' + '\145' + chr(99) + chr(0b111011 + 0o64) + '\144' + chr(101))('\165' + chr(0b110110 + 0o76) + chr(9382 - 9280) + '\055' + chr(0b111000)))
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd2D\x88,\xa0\xb7\xfeSgp'), chr(0b111010 + 0o52) + '\145' + '\x63' + chr(111) + chr(9434 - 9334) + '\x65')('\x75' + chr(1678 - 1562) + chr(2765 - 2663) + chr(0b1101 + 0o40) + '\x38'))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xdaM\x8d\x14\xad\x98\xf2Nbxbz\x98\xcd'), '\144' + chr(4730 - 4629) + chr(6977 - 6878) + chr(0b1101111) + chr(0b1100100) + '\145')(chr(117) + chr(116) + '\x66' + chr(0b101101) + chr(56)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xc1E\x9f\x1d\xad\xb3\xc0W7B?\x10\xcc'), chr(0b1100100) + chr(0b1100101) + chr(99) + '\x6f' + chr(0b1100100) + chr(0b1100101))(chr(0b1101101 + 0o10) + chr(116) + chr(7831 - 7729) + chr(0b101101) + chr(2609 - 2553)))
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd2D\x88,\xa0\xb7\xfeSgp'), '\x64' + chr(7952 - 7851) + chr(99) + chr(111) + chr(0b1100100) + chr(101))(chr(2966 - 2849) + chr(7161 - 7045) + '\146' + chr(0b1110 + 0o37) + chr(56)))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xdaM\x8d\x14\xad\x98\xf9DgiQV\x97\xd9\xc9'), '\x64' + chr(0b1100101) + '\x63' + chr(6417 - 6306) + chr(0b1100100) + chr(101))(chr(9754 - 9637) + chr(0b1110100) + chr(0b110001 + 0o65) + chr(0b101000 + 0o5) + chr(0b111000)), ehT0Px3KOsy9(chr(48) + chr(7466 - 7355) + chr(0b110000 + 0o0), 8))
n4ljua2gi1Pr.LE5Fu6Tcl7nw = xafqLlk3kkUe(SXOLrMavuUCe(b'\xdfA\x95\x16\xba'), '\144' + chr(101) + chr(0b1100011) + chr(111) + chr(100) + '\145')(chr(0b1110101) + '\x74' + '\146' + '\x2d' + chr(56))
n4ljua2gi1Pr.WjY1aZ7lwLOu = xafqLlk3kkUe(SXOLrMavuUCe(b'\xdd'), '\x64' + chr(0b1100101) + '\143' + '\x6f' + chr(0b1100100) + '\145')(chr(0b1111 + 0o146) + '\x74' + chr(102) + chr(434 - 389) + chr(56))
n4ljua2gi1Pr.s6T_PoakASTI = xafqLlk3kkUe(SXOLrMavuUCe(b'\xd7A'), '\x64' + '\145' + chr(0b11011 + 0o110) + chr(0b1011111 + 0o20) + chr(0b100101 + 0o77) + chr(0b1100101))('\x75' + chr(116) + chr(102) + chr(956 - 911) + chr(0b111000))
n4ljua2gi1Pr.RW_xSzp18UeS = 0.3
n4ljua2gi1Pr.RdMRr3qkYioQ = 0.1
n4ljua2gi1Pr.PJc0PNdBnSag = 0.1
n4ljua2gi1Pr.l_vU2o7JF9Al = ehT0Px3KOsy9(chr(0b110000) + chr(0b1001000 + 0o47) + chr(52) + chr(0b11000 + 0o30) + chr(48) + chr(1436 - 1388), 0o10)
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd2D\x88,\xa0\xb7\xfeSgp'), '\x64' + chr(0b1100101) + '\x63' + chr(0b1101111) + '\144' + chr(0b1100101))('\165' + chr(544 - 428) + '\x66' + chr(325 - 280) + chr(0b11101 + 0o33)))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xddU\x81,\xad\xa9\xfcNbx|z\x92\xc2\xd5\xe9OR'), chr(0b1100100) + chr(101) + '\x63' + '\x6f' + chr(0b1011011 + 0o11) + chr(3220 - 3119))(chr(117) + chr(8777 - 8661) + chr(0b1100110) + '\055' + chr(266 - 210)), ehT0Px3KOsy9(chr(0b10111 + 0o31) + '\x6f' + chr(0b110001), 8))
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd2D\x88,\xa0\xb7\xfeSgp'), '\144' + '\145' + chr(0b1010011 + 0o20) + '\157' + chr(0b1011101 + 0o7) + '\145')(chr(3790 - 3673) + chr(2429 - 2313) + '\146' + chr(0b101101) + chr(56)))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xddU\x81,\xa0\xa2\xfeEu'), chr(0b111001 + 0o53) + '\145' + chr(0b1100011) + '\x6f' + chr(100) + chr(0b1100101))('\x75' + chr(10734 - 10618) + chr(8362 - 8260) + '\x2d' + '\x38'), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(453 - 404) + '\060', ord("\x08")))
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd2D\x88,\xa0\xb7\xfeSgp'), '\x64' + chr(0b1010011 + 0o22) + '\143' + '\157' + chr(0b1100100 + 0o0) + chr(101))(chr(0b110000 + 0o105) + '\x74' + chr(102) + chr(45) + '\070'))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xd2T\x98\x16\xa6\xb3\xf6NhBe@\x87\xfc\xcf\xe4\\O\xfbS\x0b&'), '\x64' + chr(835 - 734) + '\143' + '\157' + chr(9997 - 9897) + chr(9522 - 9421))('\165' + chr(0b1110100) + chr(0b100100 + 0o102) + '\055' + '\070'), ehT0Px3KOsy9(chr(48) + '\157' + chr(48), 8))
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd2D\x88,\xa0\xb7\xfeSgp'), '\144' + chr(0b110110 + 0o57) + '\x63' + chr(0b10001 + 0o136) + chr(100) + chr(101))(chr(0b1110101) + chr(116) + chr(0b1100110) + '\x2d' + chr(3125 - 3069)))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xd2T\x98\x16\xa6\xb3\xf6NhBxD\x92\xd6\xc9\xd3^I\xf4X\t0\xf1\x11'), chr(100) + chr(5154 - 5053) + chr(0b1100011) + '\157' + chr(0b1011101 + 0o7) + '\145')(chr(117) + chr(0b1110001 + 0o3) + chr(0b1100110) + '\x2d' + chr(0b111000)), ehT0Px3KOsy9('\060' + chr(6856 - 6745) + '\x30', 8))
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd2D\x88,\xa0\xb7\xfeSgp'), '\144' + '\145' + '\x63' + '\x6f' + '\x64' + chr(101))(chr(0b110 + 0o157) + chr(116) + chr(0b1100011 + 0o3) + chr(836 - 791) + chr(56)))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xdaM\x8d\x14\xad\x98\xf9HjikW\xa1\xd0\xc5\xf6X'), '\144' + chr(10007 - 9906) + chr(0b101 + 0o136) + '\157' + '\x64' + chr(0b1011101 + 0o10))(chr(0b1110101) + chr(0b1000010 + 0o62) + '\146' + '\x2d' + '\070'), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(50) + chr(726 - 678) + chr(638 - 590) + '\x30', 8))
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd2D\x88,\xa0\xb7\xfeSgp'), '\144' + chr(0b1010111 + 0o16) + chr(0b1100011) + chr(8855 - 8744) + '\x64' + '\145')(chr(0b1110010 + 0o3) + '\x74' + chr(154 - 52) + chr(0b101101 + 0o0) + chr(56)))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xc0E\x80\x15\x97\xa6\xebUcszL\x91\xcd\xf3\xf8DQ\xf0'), chr(100) + chr(0b1100101) + '\x63' + chr(11313 - 11202) + chr(100) + '\x65')(chr(117) + chr(0b1110100) + chr(0b1100110) + chr(45) + chr(1246 - 1190)), xafqLlk3kkUe(SXOLrMavuUCe(b'\xd7O\x98,\xb8\xb5\xf0Es~z'), chr(100) + chr(0b1011001 + 0o14) + '\x63' + chr(4432 - 4321) + chr(100) + '\145')('\x75' + '\x74' + '\146' + chr(45) + chr(350 - 294)))
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd2D\x88,\xa0\xb7\xfeSgp'), chr(100) + chr(0b111011 + 0o52) + '\x63' + chr(228 - 117) + chr(0b110110 + 0o56) + chr(0b1100101))(chr(117) + chr(9581 - 9465) + chr(3469 - 3367) + chr(45) + chr(56)))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xc0C\x8d\x1f\xad\x98\xfbNrm|J\x9a\xd6\xcf\xf8'), chr(0b1010110 + 0o16) + '\x65' + chr(2354 - 2255) + chr(0b0 + 0o157) + chr(3899 - 3799) + chr(6503 - 6402))(chr(0b1110101) + '\164' + '\x66' + chr(45) + chr(0b0 + 0o70)), ehT0Px3KOsy9('\x30' + chr(9893 - 9782) + '\061', 8))
return n4ljua2gi1Pr
|
tensorflow/tensor2tensor
|
tensor2tensor/models/research/vqa_attention.py
|
vqa_attention_base_range
|
def vqa_attention_base_range(rhp):
"""Small range of hyperparameters."""
# After starting from base, set intervals for some parameters.
rhp.set_float("learning_rate", 0.1, 1.0, scale=rhp.LOG_SCALE)
rhp.set_float("clip_grad_norm", 0.1, 10, scale=rhp.LOG_SCALE)
rhp.set_discrete("batch_size", [128, 256, 512, 1024])
rhp.set_float("weight_decay", 0.0, 1e-4)
rhp.set_categorical("rnn_type", ["lstm", "lstm_layernorm"])
|
python
|
def vqa_attention_base_range(rhp):
"""Small range of hyperparameters."""
# After starting from base, set intervals for some parameters.
rhp.set_float("learning_rate", 0.1, 1.0, scale=rhp.LOG_SCALE)
rhp.set_float("clip_grad_norm", 0.1, 10, scale=rhp.LOG_SCALE)
rhp.set_discrete("batch_size", [128, 256, 512, 1024])
rhp.set_float("weight_decay", 0.0, 1e-4)
rhp.set_categorical("rnn_type", ["lstm", "lstm_layernorm"])
|
[
"def",
"vqa_attention_base_range",
"(",
"rhp",
")",
":",
"# After starting from base, set intervals for some parameters.",
"rhp",
".",
"set_float",
"(",
"\"learning_rate\"",
",",
"0.1",
",",
"1.0",
",",
"scale",
"=",
"rhp",
".",
"LOG_SCALE",
")",
"rhp",
".",
"set_float",
"(",
"\"clip_grad_norm\"",
",",
"0.1",
",",
"10",
",",
"scale",
"=",
"rhp",
".",
"LOG_SCALE",
")",
"rhp",
".",
"set_discrete",
"(",
"\"batch_size\"",
",",
"[",
"128",
",",
"256",
",",
"512",
",",
"1024",
"]",
")",
"rhp",
".",
"set_float",
"(",
"\"weight_decay\"",
",",
"0.0",
",",
"1e-4",
")",
"rhp",
".",
"set_categorical",
"(",
"\"rnn_type\"",
",",
"[",
"\"lstm\"",
",",
"\"lstm_layernorm\"",
"]",
")"
] |
Small range of hyperparameters.
|
[
"Small",
"range",
"of",
"hyperparameters",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/models/research/vqa_attention.py#L580-L587
|
train
|
Small range of hyperparameters for attention base.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7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qw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\x30' + chr(10410 - 10299) + chr(1735 - 1686) + '\060' + chr(0b0 + 0o60), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110011) + chr(0b1010 + 0o46) + chr(54), 18691 - 18683), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b11111 + 0o23) + chr(1215 - 1162) + chr(0b10100 + 0o43), 15666 - 15658), ehT0Px3KOsy9('\060' + chr(0b1000011 + 0o54) + chr(0b110111) + chr(51), 0o10), ehT0Px3KOsy9(chr(857 - 809) + '\x6f' + chr(50) + chr(1193 - 1140) + chr(49), 17878 - 17870), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x31' + '\060' + '\x36', 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + '\x33' + '\066' + chr(1544 - 1495), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(51) + '\062' + '\x30', 0o10), ehT0Px3KOsy9('\060' + '\157' + '\x36' + chr(0b110101), 39898 - 39890), ehT0Px3KOsy9('\x30' + chr(111) + '\x31' + '\x37', 0b1000), ehT0Px3KOsy9('\x30' + chr(6525 - 6414) + chr(0b10 + 0o63) + chr(0b11011 + 0o30), 36363 - 36355), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x32' + '\x30' + '\065', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(50) + chr(661 - 609) + '\x30', 36631 - 36623), ehT0Px3KOsy9(chr(1863 - 1815) + chr(0b1101111) + '\x32' + '\x35' + chr(49), 8), ehT0Px3KOsy9(chr(0b110 + 0o52) + '\157' + '\x32' + chr(2432 - 2377) + chr(0b110111), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + '\063' + '\x31', 0o10), ehT0Px3KOsy9(chr(1926 - 1878) + '\157' + '\x31' + chr(0b110001) + '\x37', 0o10), ehT0Px3KOsy9(chr(1813 - 1765) + '\x6f' + chr(50) + chr(0b10100 + 0o34), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110001) + chr(0b1110 + 0o47) + '\x36', 0o10), ehT0Px3KOsy9(chr(0b100111 + 0o11) + '\157' + chr(0b110011) + '\065' + '\x32', ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b10111 + 0o32) + chr(53) + '\061', 0o10), ehT0Px3KOsy9(chr(48) + chr(7350 - 7239) + chr(0b1111 + 0o43) + '\060' + '\066', 42671 - 42663), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x31' + '\060' + chr(0b110100), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(50) + chr(53) + '\065', 0b1000), ehT0Px3KOsy9(chr(0b10100 + 0o34) + '\x6f' + chr(1054 - 1004) + chr(0b110110), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(50) + '\066' + '\x35', 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110011) + chr(49) + chr(0b110101), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(51) + chr(0b10110 + 0o40) + chr(0b110001), 8), ehT0Px3KOsy9(chr(0b11011 + 0o25) + chr(0b1101111) + '\x31' + chr(0b110110) + '\060', 0o10), ehT0Px3KOsy9(chr(988 - 940) + chr(3467 - 3356) + '\x32' + chr(0b101101 + 0o11) + chr(0b1 + 0o63), ord("\x08")), ehT0Px3KOsy9(chr(0b1110 + 0o42) + chr(0b11011 + 0o124) + chr(0b101100 + 0o5) + chr(0b1000 + 0o54) + chr(87 - 38), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + '\x35' + '\x31', 42259 - 42251), ehT0Px3KOsy9('\x30' + chr(111) + '\x37' + chr(0b110110), 9526 - 9518), ehT0Px3KOsy9(chr(0b1000 + 0o50) + chr(111) + chr(1564 - 1513) + '\064', 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110001) + '\066', ord("\x08")), ehT0Px3KOsy9(chr(0b10111 + 0o31) + '\x6f' + chr(0b101010 + 0o10) + '\066', 8), ehT0Px3KOsy9(chr(2115 - 2067) + chr(0b1101111) + chr(0b110011) + '\x36' + chr(52), 11493 - 11485), ehT0Px3KOsy9(chr(48) + chr(0b1011010 + 0o25) + chr(49) + chr(0b110011) + '\x37', 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(0b10111 + 0o37) + '\x33', 22722 - 22714), ehT0Px3KOsy9(chr(0b110000 + 0o0) + '\157' + chr(50) + '\x35' + '\064', 25486 - 25478)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b1111 + 0o46) + chr(0b11111 + 0o21), 4390 - 4382)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'n'), chr(100) + '\145' + chr(99) + '\157' + chr(8829 - 8729) + '\x65')(chr(2013 - 1896) + '\x74' + chr(0b1100110) + '\x2d' + chr(2884 - 2828)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def Ca3Ak2blzOsz(IwsgmEzQknPc):
xafqLlk3kkUe(IwsgmEzQknPc, xafqLlk3kkUe(SXOLrMavuUCe(b'3\xa3\xdbd\xcf*\x9e\xb1A'), chr(8583 - 8483) + '\145' + '\x63' + chr(0b11111 + 0o120) + '\144' + '\145')(chr(11714 - 11597) + '\x74' + chr(8029 - 7927) + chr(0b101101) + chr(56)))(xafqLlk3kkUe(SXOLrMavuUCe(b',\xa3\xceI\xc7/\x9f\xb7j}J\xf1\xc5'), chr(100) + '\145' + chr(4966 - 4867) + chr(111) + chr(100) + chr(0b1100101))('\x75' + '\x74' + chr(102) + chr(0b10111 + 0o26) + chr(0b10011 + 0o45)), 0.1, 1.0, scale=xafqLlk3kkUe(IwsgmEzQknPc, xafqLlk3kkUe(SXOLrMavuUCe(b'\x0c\x89\xe8d\xfa\x05\xb0\x9cp'), chr(5063 - 4963) + chr(0b1100101) + chr(7730 - 7631) + '\x6f' + chr(100) + chr(101))('\165' + '\164' + '\x66' + chr(0b1100 + 0o41) + chr(56))))
xafqLlk3kkUe(IwsgmEzQknPc, xafqLlk3kkUe(SXOLrMavuUCe(b'3\xa3\xdbd\xcf*\x9e\xb1A'), chr(100) + chr(884 - 783) + chr(0b111110 + 0o45) + '\x6f' + chr(0b1100100) + '\145')(chr(0b1110101) + '\x74' + chr(10212 - 10110) + '\x2d' + '\x38'))(xafqLlk3kkUe(SXOLrMavuUCe(b'#\xaa\xc6K\xf6!\x83\xb1QPE\xea\xd2\xc4'), chr(1714 - 1614) + '\145' + '\143' + chr(0b1101111) + '\144' + chr(5905 - 5804))(chr(2808 - 2691) + '\x74' + chr(0b101 + 0o141) + chr(0b101101) + '\x38'), 0.1, ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110001) + '\x32', 25164 - 25156), scale=xafqLlk3kkUe(IwsgmEzQknPc, xafqLlk3kkUe(SXOLrMavuUCe(b'\x0c\x89\xe8d\xfa\x05\xb0\x9cp'), chr(3988 - 3888) + chr(0b1010110 + 0o17) + chr(99) + chr(111) + '\x64' + chr(4235 - 4134))(chr(0b1110101) + chr(440 - 324) + '\x66' + chr(0b101101) + '\x38')))
xafqLlk3kkUe(IwsgmEzQknPc, xafqLlk3kkUe(SXOLrMavuUCe(b'3\xa3\xdbd\xcd/\x82\xb3Gj_\xe0'), '\x64' + chr(0b1100101) + '\143' + chr(0b1101111) + chr(0b1100100) + chr(0b1100101))(chr(0b1011010 + 0o33) + chr(836 - 720) + '\x66' + chr(1982 - 1937) + chr(0b111000)))(xafqLlk3kkUe(SXOLrMavuUCe(b'"\xa7\xdbX\xc1\x19\x82\xb9Oj'), chr(1459 - 1359) + chr(0b111111 + 0o46) + chr(0b1100011) + chr(5313 - 5202) + chr(7655 - 7555) + chr(0b1010101 + 0o20))(chr(0b1110101) + chr(0b1110100) + chr(102) + chr(45) + '\070'), [ehT0Px3KOsy9('\060' + chr(111) + '\062' + chr(0b1110 + 0o42) + '\x30', ord("\x08")), ehT0Px3KOsy9(chr(0b110000 + 0o0) + chr(8255 - 8144) + chr(0b110011 + 0o1) + chr(0b101111 + 0o1) + chr(0b100001 + 0o17), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b10011 + 0o36) + chr(48) + chr(0b110000) + '\060', 0b1000), ehT0Px3KOsy9(chr(1118 - 1070) + '\157' + '\062' + chr(0b110000) + '\x30' + chr(1032 - 984), ord("\x08"))])
xafqLlk3kkUe(IwsgmEzQknPc, xafqLlk3kkUe(SXOLrMavuUCe(b'3\xa3\xdbd\xcf*\x9e\xb1A'), '\144' + chr(0b10111 + 0o116) + '\x63' + '\x6f' + chr(0b1100100) + '\x65')('\165' + chr(116) + chr(0b1100110) + chr(1748 - 1703) + chr(422 - 366)))(xafqLlk3kkUe(SXOLrMavuUCe(b'7\xa3\xc6\\\xc12\xae\xb4PlJ\xfc'), chr(4291 - 4191) + '\x65' + chr(1398 - 1299) + '\x6f' + '\x64' + chr(101))(chr(0b1110101) + chr(116) + chr(976 - 874) + '\055' + chr(0b111000)), 0.0, 0.0001)
xafqLlk3kkUe(IwsgmEzQknPc, xafqLlk3kkUe(SXOLrMavuUCe(b"3\xa3\xdbd\xca'\x85\xb5R`Y\xec\xc3\xc8\xd3"), chr(0b1100100) + chr(0b1100101) + chr(99) + chr(111) + chr(100) + '\x65')(chr(4378 - 4261) + chr(0b1110100) + chr(5705 - 5603) + '\x2d' + '\070'))(xafqLlk3kkUe(SXOLrMavuUCe(b'2\xa8\xc1d\xdd?\x81\xb5'), chr(0b100010 + 0o102) + '\145' + chr(4729 - 4630) + '\157' + chr(0b1 + 0o143) + chr(101))('\x75' + '\x74' + chr(2505 - 2403) + chr(0b101101) + '\x38'), [xafqLlk3kkUe(SXOLrMavuUCe(b',\xb5\xdbV'), chr(100) + '\x65' + '\143' + chr(0b1011011 + 0o24) + chr(100) + chr(0b1001001 + 0o34))(chr(0b1110101) + chr(0b1110100) + '\146' + chr(45) + chr(0b111000)), xafqLlk3kkUe(SXOLrMavuUCe(b',\xb5\xdbV\xf6*\x90\xa9P}E\xea\xd2\xc4'), '\x64' + chr(101) + chr(5155 - 5056) + chr(0b1101111) + '\144' + chr(0b110111 + 0o56))('\165' + chr(116) + chr(9179 - 9077) + '\055' + chr(0b1001 + 0o57))])
|
tensorflow/tensor2tensor
|
tensor2tensor/trax/history.py
|
History.append
|
def append(self, mode, metric, step, value):
"""Append (step, value) pair to history for the given mode and metric."""
if mode not in self._values:
self._values[mode] = collections.defaultdict(list)
self._values[mode][metric].append((step, value))
|
python
|
def append(self, mode, metric, step, value):
"""Append (step, value) pair to history for the given mode and metric."""
if mode not in self._values:
self._values[mode] = collections.defaultdict(list)
self._values[mode][metric].append((step, value))
|
[
"def",
"append",
"(",
"self",
",",
"mode",
",",
"metric",
",",
"step",
",",
"value",
")",
":",
"if",
"mode",
"not",
"in",
"self",
".",
"_values",
":",
"self",
".",
"_values",
"[",
"mode",
"]",
"=",
"collections",
".",
"defaultdict",
"(",
"list",
")",
"self",
".",
"_values",
"[",
"mode",
"]",
"[",
"metric",
"]",
".",
"append",
"(",
"(",
"step",
",",
"value",
")",
")"
] |
Append (step, value) pair to history for the given mode and metric.
|
[
"Append",
"(",
"step",
"value",
")",
"pair",
"to",
"history",
"for",
"the",
"given",
"mode",
"and",
"metric",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/trax/history.py#L52-L56
|
train
|
Append a pair to the history for the given mode and metric.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYic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TYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + chr(11826 - 11715) + chr(2399 - 2348) + chr(0b11010 + 0o26) + chr(0b11 + 0o63), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(49) + '\x30' + '\067', 0b1000), ehT0Px3KOsy9(chr(1744 - 1696) + '\x6f' + chr(50) + chr(0b110100 + 0o0) + chr(50), 19622 - 19614), ehT0Px3KOsy9(chr(0b1011 + 0o45) + chr(0b1011001 + 0o26) + chr(0b110 + 0o54) + chr(50) + chr(0b11010 + 0o34), 32224 - 32216), ehT0Px3KOsy9(chr(0b110000) + chr(2938 - 2827) + '\x34', 0o10), ehT0Px3KOsy9(chr(0b101010 + 0o6) + chr(111) + chr(1032 - 982) + chr(763 - 713) + chr(0b101100 + 0o7), 0b1000), ehT0Px3KOsy9(chr(0b101010 + 0o6) + chr(0b1000110 + 0o51) + chr(766 - 711) + '\x32', 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + '\x33' + chr(0b110101) + '\060', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(1223 - 1174) + '\066' + chr(0b110110), 0b1000), ehT0Px3KOsy9(chr(0b100111 + 0o11) + '\157' + chr(0b110010) + chr(1954 - 1904) + '\061', 42938 - 42930), ehT0Px3KOsy9(chr(2207 - 2159) + chr(0b1001111 + 0o40) + '\x32' + chr(0b101000 + 0o12) + chr(49), 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b1010 + 0o145) + '\x31' + chr(0b100011 + 0o16) + chr(533 - 479), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b101111 + 0o3) + chr(924 - 872) + chr(0b110011), 21480 - 21472), ehT0Px3KOsy9(chr(154 - 106) + chr(0b1101111) + chr(0b100111 + 0o14) + chr(55) + '\x31', 41383 - 41375), ehT0Px3KOsy9('\060' + chr(111) + '\x33' + chr(51) + chr(50), ord("\x08")), ehT0Px3KOsy9('\060' + chr(6543 - 6432) + '\x31' + chr(53) + chr(0b110000), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b10101 + 0o36) + chr(51) + chr(1328 - 1280), 51388 - 51380), ehT0Px3KOsy9(chr(647 - 599) + '\x6f' + chr(1807 - 1755) + '\x31', 0b1000), ehT0Px3KOsy9(chr(0b1111 + 0o41) + chr(111) + chr(0b110011) + chr(1096 - 1044) + chr(0b110101), 7917 - 7909), ehT0Px3KOsy9(chr(0b110 + 0o52) + chr(0b1101111) + chr(500 - 450) + chr(2518 - 2463) + chr(0b101101 + 0o7), 15797 - 15789), ehT0Px3KOsy9(chr(0b11000 + 0o30) + chr(9680 - 9569) + '\x33' + chr(0b110011) + chr(371 - 317), ord("\x08")), ehT0Px3KOsy9(chr(0b11000 + 0o30) + chr(111) + '\067' + '\x37', 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(51) + chr(55), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110010) + chr(50) + '\x33', 8), ehT0Px3KOsy9(chr(0b11101 + 0o23) + chr(0b1101101 + 0o2) + '\x33' + chr(1911 - 1856) + '\062', 26495 - 26487), ehT0Px3KOsy9('\060' + chr(111) + chr(1511 - 1462) + '\x32' + chr(52), 30106 - 30098), ehT0Px3KOsy9(chr(0b110000) + chr(0b111 + 0o150) + chr(51) + chr(0b110011) + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + '\063' + chr(0b11 + 0o61) + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b10011 + 0o134) + chr(0b110001) + '\x32' + '\x36', 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(1033 - 983) + chr(2463 - 2409) + '\x35', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b111100 + 0o63) + chr(0b110 + 0o56) + chr(1945 - 1891), ord("\x08")), ehT0Px3KOsy9('\060' + chr(886 - 775) + chr(49) + chr(0b110100) + chr(0b110011), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(0b100001 + 0o20) + chr(2365 - 2312) + chr(48), 8), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b1001 + 0o51) + chr(0b100001 + 0o25) + chr(0b11011 + 0o27), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1000101 + 0o52) + '\x35' + chr(2248 - 2199), 8898 - 8890), ehT0Px3KOsy9('\x30' + '\x6f' + '\x34' + chr(641 - 587), 8), ehT0Px3KOsy9(chr(0b101010 + 0o6) + chr(0b101111 + 0o100) + '\062' + '\064' + '\x31', 18239 - 18231), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x31' + chr(527 - 475) + '\x37', 0b1000), ehT0Px3KOsy9('\060' + chr(3605 - 3494) + chr(0b110001) + chr(2303 - 2249) + chr(0b101010 + 0o13), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + '\062' + '\067' + chr(0b101101 + 0o6), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(1724 - 1676) + '\x6f' + chr(0b110101) + '\060', 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xe8'), '\x64' + '\x65' + chr(99) + chr(7266 - 7155) + chr(0b1100100) + '\x65')(chr(0b1110101) + '\164' + '\146' + '\x2d' + chr(0b1010 + 0o56)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def Vc0BXDjywSoI(oVre8I6UXc3b, holLFgwB7vsP, UyTbk4dY9zDl, kDuFsAhEatcU, QmmgWUB13VCJ):
if holLFgwB7vsP not in xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x991\xc3\xfaq\xf6I'), chr(0b10001 + 0o123) + chr(0b10010 + 0o123) + chr(6563 - 6464) + chr(4598 - 4487) + '\144' + chr(0b1000100 + 0o41))(chr(0b1110101) + '\164' + chr(102) + chr(0b1110 + 0o37) + chr(56))):
oVre8I6UXc3b.mWFvCGje9Um7[holLFgwB7vsP] = FGhnnwoh1Dd8.defaultdict(YyaZ4tpXu4lf)
xafqLlk3kkUe(oVre8I6UXc3b._values[holLFgwB7vsP][UyTbk4dY9zDl], xafqLlk3kkUe(SXOLrMavuUCe(b'\xa77\xd2\xf3j\xf7'), chr(0b10111 + 0o115) + chr(0b1100101) + chr(99) + chr(111) + chr(0b1100100) + chr(101))(chr(117) + chr(3754 - 3638) + chr(102) + chr(1369 - 1324) + chr(2165 - 2109)))((kDuFsAhEatcU, QmmgWUB13VCJ))
|
tensorflow/tensor2tensor
|
tensor2tensor/trax/history.py
|
History.get
|
def get(self, mode, metric):
"""Get the history for the given metric and mode."""
if mode not in self._values:
logging.info("Metric %s not found for mode %s", metric, mode)
return []
return list(self._values[mode][metric])
|
python
|
def get(self, mode, metric):
"""Get the history for the given metric and mode."""
if mode not in self._values:
logging.info("Metric %s not found for mode %s", metric, mode)
return []
return list(self._values[mode][metric])
|
[
"def",
"get",
"(",
"self",
",",
"mode",
",",
"metric",
")",
":",
"if",
"mode",
"not",
"in",
"self",
".",
"_values",
":",
"logging",
".",
"info",
"(",
"\"Metric %s not found for mode %s\"",
",",
"metric",
",",
"mode",
")",
"return",
"[",
"]",
"return",
"list",
"(",
"self",
".",
"_values",
"[",
"mode",
"]",
"[",
"metric",
"]",
")"
] |
Get the history for the given metric and mode.
|
[
"Get",
"the",
"history",
"for",
"the",
"given",
"metric",
"and",
"mode",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/trax/history.py#L58-L63
|
train
|
Get the history for the given metric and mode.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDASQ0Qkq,NL8dtWOpbcjF,_bikzMuRfbJG,sznFqDbNBHlx,ZsDPvpP4x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6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\060' + chr(0b1101111) + '\062' + chr(1724 - 1674), ord("\x08")), ehT0Px3KOsy9(chr(1633 - 1585) + chr(0b1101111) + chr(49) + chr(587 - 539) + '\067', 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(54) + '\x37', 55707 - 55699), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110100) + '\x36', 19442 - 19434), ehT0Px3KOsy9(chr(1962 - 1914) + '\157' + '\x33' + '\x30' + chr(0b1110 + 0o50), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(51) + chr(0b110111) + '\x31', 9534 - 9526), ehT0Px3KOsy9('\060' + chr(0b1 + 0o156) + chr(0b110 + 0o54) + '\x31' + chr(0b110110), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b110011 + 0o74) + '\x31' + chr(54) + chr(0b110001), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(6884 - 6773) + chr(0b10011 + 0o37) + chr(55) + '\x36', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\061' + chr(1587 - 1539) + chr(52), 0b1000), ehT0Px3KOsy9('\060' + '\157' + '\x32' + chr(48) + '\062', 47060 - 47052), ehT0Px3KOsy9('\x30' + chr(111) + '\064' + chr(0b10101 + 0o34), 31719 - 31711), ehT0Px3KOsy9('\060' + '\x6f' + '\x31' + chr(0b100111 + 0o14) + '\066', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(2259 - 2148) + chr(800 - 750) + chr(52) + '\x35', 0b1000), ehT0Px3KOsy9(chr(151 - 103) + '\157' + chr(0b1100 + 0o45) + chr(0b100010 + 0o21) + chr(53), 2770 - 2762), ehT0Px3KOsy9(chr(48) + '\x6f' + '\065' + '\x33', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(51) + chr(0b11011 + 0o26), 0b1000), ehT0Px3KOsy9(chr(48) + chr(1308 - 1197) + chr(0b100 + 0o55) + '\x32', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b100111 + 0o14) + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(818 - 770) + '\x6f' + '\x33' + '\063' + chr(0b110101), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + '\x31' + chr(0b110111) + chr(1370 - 1318), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(771 - 721) + chr(0b110101) + chr(0b101 + 0o60), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x37' + chr(55), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(1172 - 1123) + chr(0b110001 + 0o4) + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(0b1110 + 0o42) + chr(0b1001110 + 0o41) + chr(1037 - 988) + '\x33' + chr(0b10001 + 0o44), 8), ehT0Px3KOsy9(chr(48) + '\157' + chr(2299 - 2249) + chr(52) + '\063', ord("\x08")), ehT0Px3KOsy9(chr(0b10101 + 0o33) + chr(0b1101111) + chr(0b101111 + 0o5) + chr(0b100 + 0o63), 26010 - 26002), ehT0Px3KOsy9(chr(48) + chr(0b110 + 0o151) + chr(50) + '\x31' + '\x35', 8455 - 8447), ehT0Px3KOsy9('\060' + chr(3474 - 3363) + chr(0b110100) + chr(0b110101), ord("\x08")), ehT0Px3KOsy9(chr(594 - 546) + '\157' + '\x36', 6496 - 6488), ehT0Px3KOsy9(chr(1669 - 1621) + '\x6f' + chr(0b1101 + 0o46) + '\063' + '\062', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b101100 + 0o103) + chr(0b1011 + 0o47) + chr(0b110101) + chr(757 - 705), 13356 - 13348), ehT0Px3KOsy9(chr(48) + chr(3365 - 3254) + chr(50) + '\060' + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(5360 - 5249) + chr(0b11000 + 0o31) + chr(1457 - 1402) + chr(759 - 704), 41375 - 41367), ehT0Px3KOsy9(chr(0b10001 + 0o37) + '\x6f' + '\x34' + chr(0b110110), 8), ehT0Px3KOsy9('\060' + '\157' + chr(53) + '\x35', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110001) + chr(71 - 17) + chr(426 - 375), ord("\x08")), ehT0Px3KOsy9(chr(1131 - 1083) + '\157' + chr(0b10 + 0o60) + chr(0b110110) + chr(1167 - 1117), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110011) + '\x35' + chr(0b101101 + 0o3), 0o10), ehT0Px3KOsy9(chr(0b0 + 0o60) + chr(111) + '\x31' + chr(0b11111 + 0o30) + '\066', 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(1626 - 1578) + chr(111) + chr(53) + chr(48), ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'<'), '\144' + chr(0b100000 + 0o105) + '\143' + chr(0b1101111) + chr(0b1010010 + 0o22) + chr(0b100000 + 0o105))(chr(5526 - 5409) + chr(0b1101001 + 0o13) + '\x66' + chr(0b101101) + chr(0b100100 + 0o24)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def Q8b5UytA0vqH(oVre8I6UXc3b, holLFgwB7vsP, UyTbk4dY9zDl):
if holLFgwB7vsP not in xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x7f\x10qP\x85\xbe\xe4\x14\x87\x11\xef\x16'), '\144' + chr(3237 - 3136) + chr(4985 - 4886) + chr(111) + chr(4702 - 4602) + chr(156 - 55))(chr(0b1101000 + 0o15) + chr(0b101000 + 0o114) + '\146' + chr(0b10001 + 0o34) + '\070')):
xafqLlk3kkUe(UeotCCWOPSQS, xafqLlk3kkUe(SXOLrMavuUCe(b'Ap\x7f^\xb3\x9a\xe9F\xd4(\xd8J'), chr(0b1100100) + chr(101) + '\x63' + chr(111) + chr(0b1100100) + chr(0b110011 + 0o62))('\165' + '\x74' + chr(8149 - 8047) + '\x2d' + chr(1381 - 1325)))(xafqLlk3kkUe(SXOLrMavuUCe(b'_"CT\xaf\x9a\xaeT\xcdd\xecN*\x85;Dld|\xfd\x1a\xc2ML0\xccC\xe8\x05#\xa9'), chr(0b1100100) + chr(5792 - 5691) + chr(0b1100011) + chr(0b111010 + 0o65) + chr(0b1111 + 0o125) + chr(0b1001011 + 0o32))('\x75' + chr(9441 - 9325) + chr(0b1100110) + chr(727 - 682) + chr(0b111000)), UyTbk4dY9zDl, holLFgwB7vsP)
return []
return YyaZ4tpXu4lf(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x7f\x10qP\x85\xbe\xe4\x14\x87\x11\xef\x16'), chr(0b1100100) + '\x65' + chr(0b1010001 + 0o22) + chr(0b1101111) + '\144' + chr(10094 - 9993))('\x75' + chr(116) + '\146' + chr(858 - 813) + '\070'))[holLFgwB7vsP][UyTbk4dY9zDl])
|
tensorflow/tensor2tensor
|
tensor2tensor/trax/history.py
|
History.metrics_for_mode
|
def metrics_for_mode(self, mode):
"""Metrics available for a given mode."""
if mode not in self._values:
logging.info("Mode %s not found", mode)
return []
return sorted(list(self._values[mode].keys()))
|
python
|
def metrics_for_mode(self, mode):
"""Metrics available for a given mode."""
if mode not in self._values:
logging.info("Mode %s not found", mode)
return []
return sorted(list(self._values[mode].keys()))
|
[
"def",
"metrics_for_mode",
"(",
"self",
",",
"mode",
")",
":",
"if",
"mode",
"not",
"in",
"self",
".",
"_values",
":",
"logging",
".",
"info",
"(",
"\"Mode %s not found\"",
",",
"mode",
")",
"return",
"[",
"]",
"return",
"sorted",
"(",
"list",
"(",
"self",
".",
"_values",
"[",
"mode",
"]",
".",
"keys",
"(",
")",
")",
")"
] |
Metrics available for a given mode.
|
[
"Metrics",
"available",
"for",
"a",
"given",
"mode",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/trax/history.py#L70-L75
|
train
|
Returns a list of metrics available for a given mode.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDASQ0Qkq,NL8dtWOpbcjF,_bikzMuRfbJG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hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(1621 - 1573) + chr(0b1101111) + '\x32' + chr(1816 - 1762) + chr(0b10101 + 0o41), 0o10), ehT0Px3KOsy9(chr(2169 - 2121) + '\157' + '\x31' + chr(710 - 660) + chr(0b110001), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110011) + '\060' + chr(0b110001), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x33' + '\x35' + '\x31', 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(0b101110 + 0o4) + '\x37' + chr(2127 - 2077), 0b1000), ehT0Px3KOsy9(chr(216 - 168) + '\157' + chr(804 - 753) + chr(1529 - 1479) + '\067', 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + '\062' + chr(2724 - 2671) + '\x36', 64515 - 64507), ehT0Px3KOsy9(chr(48) + '\157' + chr(500 - 450) + chr(50) + '\x30', 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(0b1101 + 0o44) + chr(0b10111 + 0o40) + chr(1539 - 1491), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(753 - 704) + '\x36' + chr(54), ord("\x08")), ehT0Px3KOsy9(chr(329 - 281) + '\x6f' + chr(280 - 229) + chr(48), 0b1000), ehT0Px3KOsy9(chr(1450 - 1402) + '\x6f' + chr(0b101101 + 0o6) + chr(0b11011 + 0o25) + '\064', ord("\x08")), ehT0Px3KOsy9(chr(0b1001 + 0o47) + chr(0b1010111 + 0o30) + chr(0b101010 + 0o11) + chr(0b110101) + chr(0b101010 + 0o13), 0b1000), ehT0Px3KOsy9('\060' + chr(0b110111 + 0o70) + chr(0b11111 + 0o24) + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b100100 + 0o113) + '\x33' + chr(0b100100 + 0o17) + chr(0b110100), 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(0b110010) + chr(0b110101) + chr(51), 19278 - 19270), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(51) + chr(529 - 476) + chr(633 - 581), ord("\x08")), ehT0Px3KOsy9(chr(1241 - 1193) + chr(111) + chr(0b110001) + chr(50) + chr(0b101010 + 0o11), 0b1000), ehT0Px3KOsy9('\060' + chr(5622 - 5511) + chr(1089 - 1039) + chr(515 - 466) + chr(54), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(49) + chr(1463 - 1409) + '\061', ord("\x08")), ehT0Px3KOsy9(chr(0b1 + 0o57) + chr(1446 - 1335) + chr(0b110011) + chr(50) + '\x30', ord("\x08")), ehT0Px3KOsy9(chr(0b1110 + 0o42) + chr(0b1101111) + chr(49) + chr(1616 - 1565) + chr(2572 - 2518), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(7623 - 7512) + chr(50) + chr(0b110110) + chr(0b101100 + 0o7), 0b1000), ehT0Px3KOsy9(chr(2077 - 2029) + chr(111) + '\x32' + chr(0b1101 + 0o45) + chr(0b101000 + 0o16), 0b1000), ehT0Px3KOsy9(chr(370 - 322) + chr(111) + chr(0b10 + 0o57) + '\x36' + chr(0b1000 + 0o54), 55204 - 55196), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110000 + 0o1) + '\x30' + '\x32', 0o10), ehT0Px3KOsy9(chr(0b100110 + 0o12) + '\157' + '\062' + '\x34', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(49) + chr(55), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110011) + chr(51) + chr(54), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + '\063' + chr(553 - 505), 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b110111 + 0o70) + chr(54) + chr(0b110100), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(51) + '\065' + chr(52), 8), ehT0Px3KOsy9(chr(0b100010 + 0o16) + chr(111) + chr(0b110001 + 0o0) + chr(0b110010 + 0o5) + chr(53), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b100110 + 0o111) + chr(2669 - 2617) + chr(52), ord("\x08")), ehT0Px3KOsy9(chr(1131 - 1083) + '\x6f' + chr(1219 - 1167) + chr(53), 0o10), ehT0Px3KOsy9(chr(0b100100 + 0o14) + '\x6f' + chr(649 - 600) + chr(0b110000), 0o10), ehT0Px3KOsy9(chr(859 - 811) + '\157' + '\x31' + chr(0b101100 + 0o6) + chr(0b1011 + 0o46), 8), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b101101 + 0o6) + chr(1815 - 1763), 29023 - 29015), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(51) + chr(1812 - 1757) + chr(2280 - 2231), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(50), ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + chr(0b1101110 + 0o1) + chr(2732 - 2679) + chr(48), ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x98'), chr(100) + '\x65' + chr(99) + '\157' + '\x64' + chr(0b1100101))('\x75' + chr(0b1000110 + 0o56) + chr(102) + chr(521 - 476) + '\070') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def dXKDgEP8Fkv3(oVre8I6UXc3b, holLFgwB7vsP):
if holLFgwB7vsP not in xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xdb\x06\x87\x9f\xf9\x90\xc4\xf5A#u\xf3'), chr(0b1000100 + 0o40) + chr(101) + chr(0b10 + 0o141) + chr(11853 - 11742) + chr(5330 - 5230) + chr(4327 - 4226))('\165' + chr(6788 - 6672) + '\146' + '\x2d' + chr(2392 - 2336))):
xafqLlk3kkUe(UeotCCWOPSQS, xafqLlk3kkUe(SXOLrMavuUCe(b'\xe5f\x89\x91\xcf\xb4\xc9\xa7\x12\x1aB\xaf'), chr(0b1001011 + 0o31) + chr(0b10011 + 0o122) + '\x63' + chr(0b1000110 + 0o51) + '\144' + '\x65')('\x75' + '\164' + '\146' + chr(45) + '\x38'))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xfb>\xa5\x8c\x9a\xf2\xdd\xb0\x16\x19l\xe4\x8br\xa9\xc5\x88'), chr(3894 - 3794) + chr(0b1010011 + 0o22) + chr(0b1100011) + chr(0b1000101 + 0o52) + chr(9777 - 9677) + chr(0b1100101))(chr(0b100000 + 0o125) + chr(0b111010 + 0o72) + '\x66' + chr(45) + chr(0b111000)), holLFgwB7vsP)
return []
return vUlqIvNSaRMa(YyaZ4tpXu4lf(xafqLlk3kkUe(oVre8I6UXc3b._values[holLFgwB7vsP], xafqLlk3kkUe(SXOLrMavuUCe(b'\xdd4\xb8\x9a'), chr(0b111101 + 0o47) + '\145' + chr(99) + chr(7882 - 7771) + '\x64' + '\x65')(chr(10112 - 9995) + chr(641 - 525) + '\x66' + chr(0b100000 + 0o15) + '\070'))()))
|
tensorflow/tensor2tensor
|
tensor2tensor/models/resnet.py
|
batch_norm_relu
|
def batch_norm_relu(inputs,
is_training,
relu=True,
init_zero=False,
data_format="channels_first"):
"""Performs a batch normalization followed by a ReLU.
Args:
inputs: `Tensor` of shape `[batch, channels, ...]`.
is_training: `bool` for whether the model is training.
relu: `bool` if False, omits the ReLU operation.
init_zero: `bool` if True, initializes scale parameter of batch
normalization with 0 instead of 1 (default).
data_format: `str` either "channels_first" for `[batch, channels, height,
width]` or "channels_last for `[batch, height, width, channels]`.
Returns:
A normalized `Tensor` with the same `data_format`.
"""
if init_zero:
gamma_initializer = tf.zeros_initializer()
else:
gamma_initializer = tf.ones_initializer()
if data_format == "channels_first":
axis = 1
else:
axis = 3
inputs = layers().BatchNormalization(
axis=axis,
momentum=BATCH_NORM_DECAY,
epsilon=BATCH_NORM_EPSILON,
center=True,
scale=True,
fused=True,
gamma_initializer=gamma_initializer)(inputs, training=is_training)
if relu:
inputs = tf.nn.relu(inputs)
return inputs
|
python
|
def batch_norm_relu(inputs,
is_training,
relu=True,
init_zero=False,
data_format="channels_first"):
"""Performs a batch normalization followed by a ReLU.
Args:
inputs: `Tensor` of shape `[batch, channels, ...]`.
is_training: `bool` for whether the model is training.
relu: `bool` if False, omits the ReLU operation.
init_zero: `bool` if True, initializes scale parameter of batch
normalization with 0 instead of 1 (default).
data_format: `str` either "channels_first" for `[batch, channels, height,
width]` or "channels_last for `[batch, height, width, channels]`.
Returns:
A normalized `Tensor` with the same `data_format`.
"""
if init_zero:
gamma_initializer = tf.zeros_initializer()
else:
gamma_initializer = tf.ones_initializer()
if data_format == "channels_first":
axis = 1
else:
axis = 3
inputs = layers().BatchNormalization(
axis=axis,
momentum=BATCH_NORM_DECAY,
epsilon=BATCH_NORM_EPSILON,
center=True,
scale=True,
fused=True,
gamma_initializer=gamma_initializer)(inputs, training=is_training)
if relu:
inputs = tf.nn.relu(inputs)
return inputs
|
[
"def",
"batch_norm_relu",
"(",
"inputs",
",",
"is_training",
",",
"relu",
"=",
"True",
",",
"init_zero",
"=",
"False",
",",
"data_format",
"=",
"\"channels_first\"",
")",
":",
"if",
"init_zero",
":",
"gamma_initializer",
"=",
"tf",
".",
"zeros_initializer",
"(",
")",
"else",
":",
"gamma_initializer",
"=",
"tf",
".",
"ones_initializer",
"(",
")",
"if",
"data_format",
"==",
"\"channels_first\"",
":",
"axis",
"=",
"1",
"else",
":",
"axis",
"=",
"3",
"inputs",
"=",
"layers",
"(",
")",
".",
"BatchNormalization",
"(",
"axis",
"=",
"axis",
",",
"momentum",
"=",
"BATCH_NORM_DECAY",
",",
"epsilon",
"=",
"BATCH_NORM_EPSILON",
",",
"center",
"=",
"True",
",",
"scale",
"=",
"True",
",",
"fused",
"=",
"True",
",",
"gamma_initializer",
"=",
"gamma_initializer",
")",
"(",
"inputs",
",",
"training",
"=",
"is_training",
")",
"if",
"relu",
":",
"inputs",
"=",
"tf",
".",
"nn",
".",
"relu",
"(",
"inputs",
")",
"return",
"inputs"
] |
Performs a batch normalization followed by a ReLU.
Args:
inputs: `Tensor` of shape `[batch, channels, ...]`.
is_training: `bool` for whether the model is training.
relu: `bool` if False, omits the ReLU operation.
init_zero: `bool` if True, initializes scale parameter of batch
normalization with 0 instead of 1 (default).
data_format: `str` either "channels_first" for `[batch, channels, height,
width]` or "channels_last for `[batch, height, width, channels]`.
Returns:
A normalized `Tensor` with the same `data_format`.
|
[
"Performs",
"a",
"batch",
"normalization",
"followed",
"by",
"a",
"ReLU",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/models/resnet.py#L41-L81
|
train
|
Performs a batch normalization followed by a ReLU.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,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hwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(48) + '\157' + chr(0b11 + 0o57) + '\x30' + chr(0b10110 + 0o37), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(2309 - 2258) + '\x33' + chr(0b111 + 0o53), ord("\x08")), ehT0Px3KOsy9('\060' + chr(1026 - 915) + chr(0b110011) + chr(49) + chr(0b110111), 0b1000), ehT0Px3KOsy9('\060' + chr(8796 - 8685) + '\x31' + '\x34' + chr(50), 0b1000), ehT0Px3KOsy9(chr(0b110000 + 0o0) + chr(2755 - 2644) + chr(0b110011) + chr(0b110111) + chr(0b11011 + 0o32), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(49) + chr(3023 - 2968) + '\x30', 0b1000), ehT0Px3KOsy9(chr(1893 - 1845) + chr(0b10011 + 0o134) + chr(0b1101 + 0o45) + '\062' + chr(920 - 865), 10745 - 10737), ehT0Px3KOsy9('\060' + chr(111) + chr(0b100110 + 0o15) + chr(0b110010) + chr(0b10001 + 0o40), 39459 - 39451), ehT0Px3KOsy9(chr(1342 - 1294) + chr(111) + '\062' + '\x30', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b100110 + 0o111) + chr(0b100010 + 0o20) + chr(518 - 466) + chr(2685 - 2631), 0b1000), ehT0Px3KOsy9('\060' + '\157' + '\062' + chr(0b10101 + 0o35) + '\x36', 0o10), ehT0Px3KOsy9(chr(1770 - 1722) + chr(0b1100010 + 0o15) + chr(0b110001) + '\x34', 3904 - 3896), ehT0Px3KOsy9(chr(48) + '\157' + '\061' + '\x30' + chr(50), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(50) + '\061', ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(1364 - 1313) + chr(53) + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(720 - 672) + chr(111) + '\x32' + chr(0b110100 + 0o2) + '\x32', 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(0b1110 + 0o44) + chr(0b11000 + 0o34) + chr(0b110010), 35078 - 35070), ehT0Px3KOsy9('\x30' + chr(9711 - 9600) + chr(2135 - 2085) + '\066' + '\064', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b10100 + 0o133) + chr(0b110001) + '\062' + '\065', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x33' + chr(53) + chr(53), 49929 - 49921), ehT0Px3KOsy9(chr(1868 - 1820) + chr(0b1101111) + chr(2727 - 2673) + chr(1794 - 1741), 34188 - 34180), ehT0Px3KOsy9(chr(110 - 62) + '\157' + chr(0b110001) + chr(0b110001) + '\x33', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b111 + 0o52) + chr(0b110111) + chr(0b101011 + 0o14), 36829 - 36821), ehT0Px3KOsy9(chr(2087 - 2039) + '\x6f' + chr(0b110001), 0o10), ehT0Px3KOsy9(chr(0b10011 + 0o35) + chr(0b1011 + 0o144) + '\061' + chr(54) + chr(1426 - 1377), 16688 - 16680), ehT0Px3KOsy9(chr(0b1011 + 0o45) + '\157' + chr(434 - 385) + chr(0b110010) + chr(0b110111), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110011) + chr(1316 - 1263) + chr(2380 - 2326), ord("\x08")), ehT0Px3KOsy9(chr(2147 - 2099) + chr(0b1111 + 0o140) + '\x37' + chr(0b1 + 0o60), 0b1000), ehT0Px3KOsy9(chr(0b1101 + 0o43) + chr(0b1101111) + chr(0b110001) + '\x35', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\062', 0o10), ehT0Px3KOsy9('\x30' + chr(0b1100010 + 0o15) + chr(1029 - 979) + '\065' + '\065', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b110111 + 0o70) + chr(0b111 + 0o54) + chr(55) + chr(53), 8), ehT0Px3KOsy9(chr(0b101111 + 0o1) + '\157' + '\x37' + chr(55), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b101010 + 0o7) + '\066' + '\x31', 8), ehT0Px3KOsy9('\x30' + chr(0b1001001 + 0o46) + chr(51) + '\061', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(1885 - 1836) + chr(0b1001 + 0o53) + chr(1350 - 1295), ord("\x08")), ehT0Px3KOsy9(chr(1092 - 1044) + chr(111) + '\x33' + chr(0b110001) + '\066', 0o10), ehT0Px3KOsy9(chr(1306 - 1258) + chr(12135 - 12024) + chr(0b110000 + 0o2) + chr(0b110100) + chr(48), 26366 - 26358), ehT0Px3KOsy9(chr(543 - 495) + '\157' + '\063' + '\x35', 34138 - 34130), ehT0Px3KOsy9('\060' + chr(111) + '\x33' + chr(0b110010) + chr(0b100 + 0o61), ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9(chr(359 - 311) + '\x6f' + chr(0b110101) + '\x30', ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xab'), '\x64' + chr(0b1100001 + 0o4) + chr(99) + chr(7977 - 7866) + chr(0b11000 + 0o114) + chr(2284 - 2183))('\165' + chr(116) + chr(0b1011100 + 0o12) + chr(45) + chr(0b10011 + 0o45)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def TWDBa8qX3MHR(vXoupepMtCXU, XQJVi3cQFN5l, Iy34imuXhyBT=ehT0Px3KOsy9(chr(398 - 350) + chr(7951 - 7840) + chr(0b11100 + 0o25), 8), Us44LYpP6Ody=ehT0Px3KOsy9(chr(48) + '\157' + chr(851 - 803), ord("\x08")), ydIN5gIUKwpW=xafqLlk3kkUe(SXOLrMavuUCe(b'\xe6\xb2\xae\x0c\x93\x1d\xfb\xa2O\xc0\xff~1e'), '\144' + chr(101) + '\143' + '\157' + chr(0b1010 + 0o132) + chr(101))('\x75' + chr(11773 - 11657) + chr(0b11101 + 0o111) + '\055' + chr(56))):
if Us44LYpP6Ody:
w9ORc4XoUjvx = IDJ2eXGCBCDu.zeros_initializer()
else:
w9ORc4XoUjvx = IDJ2eXGCBCDu.ones_initializer()
if ydIN5gIUKwpW == xafqLlk3kkUe(SXOLrMavuUCe(b'\xe6\xb2\xae\x0c\x93\x1d\xfb\xa2O\xc0\xff~1e'), '\x64' + chr(0b1100101) + chr(0b1100011) + chr(4306 - 4195) + chr(100) + chr(0b1001100 + 0o31))(chr(0b100101 + 0o120) + chr(116) + '\x66' + '\x2d' + chr(145 - 89)):
cRTh61qyvi24 = ehT0Px3KOsy9(chr(599 - 551) + chr(0b11011 + 0o124) + chr(1662 - 1613), 8)
else:
cRTh61qyvi24 = ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(51), ord("\x08"))
vXoupepMtCXU = sGi5Aql23May().BatchNormalization(axis=cRTh61qyvi24, momentum=kidLGsxoKxzY, epsilon=kLqehLNcFI2o, center=ehT0Px3KOsy9('\x30' + '\157' + '\061', 8), scale=ehT0Px3KOsy9('\060' + '\x6f' + chr(76 - 27), 8), fused=ehT0Px3KOsy9('\x30' + '\157' + chr(0b1110 + 0o43), 8), gamma_initializer=w9ORc4XoUjvx)(vXoupepMtCXU, training=XQJVi3cQFN5l)
if Iy34imuXhyBT:
vXoupepMtCXU = IDJ2eXGCBCDu.nn.relu(vXoupepMtCXU)
return vXoupepMtCXU
|
tensorflow/tensor2tensor
|
tensor2tensor/models/resnet.py
|
conv2d_fixed_padding
|
def conv2d_fixed_padding(inputs,
filters,
kernel_size,
strides,
data_format="channels_first",
use_td=False,
targeting_rate=None,
keep_prob=None,
is_training=None):
"""Strided 2-D convolution with explicit padding.
The padding is consistent and is based only on `kernel_size`, not on the
dimensions of `inputs` (as opposed to using `tf.layers.conv2d` alone).
Args:
inputs: `Tensor` of size `[batch, channels, height_in, width_in]`.
filters: `int` number of filters in the convolution.
kernel_size: `int` size of the kernel to be used in the convolution.
strides: `int` strides of the convolution.
data_format: `str` either "channels_first" for `[batch, channels, height,
width]` or "channels_last for `[batch, height, width, channels]`.
use_td: `str` one of "weight" or "unit". Set to False or "" to disable
targeted dropout.
targeting_rate: `float` proportion of weights to target with targeted
dropout.
keep_prob: `float` keep probability for targeted dropout.
is_training: `bool` for whether the model is in training.
Returns:
A `Tensor` of shape `[batch, filters, height_out, width_out]`.
Raises:
Exception: if use_td is not valid.
"""
if strides > 1:
inputs = fixed_padding(inputs, kernel_size, data_format=data_format)
if use_td:
inputs_shape = common_layers.shape_list(inputs)
if use_td == "weight":
if data_format == "channels_last":
size = kernel_size * kernel_size * inputs_shape[-1]
else:
size = kernel_size * kernel_size * inputs_shape[1]
targeting_count = targeting_rate * tf.to_float(size)
targeting_fn = common_layers.weight_targeting
elif use_td == "unit":
targeting_count = targeting_rate * filters
targeting_fn = common_layers.unit_targeting
else:
raise Exception("Unrecognized targeted dropout type: %s" % use_td)
y = common_layers.td_conv(
inputs,
filters,
kernel_size,
targeting_count,
targeting_fn,
keep_prob,
is_training,
do_prune=True,
strides=strides,
padding=("SAME" if strides == 1 else "VALID"),
data_format=data_format,
use_bias=False,
kernel_initializer=tf.variance_scaling_initializer())
else:
y = layers().Conv2D(
filters=filters,
kernel_size=kernel_size,
strides=strides,
padding=("SAME" if strides == 1 else "VALID"),
use_bias=False,
kernel_initializer=tf.variance_scaling_initializer(),
data_format=data_format)(inputs)
return y
|
python
|
def conv2d_fixed_padding(inputs,
filters,
kernel_size,
strides,
data_format="channels_first",
use_td=False,
targeting_rate=None,
keep_prob=None,
is_training=None):
"""Strided 2-D convolution with explicit padding.
The padding is consistent and is based only on `kernel_size`, not on the
dimensions of `inputs` (as opposed to using `tf.layers.conv2d` alone).
Args:
inputs: `Tensor` of size `[batch, channels, height_in, width_in]`.
filters: `int` number of filters in the convolution.
kernel_size: `int` size of the kernel to be used in the convolution.
strides: `int` strides of the convolution.
data_format: `str` either "channels_first" for `[batch, channels, height,
width]` or "channels_last for `[batch, height, width, channels]`.
use_td: `str` one of "weight" or "unit". Set to False or "" to disable
targeted dropout.
targeting_rate: `float` proportion of weights to target with targeted
dropout.
keep_prob: `float` keep probability for targeted dropout.
is_training: `bool` for whether the model is in training.
Returns:
A `Tensor` of shape `[batch, filters, height_out, width_out]`.
Raises:
Exception: if use_td is not valid.
"""
if strides > 1:
inputs = fixed_padding(inputs, kernel_size, data_format=data_format)
if use_td:
inputs_shape = common_layers.shape_list(inputs)
if use_td == "weight":
if data_format == "channels_last":
size = kernel_size * kernel_size * inputs_shape[-1]
else:
size = kernel_size * kernel_size * inputs_shape[1]
targeting_count = targeting_rate * tf.to_float(size)
targeting_fn = common_layers.weight_targeting
elif use_td == "unit":
targeting_count = targeting_rate * filters
targeting_fn = common_layers.unit_targeting
else:
raise Exception("Unrecognized targeted dropout type: %s" % use_td)
y = common_layers.td_conv(
inputs,
filters,
kernel_size,
targeting_count,
targeting_fn,
keep_prob,
is_training,
do_prune=True,
strides=strides,
padding=("SAME" if strides == 1 else "VALID"),
data_format=data_format,
use_bias=False,
kernel_initializer=tf.variance_scaling_initializer())
else:
y = layers().Conv2D(
filters=filters,
kernel_size=kernel_size,
strides=strides,
padding=("SAME" if strides == 1 else "VALID"),
use_bias=False,
kernel_initializer=tf.variance_scaling_initializer(),
data_format=data_format)(inputs)
return y
|
[
"def",
"conv2d_fixed_padding",
"(",
"inputs",
",",
"filters",
",",
"kernel_size",
",",
"strides",
",",
"data_format",
"=",
"\"channels_first\"",
",",
"use_td",
"=",
"False",
",",
"targeting_rate",
"=",
"None",
",",
"keep_prob",
"=",
"None",
",",
"is_training",
"=",
"None",
")",
":",
"if",
"strides",
">",
"1",
":",
"inputs",
"=",
"fixed_padding",
"(",
"inputs",
",",
"kernel_size",
",",
"data_format",
"=",
"data_format",
")",
"if",
"use_td",
":",
"inputs_shape",
"=",
"common_layers",
".",
"shape_list",
"(",
"inputs",
")",
"if",
"use_td",
"==",
"\"weight\"",
":",
"if",
"data_format",
"==",
"\"channels_last\"",
":",
"size",
"=",
"kernel_size",
"*",
"kernel_size",
"*",
"inputs_shape",
"[",
"-",
"1",
"]",
"else",
":",
"size",
"=",
"kernel_size",
"*",
"kernel_size",
"*",
"inputs_shape",
"[",
"1",
"]",
"targeting_count",
"=",
"targeting_rate",
"*",
"tf",
".",
"to_float",
"(",
"size",
")",
"targeting_fn",
"=",
"common_layers",
".",
"weight_targeting",
"elif",
"use_td",
"==",
"\"unit\"",
":",
"targeting_count",
"=",
"targeting_rate",
"*",
"filters",
"targeting_fn",
"=",
"common_layers",
".",
"unit_targeting",
"else",
":",
"raise",
"Exception",
"(",
"\"Unrecognized targeted dropout type: %s\"",
"%",
"use_td",
")",
"y",
"=",
"common_layers",
".",
"td_conv",
"(",
"inputs",
",",
"filters",
",",
"kernel_size",
",",
"targeting_count",
",",
"targeting_fn",
",",
"keep_prob",
",",
"is_training",
",",
"do_prune",
"=",
"True",
",",
"strides",
"=",
"strides",
",",
"padding",
"=",
"(",
"\"SAME\"",
"if",
"strides",
"==",
"1",
"else",
"\"VALID\"",
")",
",",
"data_format",
"=",
"data_format",
",",
"use_bias",
"=",
"False",
",",
"kernel_initializer",
"=",
"tf",
".",
"variance_scaling_initializer",
"(",
")",
")",
"else",
":",
"y",
"=",
"layers",
"(",
")",
".",
"Conv2D",
"(",
"filters",
"=",
"filters",
",",
"kernel_size",
"=",
"kernel_size",
",",
"strides",
"=",
"strides",
",",
"padding",
"=",
"(",
"\"SAME\"",
"if",
"strides",
"==",
"1",
"else",
"\"VALID\"",
")",
",",
"use_bias",
"=",
"False",
",",
"kernel_initializer",
"=",
"tf",
".",
"variance_scaling_initializer",
"(",
")",
",",
"data_format",
"=",
"data_format",
")",
"(",
"inputs",
")",
"return",
"y"
] |
Strided 2-D convolution with explicit padding.
The padding is consistent and is based only on `kernel_size`, not on the
dimensions of `inputs` (as opposed to using `tf.layers.conv2d` alone).
Args:
inputs: `Tensor` of size `[batch, channels, height_in, width_in]`.
filters: `int` number of filters in the convolution.
kernel_size: `int` size of the kernel to be used in the convolution.
strides: `int` strides of the convolution.
data_format: `str` either "channels_first" for `[batch, channels, height,
width]` or "channels_last for `[batch, height, width, channels]`.
use_td: `str` one of "weight" or "unit". Set to False or "" to disable
targeted dropout.
targeting_rate: `float` proportion of weights to target with targeted
dropout.
keep_prob: `float` keep probability for targeted dropout.
is_training: `bool` for whether the model is in training.
Returns:
A `Tensor` of shape `[batch, filters, height_out, width_out]`.
Raises:
Exception: if use_td is not valid.
|
[
"Strided",
"2",
"-",
"D",
"convolution",
"with",
"explicit",
"padding",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/models/resnet.py#L112-L188
|
train
|
Strided 2 - D convolution with explicit padding.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,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essError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\x30' + '\157' + chr(1700 - 1650) + chr(0b101 + 0o61) + '\x31', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(50) + chr(1526 - 1476) + chr(0b11101 + 0o32), 0o10), ehT0Px3KOsy9(chr(1710 - 1662) + chr(111) + chr(590 - 540) + chr(0b11110 + 0o31) + chr(0b100 + 0o56), 0o10), ehT0Px3KOsy9(chr(2165 - 2117) + chr(0b1101111) + chr(0b110001 + 0o1) + chr(1968 - 1920) + chr(0b110010), 0b1000), ehT0Px3KOsy9(chr(48) + chr(1282 - 1171) + '\061' + '\067' + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110010) + chr(0b110000) + '\065', 24154 - 24146), ehT0Px3KOsy9('\060' + chr(111) + '\061' + '\066' + '\062', ord("\x08")), ehT0Px3KOsy9(chr(123 - 75) + chr(111) + chr(0b110011) + chr(0b110100), 0b1000), ehT0Px3KOsy9('\x30' + chr(9311 - 9200) + '\062' + chr(0b110111) + chr(0b110011), ord("\x08")), ehT0Px3KOsy9(chr(0b10100 + 0o34) + chr(4859 - 4748) + chr(0b110010) + chr(49) + chr(0b110001), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\062' + chr(1756 - 1708) + '\x31', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(10306 - 10195) + chr(1688 - 1633), 38039 - 38031), ehT0Px3KOsy9(chr(0b11011 + 0o25) + chr(111) + chr(1458 - 1409) + chr(672 - 620) + chr(0b10001 + 0o37), 61880 - 61872), ehT0Px3KOsy9(chr(0b101000 + 0o10) + chr(636 - 525) + chr(0b110001) + '\060' + chr(1438 - 1385), 0b1000), ehT0Px3KOsy9(chr(0b10 + 0o56) + '\157' + '\x34' + chr(0b110001), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(51) + chr(0b101010 + 0o7) + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(0b1011 + 0o45) + chr(0b1101111) + chr(2071 - 2021) + '\x31' + chr(1449 - 1401), ord("\x08")), ehT0Px3KOsy9(chr(0b10000 + 0o40) + '\x6f' + chr(995 - 945) + chr(0b110010) + '\060', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + '\065' + '\x31', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(1435 - 1384) + chr(0b110110), 0o10), ehT0Px3KOsy9(chr(829 - 781) + chr(0b1101111) + '\061' + chr(51) + chr(0b10000 + 0o47), ord("\x08")), ehT0Px3KOsy9(chr(0b11 + 0o55) + chr(2182 - 2071) + chr(0b110100) + '\060', 59949 - 59941), ehT0Px3KOsy9(chr(48) + chr(111) + chr(54) + chr(51), ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + '\x32' + chr(0b101100 + 0o10) + chr(0b110010), 0b1000), ehT0Px3KOsy9(chr(48) + chr(3698 - 3587) + chr(0b11101 + 0o24) + '\062' + chr(0b1111 + 0o50), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\062' + chr(0b100110 + 0o17) + chr(388 - 336), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b110100 + 0o73) + chr(2408 - 2357) + chr(0b10110 + 0o34), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b11100 + 0o27) + chr(2397 - 2344) + '\x37', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b101011 + 0o104) + '\063' + chr(0b110100) + chr(0b101110 + 0o2), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1010110 + 0o31) + chr(1125 - 1074) + '\061' + chr(53), 34875 - 34867), ehT0Px3KOsy9(chr(48) + '\157' + '\062' + chr(0b1100 + 0o46) + chr(48), 8), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b11100 + 0o25) + chr(2086 - 2035) + chr(0b110010), 0b1000), ehT0Px3KOsy9(chr(0b1011 + 0o45) + chr(0b10101 + 0o132) + chr(50) + chr(0b110101), 0o10), ehT0Px3KOsy9('\060' + chr(5815 - 5704) + chr(0b110010) + chr(725 - 673) + '\x33', 0o10), ehT0Px3KOsy9(chr(0b11 + 0o55) + chr(0b1101111) + chr(2154 - 2104) + chr(2497 - 2445) + chr(0b101110 + 0o5), 8), ehT0Px3KOsy9('\x30' + chr(0b1011 + 0o144) + '\x31' + chr(0b1000 + 0o54) + chr(54), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(664 - 614) + '\067' + chr(0b11010 + 0o32), 0b1000), ehT0Px3KOsy9(chr(1866 - 1818) + chr(0b10100 + 0o133) + chr(0b101100 + 0o5) + chr(1682 - 1629), 60524 - 60516), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110001), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b10111 + 0o32) + chr(0b110110), 50558 - 50550)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b0 + 0o60) + '\x6f' + chr(0b110101) + '\060', 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x9f'), chr(8910 - 8810) + chr(101) + chr(0b1001000 + 0o33) + chr(0b1101111) + '\x64' + chr(6279 - 6178))(chr(0b1110101) + chr(11494 - 11378) + chr(10102 - 10000) + chr(0b101101) + chr(0b111000)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def HuscHDs811Ao(vXoupepMtCXU, MErh319F3bgE, m6gwVXy4D3Au, r8knJmMTTKwv, ydIN5gIUKwpW=xafqLlk3kkUe(SXOLrMavuUCe(b'\xd2\xff\xdb\xec\x14\xe0\x1eo\xe4\xef\xe8u\x131'), chr(0b111001 + 0o53) + '\145' + chr(4737 - 4638) + chr(111) + chr(0b1011 + 0o131) + chr(0b1110 + 0o127))(chr(0b1011000 + 0o35) + chr(0b101011 + 0o111) + chr(3136 - 3034) + chr(45) + chr(0b101 + 0o63)), cvqVSw_Th5Qm=ehT0Px3KOsy9(chr(48) + chr(111) + chr(48), 0b1000), ixa3U1BjAQ01=None, gHeP0t6GwBIV=None, XQJVi3cQFN5l=None):
if r8knJmMTTKwv > ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\061', 8):
vXoupepMtCXU = W5AOcYdP33vs(vXoupepMtCXU, m6gwVXy4D3Au, data_format=ydIN5gIUKwpW)
if cvqVSw_Th5Qm:
VgP_McURhCb5 = jSKPaHwSAfVv.shape_list(vXoupepMtCXU)
if cvqVSw_Th5Qm == xafqLlk3kkUe(SXOLrMavuUCe(b'\xc6\xf2\xd3\xe5\x12\xf1'), '\144' + chr(292 - 191) + '\143' + chr(4979 - 4868) + chr(3028 - 2928) + chr(0b1100101))(chr(0b1110101) + chr(0b1110100) + chr(0b1100110) + '\055' + '\x38'):
if ydIN5gIUKwpW == xafqLlk3kkUe(SXOLrMavuUCe(b'\xd2\xff\xdb\xec\x14\xe0\x1eo\xe4\xe5\xe0t\x14'), chr(100) + chr(0b1100101) + '\x63' + chr(111) + chr(0b1100100) + chr(0b1100101))(chr(0b1001100 + 0o51) + '\x74' + chr(102) + chr(0b10 + 0o53) + '\070'):
NLcc3BCJnQka = m6gwVXy4D3Au * m6gwVXy4D3Au * VgP_McURhCb5[-ehT0Px3KOsy9(chr(0b110000) + chr(0b111000 + 0o67) + chr(0b110001), 8)]
else:
NLcc3BCJnQka = m6gwVXy4D3Au * m6gwVXy4D3Au * VgP_McURhCb5[ehT0Px3KOsy9(chr(698 - 650) + chr(0b1101111) + chr(0b101110 + 0o3), 8)]
IR08KXxQRyat = ixa3U1BjAQ01 * IDJ2eXGCBCDu.ZUL3kHBGU8Uu(NLcc3BCJnQka)
HvlU7Y05EReI = jSKPaHwSAfVv.weight_targeting
elif cvqVSw_Th5Qm == xafqLlk3kkUe(SXOLrMavuUCe(b'\xc4\xf9\xd3\xf6'), chr(0b1100100) + chr(2306 - 2205) + chr(590 - 491) + '\157' + chr(0b110101 + 0o57) + chr(101))('\x75' + chr(116) + chr(0b101011 + 0o73) + chr(1392 - 1347) + chr(0b11010 + 0o36)):
IR08KXxQRyat = ixa3U1BjAQ01 * MErh319F3bgE
HvlU7Y05EReI = jSKPaHwSAfVv.unit_targeting
else:
raise jLmadlzMdunT(xafqLlk3kkUe(SXOLrMavuUCe(b'\xe4\xf9\xc8\xe7\x19\xea\x15r\xd2\xf3\xe4c@1@\xba\xef\xf5]{;\x00W\xd08\xdcu\x9a\x94\xed\xe4#e\xc6\x99F\x99~'), '\x64' + chr(101) + chr(1743 - 1644) + chr(0b10011 + 0o134) + chr(100) + chr(0b110011 + 0o62))(chr(117) + chr(0b1110100) + '\x66' + chr(45) + chr(0b1001 + 0o57)) % cvqVSw_Th5Qm)
SqiSOtYOqOJH = jSKPaHwSAfVv.td_conv(vXoupepMtCXU, MErh319F3bgE, m6gwVXy4D3Au, IR08KXxQRyat, HvlU7Y05EReI, gHeP0t6GwBIV, XQJVi3cQFN5l, do_prune=ehT0Px3KOsy9(chr(1769 - 1721) + '\157' + '\061', 8), strides=r8knJmMTTKwv, padding=xafqLlk3kkUe(SXOLrMavuUCe(b'\xe2\xd6\xf7\xc7'), '\x64' + chr(5897 - 5796) + '\x63' + chr(111) + chr(0b1100100) + chr(101))('\x75' + chr(0b1110100) + chr(0b111000 + 0o56) + '\x2d' + '\070') if r8knJmMTTKwv == ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110001), 8) else xafqLlk3kkUe(SXOLrMavuUCe(b'\xe7\xd6\xf6\xcb>'), chr(3653 - 3553) + chr(101) + chr(0b1100011) + chr(111) + chr(4906 - 4806) + '\x65')(chr(0b10111 + 0o136) + chr(0b1110100) + chr(0b101001 + 0o75) + chr(0b100000 + 0o15) + chr(0b11110 + 0o32)), data_format=ydIN5gIUKwpW, use_bias=ehT0Px3KOsy9('\060' + chr(11859 - 11748) + chr(0b110000), 8), kernel_initializer=IDJ2eXGCBCDu.variance_scaling_initializer())
else:
SqiSOtYOqOJH = sGi5Aql23May().Conv2D(filters=MErh319F3bgE, kernel_size=m6gwVXy4D3Au, strides=r8knJmMTTKwv, padding=xafqLlk3kkUe(SXOLrMavuUCe(b'\xe2\xd6\xf7\xc7'), chr(100) + chr(0b1100101) + chr(0b1100011) + chr(7909 - 7798) + chr(3962 - 3862) + chr(0b111101 + 0o50))(chr(3220 - 3103) + chr(116) + '\146' + '\055' + chr(56)) if r8knJmMTTKwv == ehT0Px3KOsy9(chr(0b110000) + '\157' + '\061', 8) else xafqLlk3kkUe(SXOLrMavuUCe(b'\xe7\xd6\xf6\xcb>'), chr(0b1011 + 0o131) + chr(0b1100101) + chr(99) + '\157' + chr(100) + chr(0b1100101))(chr(0b1100011 + 0o22) + chr(116) + chr(0b1100110) + chr(639 - 594) + chr(0b111000)), use_bias=ehT0Px3KOsy9('\x30' + chr(5795 - 5684) + chr(0b110000), 8), kernel_initializer=IDJ2eXGCBCDu.variance_scaling_initializer(), data_format=ydIN5gIUKwpW)(vXoupepMtCXU)
return SqiSOtYOqOJH
|
tensorflow/tensor2tensor
|
tensor2tensor/models/resnet.py
|
residual_block
|
def residual_block(inputs,
filters,
is_training,
projection_shortcut,
strides,
final_block,
data_format="channels_first",
use_td=False,
targeting_rate=None,
keep_prob=None):
"""Standard building block for residual networks with BN before convolutions.
Args:
inputs: `Tensor` of size `[batch, channels, height, width]`.
filters: `int` number of filters for the first two convolutions. Note that
the third and final convolution will use 4 times as many filters.
is_training: `bool` for whether the model is in training.
projection_shortcut: `function` to use for projection shortcuts (typically
a 1x1 convolution to match the filter dimensions). If None, no
projection is used and the input is passed as unchanged through the
shortcut connection.
strides: `int` block stride. If greater than 1, this block will ultimately
downsample the input.
final_block: unused parameter to keep the same function signature as
`bottleneck_block`.
data_format: `str` either "channels_first" for `[batch, channels, height,
width]` or "channels_last for `[batch, height, width, channels]`.
use_td: `str` one of "weight" or "unit". Set to False or "" to disable
targeted dropout.
targeting_rate: `float` proportion of weights to target with targeted
dropout.
keep_prob: `float` keep probability for targeted dropout.
Returns:
The output `Tensor` of the block.
"""
del final_block
shortcut = inputs
inputs = batch_norm_relu(inputs, is_training, data_format=data_format)
if projection_shortcut is not None:
shortcut = projection_shortcut(inputs)
inputs = conv2d_fixed_padding(
inputs=inputs,
filters=filters,
kernel_size=3,
strides=strides,
data_format=data_format,
use_td=use_td,
targeting_rate=targeting_rate,
keep_prob=keep_prob,
is_training=is_training)
inputs = batch_norm_relu(inputs, is_training, data_format=data_format)
inputs = conv2d_fixed_padding(
inputs=inputs,
filters=filters,
kernel_size=3,
strides=1,
data_format=data_format,
use_td=use_td,
targeting_rate=targeting_rate,
keep_prob=keep_prob,
is_training=is_training)
return inputs + shortcut
|
python
|
def residual_block(inputs,
filters,
is_training,
projection_shortcut,
strides,
final_block,
data_format="channels_first",
use_td=False,
targeting_rate=None,
keep_prob=None):
"""Standard building block for residual networks with BN before convolutions.
Args:
inputs: `Tensor` of size `[batch, channels, height, width]`.
filters: `int` number of filters for the first two convolutions. Note that
the third and final convolution will use 4 times as many filters.
is_training: `bool` for whether the model is in training.
projection_shortcut: `function` to use for projection shortcuts (typically
a 1x1 convolution to match the filter dimensions). If None, no
projection is used and the input is passed as unchanged through the
shortcut connection.
strides: `int` block stride. If greater than 1, this block will ultimately
downsample the input.
final_block: unused parameter to keep the same function signature as
`bottleneck_block`.
data_format: `str` either "channels_first" for `[batch, channels, height,
width]` or "channels_last for `[batch, height, width, channels]`.
use_td: `str` one of "weight" or "unit". Set to False or "" to disable
targeted dropout.
targeting_rate: `float` proportion of weights to target with targeted
dropout.
keep_prob: `float` keep probability for targeted dropout.
Returns:
The output `Tensor` of the block.
"""
del final_block
shortcut = inputs
inputs = batch_norm_relu(inputs, is_training, data_format=data_format)
if projection_shortcut is not None:
shortcut = projection_shortcut(inputs)
inputs = conv2d_fixed_padding(
inputs=inputs,
filters=filters,
kernel_size=3,
strides=strides,
data_format=data_format,
use_td=use_td,
targeting_rate=targeting_rate,
keep_prob=keep_prob,
is_training=is_training)
inputs = batch_norm_relu(inputs, is_training, data_format=data_format)
inputs = conv2d_fixed_padding(
inputs=inputs,
filters=filters,
kernel_size=3,
strides=1,
data_format=data_format,
use_td=use_td,
targeting_rate=targeting_rate,
keep_prob=keep_prob,
is_training=is_training)
return inputs + shortcut
|
[
"def",
"residual_block",
"(",
"inputs",
",",
"filters",
",",
"is_training",
",",
"projection_shortcut",
",",
"strides",
",",
"final_block",
",",
"data_format",
"=",
"\"channels_first\"",
",",
"use_td",
"=",
"False",
",",
"targeting_rate",
"=",
"None",
",",
"keep_prob",
"=",
"None",
")",
":",
"del",
"final_block",
"shortcut",
"=",
"inputs",
"inputs",
"=",
"batch_norm_relu",
"(",
"inputs",
",",
"is_training",
",",
"data_format",
"=",
"data_format",
")",
"if",
"projection_shortcut",
"is",
"not",
"None",
":",
"shortcut",
"=",
"projection_shortcut",
"(",
"inputs",
")",
"inputs",
"=",
"conv2d_fixed_padding",
"(",
"inputs",
"=",
"inputs",
",",
"filters",
"=",
"filters",
",",
"kernel_size",
"=",
"3",
",",
"strides",
"=",
"strides",
",",
"data_format",
"=",
"data_format",
",",
"use_td",
"=",
"use_td",
",",
"targeting_rate",
"=",
"targeting_rate",
",",
"keep_prob",
"=",
"keep_prob",
",",
"is_training",
"=",
"is_training",
")",
"inputs",
"=",
"batch_norm_relu",
"(",
"inputs",
",",
"is_training",
",",
"data_format",
"=",
"data_format",
")",
"inputs",
"=",
"conv2d_fixed_padding",
"(",
"inputs",
"=",
"inputs",
",",
"filters",
"=",
"filters",
",",
"kernel_size",
"=",
"3",
",",
"strides",
"=",
"1",
",",
"data_format",
"=",
"data_format",
",",
"use_td",
"=",
"use_td",
",",
"targeting_rate",
"=",
"targeting_rate",
",",
"keep_prob",
"=",
"keep_prob",
",",
"is_training",
"=",
"is_training",
")",
"return",
"inputs",
"+",
"shortcut"
] |
Standard building block for residual networks with BN before convolutions.
Args:
inputs: `Tensor` of size `[batch, channels, height, width]`.
filters: `int` number of filters for the first two convolutions. Note that
the third and final convolution will use 4 times as many filters.
is_training: `bool` for whether the model is in training.
projection_shortcut: `function` to use for projection shortcuts (typically
a 1x1 convolution to match the filter dimensions). If None, no
projection is used and the input is passed as unchanged through the
shortcut connection.
strides: `int` block stride. If greater than 1, this block will ultimately
downsample the input.
final_block: unused parameter to keep the same function signature as
`bottleneck_block`.
data_format: `str` either "channels_first" for `[batch, channels, height,
width]` or "channels_last for `[batch, height, width, channels]`.
use_td: `str` one of "weight" or "unit". Set to False or "" to disable
targeted dropout.
targeting_rate: `float` proportion of weights to target with targeted
dropout.
keep_prob: `float` keep probability for targeted dropout.
Returns:
The output `Tensor` of the block.
|
[
"Standard",
"building",
"block",
"for",
"residual",
"networks",
"with",
"BN",
"before",
"convolutions",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/models/resnet.py#L191-L257
|
train
|
Standard build block for residual networks with BN before convolutions.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2Qao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ClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b11010 + 0o26) + '\157' + chr(1524 - 1474) + chr(49) + chr(0b10111 + 0o34), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x34', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b100001 + 0o116) + chr(49) + chr(729 - 680) + chr(1008 - 958), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(10978 - 10867) + chr(818 - 767) + chr(0b11100 + 0o25) + chr(1804 - 1753), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + '\063' + chr(0b110011) + chr(1859 - 1807), 9235 - 9227), ehT0Px3KOsy9(chr(48) + chr(0b1010000 + 0o37) + chr(0b11011 + 0o27) + '\x30' + chr(0b110110), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(742 - 692) + chr(55) + chr(1642 - 1589), 19768 - 19760), ehT0Px3KOsy9(chr(0b10111 + 0o31) + '\157' + chr(2115 - 2064) + '\x31' + chr(1935 - 1886), 38575 - 38567), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110010) + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(0b101111 + 0o1) + chr(0b110011 + 0o74) + chr(2381 - 2329) + chr(0b110100), 3443 - 3435), ehT0Px3KOsy9(chr(1978 - 1930) + chr(0b1101111) + '\062' + chr(55) + chr(0b110111), 0b1000), ehT0Px3KOsy9(chr(48) + chr(9959 - 9848) + chr(0b100010 + 0o20) + chr(0b110011) + chr(0b110100 + 0o0), 0o10), ehT0Px3KOsy9(chr(999 - 951) + '\x6f' + '\061' + chr(1753 - 1702) + chr(54), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(51) + chr(0b110111) + '\x34', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b10001 + 0o45) + chr(0b110011), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110011) + '\x32' + '\061', 0o10), ehT0Px3KOsy9('\060' + chr(0b1010101 + 0o32) + chr(54) + chr(0b110110), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1011000 + 0o27) + chr(687 - 636) + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110001) + chr(54) + chr(0b110111), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1001100 + 0o43) + chr(1491 - 1442) + chr(0b110000) + '\060', 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(49) + chr(0b110100) + '\x30', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b100010 + 0o115) + '\061' + '\067' + chr(53), 2164 - 2156), ehT0Px3KOsy9(chr(0b10000 + 0o40) + chr(0b1101111) + chr(384 - 333) + chr(0b110111) + chr(0b110100), 8), ehT0Px3KOsy9('\x30' + '\157' + chr(1898 - 1847) + '\x31' + chr(55), 0b1000), ehT0Px3KOsy9(chr(0b10111 + 0o31) + chr(0b100011 + 0o114) + chr(51) + chr(0b110101) + '\x33', 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b100101 + 0o15) + chr(0b101010 + 0o6), 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110111) + '\x33', 0b1000), ehT0Px3KOsy9(chr(1439 - 1391) + chr(111) + '\x36', 0b1000), ehT0Px3KOsy9('\060' + chr(0b110100 + 0o73) + chr(1747 - 1697) + chr(0b101111 + 0o2) + chr(0b100011 + 0o21), ord("\x08")), ehT0Px3KOsy9(chr(0b100110 + 0o12) + chr(0b10100 + 0o133) + chr(0b1001 + 0o50) + '\x37' + chr(0b110011), 51417 - 51409), ehT0Px3KOsy9(chr(991 - 943) + chr(0b1101111) + chr(0b11001 + 0o30) + chr(0b10011 + 0o37) + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(50) + '\x32' + chr(0b110011), 21507 - 21499), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110101) + chr(1362 - 1312), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + '\x33' + chr(55) + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(935 - 887) + '\x6f' + chr(0b10100 + 0o40) + chr(49), ord("\x08")), ehT0Px3KOsy9(chr(0b1111 + 0o41) + chr(0b1001000 + 0o47) + chr(0b110010) + chr(645 - 590) + chr(0b110000 + 0o7), 8), ehT0Px3KOsy9('\x30' + '\157' + '\x32' + chr(52) + chr(0b0 + 0o67), 19268 - 19260), ehT0Px3KOsy9(chr(0b1 + 0o57) + chr(0b1101111) + chr(50) + chr(54) + chr(49), ord("\x08")), ehT0Px3KOsy9(chr(0b101001 + 0o7) + chr(0b1100011 + 0o14) + chr(0b110001) + chr(568 - 520) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(466 - 415) + '\x37' + '\066', 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(53) + chr(0b110000), 21230 - 21222)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xa5'), chr(0b1011100 + 0o10) + chr(9372 - 9271) + chr(0b1100011) + chr(111) + '\x64' + chr(4772 - 4671))('\165' + '\164' + '\x66' + '\x2d' + chr(0b11 + 0o65)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def cZzlDzj_eOt4(vXoupepMtCXU, MErh319F3bgE, XQJVi3cQFN5l, CGIr4VFYxKcQ, r8knJmMTTKwv, G4mC4N9ftCbi, ydIN5gIUKwpW=xafqLlk3kkUe(SXOLrMavuUCe(b'\xe8l+\xa5\xb2\xe3\xd1\xbaIB\xd6\xee-\x88'), '\x64' + chr(528 - 427) + chr(99) + chr(0b1101111) + '\144' + chr(5783 - 5682))('\x75' + '\164' + chr(102) + '\055' + '\x38'), cvqVSw_Th5Qm=ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\060', 0o10), ixa3U1BjAQ01=None, gHeP0t6GwBIV=None):
del G4mC4N9ftCbi
c4rbmmlcdkTg = vXoupepMtCXU
vXoupepMtCXU = TWDBa8qX3MHR(vXoupepMtCXU, XQJVi3cQFN5l, data_format=ydIN5gIUKwpW)
if CGIr4VFYxKcQ is not None:
c4rbmmlcdkTg = CGIr4VFYxKcQ(vXoupepMtCXU)
vXoupepMtCXU = HuscHDs811Ao(inputs=vXoupepMtCXU, filters=MErh319F3bgE, kernel_size=ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b11011 + 0o30), 0o10), strides=r8knJmMTTKwv, data_format=ydIN5gIUKwpW, use_td=cvqVSw_Th5Qm, targeting_rate=ixa3U1BjAQ01, keep_prob=gHeP0t6GwBIV, is_training=XQJVi3cQFN5l)
vXoupepMtCXU = TWDBa8qX3MHR(vXoupepMtCXU, XQJVi3cQFN5l, data_format=ydIN5gIUKwpW)
vXoupepMtCXU = HuscHDs811Ao(inputs=vXoupepMtCXU, filters=MErh319F3bgE, kernel_size=ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(1736 - 1685), 8), strides=ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(2163 - 2114), ord("\x08")), data_format=ydIN5gIUKwpW, use_td=cvqVSw_Th5Qm, targeting_rate=ixa3U1BjAQ01, keep_prob=gHeP0t6GwBIV, is_training=XQJVi3cQFN5l)
return vXoupepMtCXU + c4rbmmlcdkTg
|
tensorflow/tensor2tensor
|
tensor2tensor/models/resnet.py
|
bottleneck_block
|
def bottleneck_block(inputs,
filters,
is_training,
projection_shortcut,
strides,
final_block,
data_format="channels_first",
use_td=False,
targeting_rate=None,
keep_prob=None):
"""Bottleneck block variant for residual networks with BN after convolutions.
Args:
inputs: `Tensor` of size `[batch, channels, height, width]`.
filters: `int` number of filters for the first two convolutions. Note that
the third and final convolution will use 4 times as many filters.
is_training: `bool` for whether the model is in training.
projection_shortcut: `function` to use for projection shortcuts (typically
a 1x1 convolution to match the filter dimensions). If None, no
projection is used and the input is passed as unchanged through the
shortcut connection.
strides: `int` block stride. If greater than 1, this block will ultimately
downsample the input.
final_block: `bool` set to True if it is this the final block in the group.
This is changes the behavior of batch normalization initialization for
the final batch norm in a block.
data_format: `str` either "channels_first" for `[batch, channels, height,
width]` or "channels_last for `[batch, height, width, channels]`.
use_td: `str` one of "weight" or "unit". Set to False or "" to disable
targeted dropout.
targeting_rate: `float` proportion of weights to target with targeted
dropout.
keep_prob: `float` keep probability for targeted dropout.
Returns:
The output `Tensor` of the block.
"""
# TODO(chrisying): this block is technically the post-activation resnet-v1
# bottleneck unit. Test with v2 (pre-activation) and replace if there is no
# difference for consistency.
shortcut = inputs
if projection_shortcut is not None:
shortcut = projection_shortcut(inputs)
inputs = conv2d_fixed_padding(
inputs=inputs,
filters=filters,
kernel_size=1,
strides=1,
data_format=data_format,
use_td=use_td,
targeting_rate=targeting_rate,
keep_prob=keep_prob,
is_training=is_training)
inputs = batch_norm_relu(inputs, is_training, data_format=data_format)
inputs = conv2d_fixed_padding(
inputs=inputs,
filters=filters,
kernel_size=3,
strides=strides,
data_format=data_format,
use_td=use_td,
targeting_rate=targeting_rate,
keep_prob=keep_prob,
is_training=is_training)
inputs = batch_norm_relu(inputs, is_training, data_format=data_format)
inputs = conv2d_fixed_padding(
inputs=inputs,
filters=4 * filters,
kernel_size=1,
strides=1,
data_format=data_format,
use_td=use_td,
targeting_rate=targeting_rate,
keep_prob=keep_prob,
is_training=is_training)
inputs = batch_norm_relu(
inputs,
is_training,
relu=False,
init_zero=final_block,
data_format=data_format)
return tf.nn.relu(inputs + shortcut)
|
python
|
def bottleneck_block(inputs,
filters,
is_training,
projection_shortcut,
strides,
final_block,
data_format="channels_first",
use_td=False,
targeting_rate=None,
keep_prob=None):
"""Bottleneck block variant for residual networks with BN after convolutions.
Args:
inputs: `Tensor` of size `[batch, channels, height, width]`.
filters: `int` number of filters for the first two convolutions. Note that
the third and final convolution will use 4 times as many filters.
is_training: `bool` for whether the model is in training.
projection_shortcut: `function` to use for projection shortcuts (typically
a 1x1 convolution to match the filter dimensions). If None, no
projection is used and the input is passed as unchanged through the
shortcut connection.
strides: `int` block stride. If greater than 1, this block will ultimately
downsample the input.
final_block: `bool` set to True if it is this the final block in the group.
This is changes the behavior of batch normalization initialization for
the final batch norm in a block.
data_format: `str` either "channels_first" for `[batch, channels, height,
width]` or "channels_last for `[batch, height, width, channels]`.
use_td: `str` one of "weight" or "unit". Set to False or "" to disable
targeted dropout.
targeting_rate: `float` proportion of weights to target with targeted
dropout.
keep_prob: `float` keep probability for targeted dropout.
Returns:
The output `Tensor` of the block.
"""
# TODO(chrisying): this block is technically the post-activation resnet-v1
# bottleneck unit. Test with v2 (pre-activation) and replace if there is no
# difference for consistency.
shortcut = inputs
if projection_shortcut is not None:
shortcut = projection_shortcut(inputs)
inputs = conv2d_fixed_padding(
inputs=inputs,
filters=filters,
kernel_size=1,
strides=1,
data_format=data_format,
use_td=use_td,
targeting_rate=targeting_rate,
keep_prob=keep_prob,
is_training=is_training)
inputs = batch_norm_relu(inputs, is_training, data_format=data_format)
inputs = conv2d_fixed_padding(
inputs=inputs,
filters=filters,
kernel_size=3,
strides=strides,
data_format=data_format,
use_td=use_td,
targeting_rate=targeting_rate,
keep_prob=keep_prob,
is_training=is_training)
inputs = batch_norm_relu(inputs, is_training, data_format=data_format)
inputs = conv2d_fixed_padding(
inputs=inputs,
filters=4 * filters,
kernel_size=1,
strides=1,
data_format=data_format,
use_td=use_td,
targeting_rate=targeting_rate,
keep_prob=keep_prob,
is_training=is_training)
inputs = batch_norm_relu(
inputs,
is_training,
relu=False,
init_zero=final_block,
data_format=data_format)
return tf.nn.relu(inputs + shortcut)
|
[
"def",
"bottleneck_block",
"(",
"inputs",
",",
"filters",
",",
"is_training",
",",
"projection_shortcut",
",",
"strides",
",",
"final_block",
",",
"data_format",
"=",
"\"channels_first\"",
",",
"use_td",
"=",
"False",
",",
"targeting_rate",
"=",
"None",
",",
"keep_prob",
"=",
"None",
")",
":",
"# TODO(chrisying): this block is technically the post-activation resnet-v1",
"# bottleneck unit. Test with v2 (pre-activation) and replace if there is no",
"# difference for consistency.",
"shortcut",
"=",
"inputs",
"if",
"projection_shortcut",
"is",
"not",
"None",
":",
"shortcut",
"=",
"projection_shortcut",
"(",
"inputs",
")",
"inputs",
"=",
"conv2d_fixed_padding",
"(",
"inputs",
"=",
"inputs",
",",
"filters",
"=",
"filters",
",",
"kernel_size",
"=",
"1",
",",
"strides",
"=",
"1",
",",
"data_format",
"=",
"data_format",
",",
"use_td",
"=",
"use_td",
",",
"targeting_rate",
"=",
"targeting_rate",
",",
"keep_prob",
"=",
"keep_prob",
",",
"is_training",
"=",
"is_training",
")",
"inputs",
"=",
"batch_norm_relu",
"(",
"inputs",
",",
"is_training",
",",
"data_format",
"=",
"data_format",
")",
"inputs",
"=",
"conv2d_fixed_padding",
"(",
"inputs",
"=",
"inputs",
",",
"filters",
"=",
"filters",
",",
"kernel_size",
"=",
"3",
",",
"strides",
"=",
"strides",
",",
"data_format",
"=",
"data_format",
",",
"use_td",
"=",
"use_td",
",",
"targeting_rate",
"=",
"targeting_rate",
",",
"keep_prob",
"=",
"keep_prob",
",",
"is_training",
"=",
"is_training",
")",
"inputs",
"=",
"batch_norm_relu",
"(",
"inputs",
",",
"is_training",
",",
"data_format",
"=",
"data_format",
")",
"inputs",
"=",
"conv2d_fixed_padding",
"(",
"inputs",
"=",
"inputs",
",",
"filters",
"=",
"4",
"*",
"filters",
",",
"kernel_size",
"=",
"1",
",",
"strides",
"=",
"1",
",",
"data_format",
"=",
"data_format",
",",
"use_td",
"=",
"use_td",
",",
"targeting_rate",
"=",
"targeting_rate",
",",
"keep_prob",
"=",
"keep_prob",
",",
"is_training",
"=",
"is_training",
")",
"inputs",
"=",
"batch_norm_relu",
"(",
"inputs",
",",
"is_training",
",",
"relu",
"=",
"False",
",",
"init_zero",
"=",
"final_block",
",",
"data_format",
"=",
"data_format",
")",
"return",
"tf",
".",
"nn",
".",
"relu",
"(",
"inputs",
"+",
"shortcut",
")"
] |
Bottleneck block variant for residual networks with BN after convolutions.
Args:
inputs: `Tensor` of size `[batch, channels, height, width]`.
filters: `int` number of filters for the first two convolutions. Note that
the third and final convolution will use 4 times as many filters.
is_training: `bool` for whether the model is in training.
projection_shortcut: `function` to use for projection shortcuts (typically
a 1x1 convolution to match the filter dimensions). If None, no
projection is used and the input is passed as unchanged through the
shortcut connection.
strides: `int` block stride. If greater than 1, this block will ultimately
downsample the input.
final_block: `bool` set to True if it is this the final block in the group.
This is changes the behavior of batch normalization initialization for
the final batch norm in a block.
data_format: `str` either "channels_first" for `[batch, channels, height,
width]` or "channels_last for `[batch, height, width, channels]`.
use_td: `str` one of "weight" or "unit". Set to False or "" to disable
targeted dropout.
targeting_rate: `float` proportion of weights to target with targeted
dropout.
keep_prob: `float` keep probability for targeted dropout.
Returns:
The output `Tensor` of the block.
|
[
"Bottleneck",
"block",
"variant",
"for",
"residual",
"networks",
"with",
"BN",
"after",
"convolutions",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/models/resnet.py#L260-L345
|
train
|
Bottleneck block variant for residual networks with BN after convolutions.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB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cessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + chr(0b1101001 + 0o6) + chr(2253 - 2203) + chr(51) + chr(157 - 104), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b111010 + 0o65) + chr(0b101011 + 0o11) + '\x31', ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(49) + '\x30', 0b1000), ehT0Px3KOsy9('\060' + chr(111) + '\x33' + '\065' + '\x32', 0o10), ehT0Px3KOsy9(chr(0b101001 + 0o7) + chr(1699 - 1588) + chr(0b110010) + chr(1510 - 1460) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(716 - 668) + chr(111) + '\061' + chr(0b100001 + 0o25) + '\064', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(1784 - 1730), 0o10), ehT0Px3KOsy9(chr(516 - 468) + chr(0b111111 + 0o60) + chr(51) + chr(53) + chr(837 - 788), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(50) + '\066' + chr(0b10 + 0o62), 0b1000), ehT0Px3KOsy9(chr(0b101011 + 0o5) + '\157' + '\x32' + chr(1954 - 1902) + chr(0b110111), 36943 - 36935), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(1094 - 1045) + chr(0b1 + 0o57) + chr(656 - 601), 44241 - 44233), ehT0Px3KOsy9('\060' + chr(0b1011010 + 0o25) + chr(0b111 + 0o53) + chr(0b101011 + 0o12) + chr(0b110001), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110010) + chr(525 - 476) + chr(0b110111), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + '\061' + '\062' + '\065', 0o10), ehT0Px3KOsy9('\060' + chr(1587 - 1476) + chr(0b110001) + '\x36' + chr(48), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110001) + chr(0b110111) + chr(0b110100), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + '\063' + chr(371 - 318) + '\x35', 0b1000), ehT0Px3KOsy9(chr(932 - 884) + '\x6f' + chr(0b110010) + chr(49) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(2123 - 2075) + '\157' + '\061' + chr(50) + chr(52), 22734 - 22726), ehT0Px3KOsy9('\x30' + chr(0b1100010 + 0o15) + chr(0b101000 + 0o12) + chr(0b110001) + chr(49), 5807 - 5799), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110010) + chr(1956 - 1903) + chr(0b101101 + 0o7), 57580 - 57572), ehT0Px3KOsy9('\060' + '\x6f' + '\066' + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(126 - 78) + chr(111) + '\x32' + chr(55) + chr(0b11010 + 0o33), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(52) + chr(0b110010), 26080 - 26072), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(905 - 854) + chr(124 - 76) + chr(0b110011), 8965 - 8957), ehT0Px3KOsy9(chr(0b100000 + 0o20) + chr(9241 - 9130) + chr(2066 - 2011) + chr(2853 - 2798), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110001) + chr(0b1000 + 0o54) + '\065', 0b1000), ehT0Px3KOsy9(chr(0b11001 + 0o27) + '\x6f' + '\061' + chr(52) + chr(1759 - 1704), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b110001 + 0o76) + chr(292 - 242) + chr(0b110001) + '\065', 43113 - 43105), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(51) + chr(257 - 206) + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b1000 + 0o53) + chr(0b110011) + chr(52), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b101000 + 0o13) + chr(0b110000) + chr(50), 58946 - 58938), ehT0Px3KOsy9(chr(0b110000) + chr(0b100100 + 0o113) + chr(51) + chr(0b1000 + 0o51) + '\064', 59051 - 59043), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110011) + chr(382 - 330) + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(0b11111 + 0o21) + '\157' + chr(52) + chr(0b1011 + 0o52), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b110 + 0o151) + chr(0b100001 + 0o22) + chr(1698 - 1649) + '\x33', 0o10), ehT0Px3KOsy9(chr(2195 - 2147) + chr(3600 - 3489) + '\063' + chr(766 - 711) + chr(52), 62745 - 62737), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(2274 - 2224) + chr(0b110110) + chr(50), 0o10), ehT0Px3KOsy9(chr(0b100 + 0o54) + chr(0b1101111) + chr(0b100 + 0o55) + '\067' + chr(731 - 681), 1230 - 1222), ehT0Px3KOsy9(chr(0b11010 + 0o26) + chr(111) + '\065' + chr(2190 - 2141), 42144 - 42136)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + chr(10753 - 10642) + '\x35' + chr(97 - 49), ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xb3'), '\x64' + chr(6325 - 6224) + chr(5766 - 5667) + '\157' + chr(9752 - 9652) + chr(0b1001101 + 0o30))('\x75' + chr(0b1110100) + chr(0b1100110) + chr(464 - 419) + '\070') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def E0umIBQ8_KeA(vXoupepMtCXU, MErh319F3bgE, XQJVi3cQFN5l, CGIr4VFYxKcQ, r8knJmMTTKwv, G4mC4N9ftCbi, ydIN5gIUKwpW=xafqLlk3kkUe(SXOLrMavuUCe(b'\xfeIi\x84\xfc\x11j\x9a\xeb\xc1.\xdb\xfc!'), chr(0b100111 + 0o75) + chr(0b1100101) + chr(6286 - 6187) + chr(0b1000100 + 0o53) + '\x64' + chr(9204 - 9103))('\165' + chr(9254 - 9138) + '\x66' + chr(45) + chr(2404 - 2348)), cvqVSw_Th5Qm=ehT0Px3KOsy9(chr(1945 - 1897) + chr(7415 - 7304) + chr(0b110000), 0b1000), ixa3U1BjAQ01=None, gHeP0t6GwBIV=None):
c4rbmmlcdkTg = vXoupepMtCXU
if CGIr4VFYxKcQ is not None:
c4rbmmlcdkTg = CGIr4VFYxKcQ(vXoupepMtCXU)
vXoupepMtCXU = HuscHDs811Ao(inputs=vXoupepMtCXU, filters=MErh319F3bgE, kernel_size=ehT0Px3KOsy9(chr(48) + '\157' + chr(1184 - 1135), 0o10), strides=ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(49), 8), data_format=ydIN5gIUKwpW, use_td=cvqVSw_Th5Qm, targeting_rate=ixa3U1BjAQ01, keep_prob=gHeP0t6GwBIV, is_training=XQJVi3cQFN5l)
vXoupepMtCXU = TWDBa8qX3MHR(vXoupepMtCXU, XQJVi3cQFN5l, data_format=ydIN5gIUKwpW)
vXoupepMtCXU = HuscHDs811Ao(inputs=vXoupepMtCXU, filters=MErh319F3bgE, kernel_size=ehT0Px3KOsy9(chr(0b111 + 0o51) + chr(111) + '\063', 0b1000), strides=r8knJmMTTKwv, data_format=ydIN5gIUKwpW, use_td=cvqVSw_Th5Qm, targeting_rate=ixa3U1BjAQ01, keep_prob=gHeP0t6GwBIV, is_training=XQJVi3cQFN5l)
vXoupepMtCXU = TWDBa8qX3MHR(vXoupepMtCXU, XQJVi3cQFN5l, data_format=ydIN5gIUKwpW)
vXoupepMtCXU = HuscHDs811Ao(inputs=vXoupepMtCXU, filters=ehT0Px3KOsy9(chr(2112 - 2064) + chr(0b111101 + 0o62) + chr(52), 0b1000) * MErh319F3bgE, kernel_size=ehT0Px3KOsy9('\060' + chr(0b101000 + 0o107) + chr(2193 - 2144), 8), strides=ehT0Px3KOsy9(chr(998 - 950) + chr(111) + chr(1683 - 1634), 8), data_format=ydIN5gIUKwpW, use_td=cvqVSw_Th5Qm, targeting_rate=ixa3U1BjAQ01, keep_prob=gHeP0t6GwBIV, is_training=XQJVi3cQFN5l)
vXoupepMtCXU = TWDBa8qX3MHR(vXoupepMtCXU, XQJVi3cQFN5l, relu=ehT0Px3KOsy9('\x30' + chr(10205 - 10094) + chr(2059 - 2011), 8), init_zero=G4mC4N9ftCbi, data_format=ydIN5gIUKwpW)
return xafqLlk3kkUe(IDJ2eXGCBCDu.nn, xafqLlk3kkUe(SXOLrMavuUCe(b'\xefDd\x9f'), chr(0b1011011 + 0o11) + chr(7000 - 6899) + '\143' + chr(0b1101111) + chr(6992 - 6892) + chr(0b11011 + 0o112))('\165' + chr(0b1110100) + chr(0b10101 + 0o121) + chr(1189 - 1144) + chr(109 - 53)))(vXoupepMtCXU + c4rbmmlcdkTg)
|
tensorflow/tensor2tensor
|
tensor2tensor/models/resnet.py
|
block_layer
|
def block_layer(inputs,
filters,
block_fn,
blocks,
strides,
is_training,
name,
data_format="channels_first",
use_td=False,
targeting_rate=None,
keep_prob=None):
"""Creates one layer of blocks for the ResNet model.
Args:
inputs: `Tensor` of size `[batch, channels, height, width]`.
filters: `int` number of filters for the first convolution of the layer.
block_fn: `function` for the block to use within the model
blocks: `int` number of blocks contained in the layer.
strides: `int` stride to use for the first convolution of the layer. If
greater than 1, this layer will downsample the input.
is_training: `bool` for whether the model is training.
name: `str`name for the Tensor output of the block layer.
data_format: `str` either "channels_first" for `[batch, channels, height,
width]` or "channels_last for `[batch, height, width, channels]`.
use_td: `str` one of "weight" or "unit". Set to False or "" to disable
targeted dropout.
targeting_rate: `float` proportion of weights to target with targeted
dropout.
keep_prob: `float` keep probability for targeted dropout.
Returns:
The output `Tensor` of the block layer.
"""
# Bottleneck blocks end with 4x the number of filters as they start with
filters_out = 4 * filters if block_fn is bottleneck_block else filters
def projection_shortcut(inputs):
"""Project identity branch."""
inputs = conv2d_fixed_padding(
inputs=inputs,
filters=filters_out,
kernel_size=1,
strides=strides,
data_format=data_format,
use_td=use_td,
targeting_rate=targeting_rate,
keep_prob=keep_prob,
is_training=is_training)
return batch_norm_relu(
inputs, is_training, relu=False, data_format=data_format)
# Only the first block per block_layer uses projection_shortcut and strides
inputs = block_fn(
inputs,
filters,
is_training,
projection_shortcut,
strides,
False,
data_format,
use_td=use_td,
targeting_rate=targeting_rate,
keep_prob=keep_prob)
for i in range(1, blocks):
inputs = block_fn(
inputs,
filters,
is_training,
None,
1, (i + 1 == blocks),
data_format,
use_td=use_td,
targeting_rate=targeting_rate,
keep_prob=keep_prob)
return tf.identity(inputs, name)
|
python
|
def block_layer(inputs,
filters,
block_fn,
blocks,
strides,
is_training,
name,
data_format="channels_first",
use_td=False,
targeting_rate=None,
keep_prob=None):
"""Creates one layer of blocks for the ResNet model.
Args:
inputs: `Tensor` of size `[batch, channels, height, width]`.
filters: `int` number of filters for the first convolution of the layer.
block_fn: `function` for the block to use within the model
blocks: `int` number of blocks contained in the layer.
strides: `int` stride to use for the first convolution of the layer. If
greater than 1, this layer will downsample the input.
is_training: `bool` for whether the model is training.
name: `str`name for the Tensor output of the block layer.
data_format: `str` either "channels_first" for `[batch, channels, height,
width]` or "channels_last for `[batch, height, width, channels]`.
use_td: `str` one of "weight" or "unit". Set to False or "" to disable
targeted dropout.
targeting_rate: `float` proportion of weights to target with targeted
dropout.
keep_prob: `float` keep probability for targeted dropout.
Returns:
The output `Tensor` of the block layer.
"""
# Bottleneck blocks end with 4x the number of filters as they start with
filters_out = 4 * filters if block_fn is bottleneck_block else filters
def projection_shortcut(inputs):
"""Project identity branch."""
inputs = conv2d_fixed_padding(
inputs=inputs,
filters=filters_out,
kernel_size=1,
strides=strides,
data_format=data_format,
use_td=use_td,
targeting_rate=targeting_rate,
keep_prob=keep_prob,
is_training=is_training)
return batch_norm_relu(
inputs, is_training, relu=False, data_format=data_format)
# Only the first block per block_layer uses projection_shortcut and strides
inputs = block_fn(
inputs,
filters,
is_training,
projection_shortcut,
strides,
False,
data_format,
use_td=use_td,
targeting_rate=targeting_rate,
keep_prob=keep_prob)
for i in range(1, blocks):
inputs = block_fn(
inputs,
filters,
is_training,
None,
1, (i + 1 == blocks),
data_format,
use_td=use_td,
targeting_rate=targeting_rate,
keep_prob=keep_prob)
return tf.identity(inputs, name)
|
[
"def",
"block_layer",
"(",
"inputs",
",",
"filters",
",",
"block_fn",
",",
"blocks",
",",
"strides",
",",
"is_training",
",",
"name",
",",
"data_format",
"=",
"\"channels_first\"",
",",
"use_td",
"=",
"False",
",",
"targeting_rate",
"=",
"None",
",",
"keep_prob",
"=",
"None",
")",
":",
"# Bottleneck blocks end with 4x the number of filters as they start with",
"filters_out",
"=",
"4",
"*",
"filters",
"if",
"block_fn",
"is",
"bottleneck_block",
"else",
"filters",
"def",
"projection_shortcut",
"(",
"inputs",
")",
":",
"\"\"\"Project identity branch.\"\"\"",
"inputs",
"=",
"conv2d_fixed_padding",
"(",
"inputs",
"=",
"inputs",
",",
"filters",
"=",
"filters_out",
",",
"kernel_size",
"=",
"1",
",",
"strides",
"=",
"strides",
",",
"data_format",
"=",
"data_format",
",",
"use_td",
"=",
"use_td",
",",
"targeting_rate",
"=",
"targeting_rate",
",",
"keep_prob",
"=",
"keep_prob",
",",
"is_training",
"=",
"is_training",
")",
"return",
"batch_norm_relu",
"(",
"inputs",
",",
"is_training",
",",
"relu",
"=",
"False",
",",
"data_format",
"=",
"data_format",
")",
"# Only the first block per block_layer uses projection_shortcut and strides",
"inputs",
"=",
"block_fn",
"(",
"inputs",
",",
"filters",
",",
"is_training",
",",
"projection_shortcut",
",",
"strides",
",",
"False",
",",
"data_format",
",",
"use_td",
"=",
"use_td",
",",
"targeting_rate",
"=",
"targeting_rate",
",",
"keep_prob",
"=",
"keep_prob",
")",
"for",
"i",
"in",
"range",
"(",
"1",
",",
"blocks",
")",
":",
"inputs",
"=",
"block_fn",
"(",
"inputs",
",",
"filters",
",",
"is_training",
",",
"None",
",",
"1",
",",
"(",
"i",
"+",
"1",
"==",
"blocks",
")",
",",
"data_format",
",",
"use_td",
"=",
"use_td",
",",
"targeting_rate",
"=",
"targeting_rate",
",",
"keep_prob",
"=",
"keep_prob",
")",
"return",
"tf",
".",
"identity",
"(",
"inputs",
",",
"name",
")"
] |
Creates one layer of blocks for the ResNet model.
Args:
inputs: `Tensor` of size `[batch, channels, height, width]`.
filters: `int` number of filters for the first convolution of the layer.
block_fn: `function` for the block to use within the model
blocks: `int` number of blocks contained in the layer.
strides: `int` stride to use for the first convolution of the layer. If
greater than 1, this layer will downsample the input.
is_training: `bool` for whether the model is training.
name: `str`name for the Tensor output of the block layer.
data_format: `str` either "channels_first" for `[batch, channels, height,
width]` or "channels_last for `[batch, height, width, channels]`.
use_td: `str` one of "weight" or "unit". Set to False or "" to disable
targeted dropout.
targeting_rate: `float` proportion of weights to target with targeted
dropout.
keep_prob: `float` keep probability for targeted dropout.
Returns:
The output `Tensor` of the block layer.
|
[
"Creates",
"one",
"layer",
"of",
"blocks",
"for",
"the",
"ResNet",
"model",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/models/resnet.py#L348-L424
|
train
|
Creates a block layer for the ResNet model.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd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h9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b100010 + 0o16) + chr(0b1101111) + '\x32' + '\x33' + '\x36', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1011011 + 0o24) + chr(456 - 405) + chr(1846 - 1796), ord("\x08")), ehT0Px3KOsy9(chr(0b10101 + 0o33) + chr(0b1100000 + 0o17) + chr(0b110010) + '\x33' + '\x35', 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(784 - 734) + chr(985 - 934) + chr(0b11110 + 0o24), ord("\x08")), ehT0Px3KOsy9(chr(0b101000 + 0o10) + chr(0b11001 + 0o126) + chr(49) + chr(55), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(9831 - 9720) + chr(0b110101) + chr(55), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110111) + chr(0b110101), 0o10), ehT0Px3KOsy9(chr(761 - 713) + chr(0b1101111) + '\061' + '\062' + chr(72 - 24), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1011010 + 0o25) + chr(1198 - 1145), 37764 - 37756), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x33' + chr(135 - 87) + chr(0b100011 + 0o22), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b10100 + 0o133) + chr(0b110010) + '\064' + chr(53), 0o10), ehT0Px3KOsy9(chr(0b10111 + 0o31) + chr(0b101100 + 0o103) + '\x31' + '\x33' + '\066', 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(50) + '\x35' + '\x30', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1100101 + 0o12) + chr(0b110001) + chr(0b11001 + 0o31) + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(0b11010 + 0o26) + chr(0b1101 + 0o142) + chr(50) + chr(829 - 779) + chr(676 - 626), 33758 - 33750), ehT0Px3KOsy9(chr(48) + chr(0b1100010 + 0o15) + '\063' + chr(1644 - 1591) + '\064', 0o10), ehT0Px3KOsy9('\x30' + chr(111) + '\x33' + chr(0b101 + 0o61) + '\065', 22373 - 22365), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(50) + chr(0b11 + 0o64) + chr(51), 28864 - 28856), ehT0Px3KOsy9(chr(48) + chr(0b1011100 + 0o23) + chr(0b110001) + chr(0b110111) + chr(0b1000 + 0o55), 0o10), ehT0Px3KOsy9(chr(1290 - 1242) + '\157' + '\x33' + chr(266 - 215) + '\x36', 0b1000), ehT0Px3KOsy9('\060' + chr(10835 - 10724) + '\x31' + '\x30' + '\061', 0o10), ehT0Px3KOsy9(chr(0b10 + 0o56) + '\157' + chr(0b11100 + 0o25), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110010) + chr(0b1000 + 0o50) + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(88 - 40) + chr(111) + chr(0b110011) + '\067' + chr(862 - 812), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x35' + chr(53), 58812 - 58804), ehT0Px3KOsy9(chr(0b1 + 0o57) + '\x6f' + chr(0b101101 + 0o6) + chr(0b10100 + 0o36) + chr(886 - 834), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b101001 + 0o10) + chr(0b110000) + '\x37', 0o10), ehT0Px3KOsy9(chr(0b101100 + 0o4) + chr(111) + '\062' + '\063' + '\067', 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110011) + '\x34' + '\066', 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + '\x32' + chr(54) + chr(154 - 104), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110010) + '\060' + chr(735 - 680), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(51) + chr(0b10111 + 0o32) + '\x33', ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + '\x31' + chr(0b100101 + 0o20) + chr(2513 - 2462), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1011001 + 0o26) + chr(0b110001) + chr(0b110010) + chr(1954 - 1904), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110010) + chr(0b100010 + 0o22), 43152 - 43144), ehT0Px3KOsy9(chr(2123 - 2075) + chr(0b1101111) + chr(0b100011 + 0o16) + chr(1463 - 1413) + chr(2132 - 2083), 0o10), ehT0Px3KOsy9('\x30' + chr(5087 - 4976) + '\061' + '\060' + chr(0b110101), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(0b110001) + chr(0b110011) + chr(2124 - 2070), 8), ehT0Px3KOsy9('\060' + chr(1007 - 896) + '\062' + chr(228 - 178) + '\065', 0o10), ehT0Px3KOsy9('\060' + chr(4957 - 4846) + chr(0b110001) + chr(0b110011) + '\065', 32266 - 32258)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(981 - 933) + chr(205 - 94) + chr(0b100110 + 0o17) + chr(2137 - 2089), 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xb0'), '\x64' + chr(0b101001 + 0o74) + '\x63' + '\x6f' + chr(752 - 652) + '\145')(chr(0b1110101) + '\164' + chr(0b1100110) + '\055' + chr(0b100000 + 0o30)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def SqD5Wlqi3VQ_(vXoupepMtCXU, MErh319F3bgE, cPTxFkUGUZcO, BCMwZlRkxOMF, r8knJmMTTKwv, XQJVi3cQFN5l, AIvJRzLdDfgF, ydIN5gIUKwpW=xafqLlk3kkUe(SXOLrMavuUCe(b'\xfdr\xfc\xf4aJQ#Z\xa3\xcc,\xdb"'), chr(0b1001101 + 0o27) + chr(0b1100101) + chr(8484 - 8385) + '\x6f' + '\x64' + chr(3582 - 3481))('\x75' + '\x74' + chr(102) + '\x2d' + '\x38'), cvqVSw_Th5Qm=ehT0Px3KOsy9(chr(0b10101 + 0o33) + chr(111) + chr(0b101010 + 0o6), 0o10), ixa3U1BjAQ01=None, gHeP0t6GwBIV=None):
MqwOAHaNR2cg = ehT0Px3KOsy9(chr(48) + chr(0b1011000 + 0o27) + '\064', 45198 - 45190) * MErh319F3bgE if cPTxFkUGUZcO is E0umIBQ8_KeA else MErh319F3bgE
def CGIr4VFYxKcQ(vXoupepMtCXU):
vXoupepMtCXU = HuscHDs811Ao(inputs=vXoupepMtCXU, filters=MqwOAHaNR2cg, kernel_size=ehT0Px3KOsy9(chr(48) + '\157' + chr(0b111 + 0o52), 8), strides=r8knJmMTTKwv, data_format=ydIN5gIUKwpW, use_td=cvqVSw_Th5Qm, targeting_rate=ixa3U1BjAQ01, keep_prob=gHeP0t6GwBIV, is_training=XQJVi3cQFN5l)
return TWDBa8qX3MHR(vXoupepMtCXU, XQJVi3cQFN5l, relu=ehT0Px3KOsy9('\060' + '\157' + chr(48), 8), data_format=ydIN5gIUKwpW)
vXoupepMtCXU = cPTxFkUGUZcO(vXoupepMtCXU, MErh319F3bgE, XQJVi3cQFN5l, CGIr4VFYxKcQ, r8knJmMTTKwv, ehT0Px3KOsy9(chr(0b110000) + chr(3399 - 3288) + chr(48), 8), ydIN5gIUKwpW, use_td=cvqVSw_Th5Qm, targeting_rate=ixa3U1BjAQ01, keep_prob=gHeP0t6GwBIV)
for WVxHKyX45z_L in vQr8gNKaIaWE(ehT0Px3KOsy9(chr(0b1101 + 0o43) + chr(0b1101111) + chr(1292 - 1243), 8), BCMwZlRkxOMF):
vXoupepMtCXU = cPTxFkUGUZcO(vXoupepMtCXU, MErh319F3bgE, XQJVi3cQFN5l, None, ehT0Px3KOsy9('\x30' + '\157' + chr(0b110001), 8), WVxHKyX45z_L + ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\061', 8) == BCMwZlRkxOMF, ydIN5gIUKwpW, use_td=cvqVSw_Th5Qm, targeting_rate=ixa3U1BjAQ01, keep_prob=gHeP0t6GwBIV)
return xafqLlk3kkUe(IDJ2eXGCBCDu, xafqLlk3kkUe(SXOLrMavuUCe(b'\xe8\\\xc8\xdd:Bv\x08f\xb3\xfc\x19'), chr(0b10110 + 0o116) + chr(0b1100101) + '\x63' + '\x6f' + chr(0b1100100) + '\145')(chr(0b1110101) + '\x74' + '\146' + chr(45) + chr(0b111000)))(vXoupepMtCXU, AIvJRzLdDfgF)
|
tensorflow/tensor2tensor
|
tensor2tensor/models/resnet.py
|
resnet_v2
|
def resnet_v2(inputs,
block_fn,
layer_blocks,
filters,
data_format="channels_first",
is_training=False,
is_cifar=False,
use_td=False,
targeting_rate=None,
keep_prob=None):
"""Resnet model.
Args:
inputs: `Tensor` images.
block_fn: `function` for the block to use within the model. Either
`residual_block` or `bottleneck_block`.
layer_blocks: list of 3 or 4 `int`s denoting the number of blocks to include
in each of the 3 or 4 block groups. Each group consists of blocks that
take inputs of the same resolution.
filters: list of 4 or 5 `int`s denoting the number of filter to include in
block.
data_format: `str`, "channels_first" `[batch, channels, height,
width]` or "channels_last" `[batch, height, width, channels]`.
is_training: bool, build in training mode or not.
is_cifar: bool, whether the data is CIFAR or not.
use_td: `str` one of "weight" or "unit". Set to False or "" to disable
targeted dropout.
targeting_rate: `float` proportion of weights to target with targeted
dropout.
keep_prob: `float` keep probability for targeted dropout.
Returns:
Pre-logit activations.
"""
inputs = block_layer(
inputs=inputs,
filters=filters[1],
block_fn=block_fn,
blocks=layer_blocks[0],
strides=1,
is_training=is_training,
name="block_layer1",
data_format=data_format,
use_td=use_td,
targeting_rate=targeting_rate,
keep_prob=keep_prob)
inputs = block_layer(
inputs=inputs,
filters=filters[2],
block_fn=block_fn,
blocks=layer_blocks[1],
strides=2,
is_training=is_training,
name="block_layer2",
data_format=data_format,
use_td=use_td,
targeting_rate=targeting_rate,
keep_prob=keep_prob)
inputs = block_layer(
inputs=inputs,
filters=filters[3],
block_fn=block_fn,
blocks=layer_blocks[2],
strides=2,
is_training=is_training,
name="block_layer3",
data_format=data_format,
use_td=use_td,
targeting_rate=targeting_rate,
keep_prob=keep_prob)
if not is_cifar:
inputs = block_layer(
inputs=inputs,
filters=filters[4],
block_fn=block_fn,
blocks=layer_blocks[3],
strides=2,
is_training=is_training,
name="block_layer4",
data_format=data_format,
use_td=use_td,
targeting_rate=targeting_rate,
keep_prob=keep_prob)
return inputs
|
python
|
def resnet_v2(inputs,
block_fn,
layer_blocks,
filters,
data_format="channels_first",
is_training=False,
is_cifar=False,
use_td=False,
targeting_rate=None,
keep_prob=None):
"""Resnet model.
Args:
inputs: `Tensor` images.
block_fn: `function` for the block to use within the model. Either
`residual_block` or `bottleneck_block`.
layer_blocks: list of 3 or 4 `int`s denoting the number of blocks to include
in each of the 3 or 4 block groups. Each group consists of blocks that
take inputs of the same resolution.
filters: list of 4 or 5 `int`s denoting the number of filter to include in
block.
data_format: `str`, "channels_first" `[batch, channels, height,
width]` or "channels_last" `[batch, height, width, channels]`.
is_training: bool, build in training mode or not.
is_cifar: bool, whether the data is CIFAR or not.
use_td: `str` one of "weight" or "unit". Set to False or "" to disable
targeted dropout.
targeting_rate: `float` proportion of weights to target with targeted
dropout.
keep_prob: `float` keep probability for targeted dropout.
Returns:
Pre-logit activations.
"""
inputs = block_layer(
inputs=inputs,
filters=filters[1],
block_fn=block_fn,
blocks=layer_blocks[0],
strides=1,
is_training=is_training,
name="block_layer1",
data_format=data_format,
use_td=use_td,
targeting_rate=targeting_rate,
keep_prob=keep_prob)
inputs = block_layer(
inputs=inputs,
filters=filters[2],
block_fn=block_fn,
blocks=layer_blocks[1],
strides=2,
is_training=is_training,
name="block_layer2",
data_format=data_format,
use_td=use_td,
targeting_rate=targeting_rate,
keep_prob=keep_prob)
inputs = block_layer(
inputs=inputs,
filters=filters[3],
block_fn=block_fn,
blocks=layer_blocks[2],
strides=2,
is_training=is_training,
name="block_layer3",
data_format=data_format,
use_td=use_td,
targeting_rate=targeting_rate,
keep_prob=keep_prob)
if not is_cifar:
inputs = block_layer(
inputs=inputs,
filters=filters[4],
block_fn=block_fn,
blocks=layer_blocks[3],
strides=2,
is_training=is_training,
name="block_layer4",
data_format=data_format,
use_td=use_td,
targeting_rate=targeting_rate,
keep_prob=keep_prob)
return inputs
|
[
"def",
"resnet_v2",
"(",
"inputs",
",",
"block_fn",
",",
"layer_blocks",
",",
"filters",
",",
"data_format",
"=",
"\"channels_first\"",
",",
"is_training",
"=",
"False",
",",
"is_cifar",
"=",
"False",
",",
"use_td",
"=",
"False",
",",
"targeting_rate",
"=",
"None",
",",
"keep_prob",
"=",
"None",
")",
":",
"inputs",
"=",
"block_layer",
"(",
"inputs",
"=",
"inputs",
",",
"filters",
"=",
"filters",
"[",
"1",
"]",
",",
"block_fn",
"=",
"block_fn",
",",
"blocks",
"=",
"layer_blocks",
"[",
"0",
"]",
",",
"strides",
"=",
"1",
",",
"is_training",
"=",
"is_training",
",",
"name",
"=",
"\"block_layer1\"",
",",
"data_format",
"=",
"data_format",
",",
"use_td",
"=",
"use_td",
",",
"targeting_rate",
"=",
"targeting_rate",
",",
"keep_prob",
"=",
"keep_prob",
")",
"inputs",
"=",
"block_layer",
"(",
"inputs",
"=",
"inputs",
",",
"filters",
"=",
"filters",
"[",
"2",
"]",
",",
"block_fn",
"=",
"block_fn",
",",
"blocks",
"=",
"layer_blocks",
"[",
"1",
"]",
",",
"strides",
"=",
"2",
",",
"is_training",
"=",
"is_training",
",",
"name",
"=",
"\"block_layer2\"",
",",
"data_format",
"=",
"data_format",
",",
"use_td",
"=",
"use_td",
",",
"targeting_rate",
"=",
"targeting_rate",
",",
"keep_prob",
"=",
"keep_prob",
")",
"inputs",
"=",
"block_layer",
"(",
"inputs",
"=",
"inputs",
",",
"filters",
"=",
"filters",
"[",
"3",
"]",
",",
"block_fn",
"=",
"block_fn",
",",
"blocks",
"=",
"layer_blocks",
"[",
"2",
"]",
",",
"strides",
"=",
"2",
",",
"is_training",
"=",
"is_training",
",",
"name",
"=",
"\"block_layer3\"",
",",
"data_format",
"=",
"data_format",
",",
"use_td",
"=",
"use_td",
",",
"targeting_rate",
"=",
"targeting_rate",
",",
"keep_prob",
"=",
"keep_prob",
")",
"if",
"not",
"is_cifar",
":",
"inputs",
"=",
"block_layer",
"(",
"inputs",
"=",
"inputs",
",",
"filters",
"=",
"filters",
"[",
"4",
"]",
",",
"block_fn",
"=",
"block_fn",
",",
"blocks",
"=",
"layer_blocks",
"[",
"3",
"]",
",",
"strides",
"=",
"2",
",",
"is_training",
"=",
"is_training",
",",
"name",
"=",
"\"block_layer4\"",
",",
"data_format",
"=",
"data_format",
",",
"use_td",
"=",
"use_td",
",",
"targeting_rate",
"=",
"targeting_rate",
",",
"keep_prob",
"=",
"keep_prob",
")",
"return",
"inputs"
] |
Resnet model.
Args:
inputs: `Tensor` images.
block_fn: `function` for the block to use within the model. Either
`residual_block` or `bottleneck_block`.
layer_blocks: list of 3 or 4 `int`s denoting the number of blocks to include
in each of the 3 or 4 block groups. Each group consists of blocks that
take inputs of the same resolution.
filters: list of 4 or 5 `int`s denoting the number of filter to include in
block.
data_format: `str`, "channels_first" `[batch, channels, height,
width]` or "channels_last" `[batch, height, width, channels]`.
is_training: bool, build in training mode or not.
is_cifar: bool, whether the data is CIFAR or not.
use_td: `str` one of "weight" or "unit". Set to False or "" to disable
targeted dropout.
targeting_rate: `float` proportion of weights to target with targeted
dropout.
keep_prob: `float` keep probability for targeted dropout.
Returns:
Pre-logit activations.
|
[
"Resnet",
"model",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/models/resnet.py#L427-L511
|
train
|
Resnet model for v2.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDASQ0Qkq,NL8dtWOpbcjF,_bikzMuRfbJG,sznFqDbNBHlx,ZsDPvpP4xdo3,cW7yQuyEnJ6E,KOHQGQ8qLDWm,NE1Yam2HHroQ,ygAzbDzrvRMh,SBRjvOU1ufVC,hOkXjmluKZfJ,q1QCh3W88sgk,TLbJ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An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\063' + chr(51) + '\063', 8784 - 8776), ehT0Px3KOsy9(chr(0b100000 + 0o20) + '\157' + chr(0b110011) + '\064' + chr(2038 - 1989), 33486 - 33478), ehT0Px3KOsy9(chr(0b1100 + 0o44) + '\157' + '\x32' + chr(0b110010) + chr(0b1011 + 0o53), 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(2036 - 1985) + '\x33' + '\x36', 11134 - 11126), ehT0Px3KOsy9(chr(48) + chr(9180 - 9069) + chr(0b11010 + 0o27) + chr(0b110101), 0b1000), ehT0Px3KOsy9(chr(1616 - 1568) + chr(0b1000011 + 0o54) + chr(0b100001 + 0o21) + chr(52) + '\x33', 41860 - 41852), ehT0Px3KOsy9(chr(0b110000) + chr(0b11101 + 0o122) + chr(0b110001) + '\064' + '\x31', 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(2200 - 2150) + chr(52) + '\x34', ord("\x08")), ehT0Px3KOsy9(chr(0b100000 + 0o20) + chr(2856 - 2745) + '\061' + chr(0b110011) + '\060', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(8114 - 8003) + chr(0b11010 + 0o33) + chr(0b1100 + 0o51), 22711 - 22703), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\062' + '\063' + chr(0b110111), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(2724 - 2670) + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + '\x31' + chr(0b110000 + 0o5) + chr(48), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + '\x32' + chr(51) + '\063', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1001110 + 0o41) + chr(0b110011) + chr(0b10000 + 0o44) + '\x34', ord("\x08")), ehT0Px3KOsy9(chr(0b100 + 0o54) + chr(8909 - 8798) + chr(0b110110), ord("\x08")), ehT0Px3KOsy9(chr(0b100110 + 0o12) + '\157' + chr(755 - 705) + chr(2439 - 2386) + chr(55), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x33' + '\063' + chr(1426 - 1375), 8), ehT0Px3KOsy9('\060' + '\x6f' + chr(50) + chr(2582 - 2529) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(50) + '\065' + chr(0b100110 + 0o21), 8), ehT0Px3KOsy9('\x30' + chr(5225 - 5114) + chr(0b110001) + chr(0b11111 + 0o22) + chr(0b10101 + 0o41), 0b1000), ehT0Px3KOsy9(chr(0b100111 + 0o11) + chr(0b101011 + 0o104) + '\061' + chr(48) + '\065', 12855 - 12847), ehT0Px3KOsy9(chr(0b11100 + 0o24) + chr(9658 - 9547) + chr(1145 - 1094) + '\x31' + chr(0b11110 + 0o30), 0o10), ehT0Px3KOsy9(chr(769 - 721) + chr(111) + chr(0b1100 + 0o51) + '\x33', 0b1000), ehT0Px3KOsy9('\x30' + chr(2544 - 2433) + chr(0b110001) + '\067' + chr(0b11110 + 0o22), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + '\061' + chr(52) + chr(0b11001 + 0o33), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b100 + 0o153) + '\063' + chr(0b1000 + 0o52) + '\062', 0o10), ehT0Px3KOsy9(chr(0b1000 + 0o50) + '\157' + chr(0b1001 + 0o50) + chr(51) + chr(91 - 37), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + '\061' + chr(0b110111) + '\x33', ord("\x08")), ehT0Px3KOsy9(chr(0b10110 + 0o32) + chr(111) + chr(50) + chr(54) + '\066', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b101101 + 0o102) + '\x31' + '\x32' + chr(639 - 586), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110010) + chr(0b100100 + 0o21) + chr(1203 - 1152), ord("\x08")), ehT0Px3KOsy9(chr(2046 - 1998) + chr(8879 - 8768) + chr(0b110001) + chr(53) + '\x30', 8), ehT0Px3KOsy9(chr(488 - 440) + chr(0b101111 + 0o100) + chr(0b10000 + 0o41) + chr(1859 - 1806) + chr(1423 - 1371), 61704 - 61696), ehT0Px3KOsy9('\060' + '\157' + chr(0b100011 + 0o17) + chr(811 - 759), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + '\061' + chr(2160 - 2110) + '\064', 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(204 - 154) + chr(54) + chr(50), 0o10), ehT0Px3KOsy9(chr(0b10 + 0o56) + '\x6f' + chr(0b11111 + 0o23) + '\x37' + '\x33', 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(1784 - 1734), 19621 - 19613), ehT0Px3KOsy9(chr(0b110000) + chr(0b10011 + 0o134) + '\x33' + '\x35' + chr(0b11100 + 0o31), ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + chr(111) + '\x35' + chr(0b11000 + 0o30), 65267 - 65259)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xf5'), '\x64' + '\x65' + '\143' + chr(0b111110 + 0o61) + chr(8978 - 8878) + chr(0b100 + 0o141))('\x75' + chr(0b100100 + 0o120) + '\x66' + chr(0b101101) + chr(56)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def mt3G9JIBWBfR(vXoupepMtCXU, cPTxFkUGUZcO, HfvM5t6svSmk, MErh319F3bgE, ydIN5gIUKwpW=xafqLlk3kkUe(SXOLrMavuUCe(b'\xb8\x89\xf7\xb0c\xc6\r\xd7\x07K\xf6F\x1b\xef'), chr(8831 - 8731) + '\145' + '\x63' + '\x6f' + '\144' + '\x65')(chr(0b1110101) + chr(0b1110100) + chr(5369 - 5267) + chr(45) + chr(56)), XQJVi3cQFN5l=ehT0Px3KOsy9(chr(1283 - 1235) + chr(4496 - 4385) + '\x30', 0b1000), j7HQiRo8CfFh=ehT0Px3KOsy9('\x30' + chr(0b1001 + 0o146) + chr(0b110000), 8), cvqVSw_Th5Qm=ehT0Px3KOsy9(chr(2257 - 2209) + '\x6f' + '\x30', 8), ixa3U1BjAQ01=None, gHeP0t6GwBIV=None):
vXoupepMtCXU = SqD5Wlqi3VQ_(inputs=vXoupepMtCXU, filters=MErh319F3bgE[ehT0Px3KOsy9(chr(48) + '\157' + '\061', 14421 - 14413)], block_fn=cPTxFkUGUZcO, blocks=HfvM5t6svSmk[ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(110 - 62), 8)], strides=ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x31', 8), is_training=XQJVi3cQFN5l, name=xafqLlk3kkUe(SXOLrMavuUCe(b'\xb9\x8d\xf9\xbdf\xfc\r\xc5!H\xed\x05'), chr(0b1100100) + chr(0b1100101) + chr(0b111001 + 0o52) + '\157' + chr(2509 - 2409) + '\x65')('\165' + chr(0b1110100) + '\146' + chr(45) + '\070'), data_format=ydIN5gIUKwpW, use_td=cvqVSw_Th5Qm, targeting_rate=ixa3U1BjAQ01, keep_prob=gHeP0t6GwBIV)
vXoupepMtCXU = SqD5Wlqi3VQ_(inputs=vXoupepMtCXU, filters=MErh319F3bgE[ehT0Px3KOsy9(chr(0b11011 + 0o25) + chr(0b1000100 + 0o53) + chr(2006 - 1956), 8)], block_fn=cPTxFkUGUZcO, blocks=HfvM5t6svSmk[ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\061', 8)], strides=ehT0Px3KOsy9(chr(0b1011 + 0o45) + chr(0b1101111) + chr(0b110010), 8), is_training=XQJVi3cQFN5l, name=xafqLlk3kkUe(SXOLrMavuUCe(b'\xb9\x8d\xf9\xbdf\xfc\r\xc5!H\xed\x06'), '\x64' + '\145' + '\x63' + '\157' + chr(0b111110 + 0o46) + chr(101))(chr(4069 - 3952) + chr(0b101100 + 0o110) + '\x66' + chr(0b100110 + 0o7) + '\070'), data_format=ydIN5gIUKwpW, use_td=cvqVSw_Th5Qm, targeting_rate=ixa3U1BjAQ01, keep_prob=gHeP0t6GwBIV)
vXoupepMtCXU = SqD5Wlqi3VQ_(inputs=vXoupepMtCXU, filters=MErh319F3bgE[ehT0Px3KOsy9(chr(0b11100 + 0o24) + '\x6f' + '\063', 429 - 421)], block_fn=cPTxFkUGUZcO, blocks=HfvM5t6svSmk[ehT0Px3KOsy9(chr(0b110000) + chr(1491 - 1380) + chr(0b101001 + 0o11), 8)], strides=ehT0Px3KOsy9(chr(0b110000) + chr(0b1110 + 0o141) + '\x32', 8), is_training=XQJVi3cQFN5l, name=xafqLlk3kkUe(SXOLrMavuUCe(b'\xb9\x8d\xf9\xbdf\xfc\r\xc5!H\xed\x07'), chr(100) + chr(101) + '\143' + chr(0b1101111) + chr(100) + chr(855 - 754))('\x75' + chr(0b1110100) + chr(0b1100110) + '\055' + chr(910 - 854)), data_format=ydIN5gIUKwpW, use_td=cvqVSw_Th5Qm, targeting_rate=ixa3U1BjAQ01, keep_prob=gHeP0t6GwBIV)
if not j7HQiRo8CfFh:
vXoupepMtCXU = SqD5Wlqi3VQ_(inputs=vXoupepMtCXU, filters=MErh319F3bgE[ehT0Px3KOsy9(chr(0b100011 + 0o15) + '\157' + chr(0b11010 + 0o32), ord("\x08"))], block_fn=cPTxFkUGUZcO, blocks=HfvM5t6svSmk[ehT0Px3KOsy9('\x30' + chr(111) + chr(0b10111 + 0o34), 8)], strides=ehT0Px3KOsy9('\060' + chr(8813 - 8702) + '\062', 8), is_training=XQJVi3cQFN5l, name=xafqLlk3kkUe(SXOLrMavuUCe(b'\xb9\x8d\xf9\xbdf\xfc\r\xc5!H\xed\x00'), '\x64' + '\x65' + '\x63' + chr(0b1110 + 0o141) + chr(0b1000001 + 0o43) + chr(101))('\x75' + chr(116) + '\146' + chr(0b11110 + 0o17) + '\070'), data_format=ydIN5gIUKwpW, use_td=cvqVSw_Th5Qm, targeting_rate=ixa3U1BjAQ01, keep_prob=gHeP0t6GwBIV)
return vXoupepMtCXU
|
tensorflow/tensor2tensor
|
tensor2tensor/models/resnet.py
|
resnet_imagenet_34_td_weight_05_05
|
def resnet_imagenet_34_td_weight_05_05():
"""Set of hyperparameters."""
hp = resnet_imagenet_34()
hp.use_td = "weight"
hp.targeting_rate = 0.5
hp.keep_prob = 0.5
return hp
|
python
|
def resnet_imagenet_34_td_weight_05_05():
"""Set of hyperparameters."""
hp = resnet_imagenet_34()
hp.use_td = "weight"
hp.targeting_rate = 0.5
hp.keep_prob = 0.5
return hp
|
[
"def",
"resnet_imagenet_34_td_weight_05_05",
"(",
")",
":",
"hp",
"=",
"resnet_imagenet_34",
"(",
")",
"hp",
".",
"use_td",
"=",
"\"weight\"",
"hp",
".",
"targeting_rate",
"=",
"0.5",
"hp",
".",
"keep_prob",
"=",
"0.5",
"return",
"hp"
] |
Set of hyperparameters.
|
[
"Set",
"of",
"hyperparameters",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/models/resnet.py#L679-L686
|
train
|
Set of hyperparameters for Theta - Weight 5. 5.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2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ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\060' + chr(5749 - 5638) + chr(447 - 398) + chr(1135 - 1085) + chr(0b110011), 35780 - 35772), ehT0Px3KOsy9('\x30' + chr(1782 - 1671) + '\062' + chr(396 - 342) + '\x33', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110101) + chr(48), 36345 - 36337), ehT0Px3KOsy9(chr(1569 - 1521) + '\157' + chr(49) + chr(0b1110 + 0o46) + chr(736 - 681), 18323 - 18315), ehT0Px3KOsy9('\x30' + chr(0b1011100 + 0o23) + chr(0b11000 + 0o32) + chr(0b110010) + '\060', 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(49) + chr(1363 - 1312) + chr(53), 57902 - 57894), ehT0Px3KOsy9('\060' + chr(0b101111 + 0o100) + '\x32' + chr(0b110111) + chr(48), 0b1000), ehT0Px3KOsy9(chr(0b11100 + 0o24) + chr(4657 - 4546) + chr(50) + chr(0b110111) + '\060', 8), ehT0Px3KOsy9(chr(48) + '\157' + chr(1536 - 1487) + chr(0b110110), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101011 + 0o4) + '\x33' + chr(0b110010) + '\x36', 45265 - 45257), ehT0Px3KOsy9(chr(0b10 + 0o56) + '\x6f' + chr(0b100111 + 0o20), 0b1000), ehT0Px3KOsy9(chr(707 - 659) + chr(0b1010 + 0o145) + chr(931 - 880) + chr(54) + chr(131 - 76), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111 + 0o0) + '\061' + chr(1593 - 1545) + chr(0b11100 + 0o26), 45630 - 45622), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(50) + '\x36' + '\066', ord("\x08")), ehT0Px3KOsy9(chr(0b100000 + 0o20) + chr(8655 - 8544) + '\x33' + '\x32', 0o10), ehT0Px3KOsy9('\x30' + chr(0b1001111 + 0o40) + chr(0b100110 + 0o15) + chr(0b11 + 0o64) + '\x34', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b101001 + 0o11) + chr(0b101111 + 0o2) + chr(1022 - 969), 16952 - 16944), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b10111 + 0o33) + '\x30' + chr(759 - 704), 59638 - 59630), ehT0Px3KOsy9(chr(63 - 15) + chr(7627 - 7516) + '\062' + '\x33' + chr(52), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + '\x32' + chr(0b11010 + 0o34) + '\x31', 51783 - 51775), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b111 + 0o55) + '\067', 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110001) + chr(51) + '\067', 0b1000), ehT0Px3KOsy9(chr(0b111 + 0o51) + chr(111) + chr(50) + '\x37' + '\x31', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1011100 + 0o23) + '\x31' + chr(0b110100) + chr(51), 48623 - 48615), ehT0Px3KOsy9(chr(0b101001 + 0o7) + chr(0b100001 + 0o116) + chr(863 - 814) + chr(0b110001) + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(0b100000 + 0o20) + chr(0b110001 + 0o76) + chr(0b101010 + 0o11) + '\x34', 0b1000), ehT0Px3KOsy9(chr(0b10001 + 0o37) + '\x6f' + '\x32' + chr(52) + '\x37', 0b1000), ehT0Px3KOsy9(chr(0b101011 + 0o5) + '\157' + chr(2495 - 2444) + chr(0b110000) + chr(0b10100 + 0o40), 0b1000), ehT0Px3KOsy9('\060' + chr(10621 - 10510) + chr(49) + chr(48) + chr(1795 - 1745), 8), ehT0Px3KOsy9('\060' + '\157' + '\063' + chr(1028 - 974) + chr(49), 0o10), ehT0Px3KOsy9('\x30' + chr(7365 - 7254) + chr(0b10010 + 0o37), 2230 - 2222), ehT0Px3KOsy9('\x30' + chr(3859 - 3748) + '\x31' + chr(53) + chr(0b1100 + 0o44), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110010) + chr(48) + '\066', 0o10), ehT0Px3KOsy9('\x30' + chr(0b111101 + 0o62) + '\062' + '\x35' + '\x34', 0o10), ehT0Px3KOsy9(chr(2301 - 2253) + chr(111) + '\062' + chr(1121 - 1072) + chr(52), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(50) + chr(0b110001) + '\066', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(747 - 697) + chr(346 - 292) + chr(0b110011), 8), ehT0Px3KOsy9(chr(1437 - 1389) + '\157' + '\061' + chr(0b110001) + chr(816 - 765), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1011111 + 0o20) + '\x33' + '\063' + '\064', 3663 - 3655), ehT0Px3KOsy9('\x30' + '\x6f' + '\063' + chr(0b10100 + 0o34) + chr(0b110111), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + '\157' + chr(0b110101) + chr(0b100110 + 0o12), 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'}'), chr(0b1100100) + chr(6397 - 6296) + '\x63' + '\x6f' + '\x64' + '\145')('\165' + '\164' + chr(0b100001 + 0o105) + '\x2d' + chr(56)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def T2xxmMAycKWT():
ny6shRSJO9Wm = I8Rje5vhkEqd()
ny6shRSJO9Wm.cvqVSw_Th5Qm = xafqLlk3kkUe(SXOLrMavuUCe(b'$\xd6A\x00\xf8)'), chr(0b1100100) + '\x65' + chr(0b1100011) + '\x6f' + '\x64' + chr(6940 - 6839))('\165' + chr(0b10011 + 0o141) + chr(0b1010010 + 0o24) + chr(0b1010 + 0o43) + '\x38')
ny6shRSJO9Wm.ixa3U1BjAQ01 = 0.5
ny6shRSJO9Wm.gHeP0t6GwBIV = 0.5
return ny6shRSJO9Wm
|
tensorflow/tensor2tensor
|
tensor2tensor/models/resnet.py
|
resnet_imagenet_34_td_unit_05_05
|
def resnet_imagenet_34_td_unit_05_05():
"""Set of hyperparameters."""
hp = resnet_imagenet_34()
hp.use_td = "unit"
hp.targeting_rate = 0.5
hp.keep_prob = 0.5
return hp
|
python
|
def resnet_imagenet_34_td_unit_05_05():
"""Set of hyperparameters."""
hp = resnet_imagenet_34()
hp.use_td = "unit"
hp.targeting_rate = 0.5
hp.keep_prob = 0.5
return hp
|
[
"def",
"resnet_imagenet_34_td_unit_05_05",
"(",
")",
":",
"hp",
"=",
"resnet_imagenet_34",
"(",
")",
"hp",
".",
"use_td",
"=",
"\"unit\"",
"hp",
".",
"targeting_rate",
"=",
"0.5",
"hp",
".",
"keep_prob",
"=",
"0.5",
"return",
"hp"
] |
Set of hyperparameters.
|
[
"Set",
"of",
"hyperparameters",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensor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pv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(48) + chr(111) + chr(324 - 273) + chr(0b110111) + chr(2680 - 2627), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(417 - 366) + chr(0b110001 + 0o3) + chr(0b110000), 56285 - 56277), ehT0Px3KOsy9(chr(0b110 + 0o52) + '\157' + chr(0b1101 + 0o52) + chr(0b100011 + 0o24), 0o10), ehT0Px3KOsy9('\060' + chr(0b110001 + 0o76) + '\x33' + '\x32' + chr(55), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(53) + chr(0b11100 + 0o27), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x32' + chr(53) + chr(52), 40786 - 40778), ehT0Px3KOsy9(chr(48) + chr(9997 - 9886) + '\x33' + chr(646 - 596) + chr(0b1011 + 0o46), 0b1000), ehT0Px3KOsy9('\060' + chr(0b11100 + 0o123) + chr(0b110010) + '\x31' + '\x36', 0o10), ehT0Px3KOsy9('\x30' + chr(0b1010 + 0o145) + chr(0b110001) + chr(0b11101 + 0o25) + '\064', 0o10), ehT0Px3KOsy9(chr(48) + chr(7054 - 6943) + '\065' + '\x30', 0o10), ehT0Px3KOsy9('\060' + chr(0b100000 + 0o117) + chr(0b110011) + chr(0b110110) + chr(0b110001), 51413 - 51405), ehT0Px3KOsy9(chr(0b110000) + chr(0b1110 + 0o141) + chr(51) + '\066' + chr(2919 - 2864), 35162 - 35154), ehT0Px3KOsy9(chr(2167 - 2119) + chr(111) + chr(650 - 601) + chr(2022 - 1968) + chr(54), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(1745 - 1634) + chr(50) + '\063' + '\060', 0o10), ehT0Px3KOsy9(chr(0b10000 + 0o40) + '\x6f' + '\x34', 44688 - 44680), ehT0Px3KOsy9(chr(0b11100 + 0o24) + chr(0b111100 + 0o63) + chr(0b110010) + chr(792 - 737) + chr(0b110011), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110001) + '\061' + chr(0b110111), 0b1000), ehT0Px3KOsy9(chr(48) + chr(5785 - 5674) + chr(51) + chr(1772 - 1724) + chr(1661 - 1609), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101010 + 0o5) + '\x33' + '\x34', 63518 - 63510), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(2074 - 2024) + '\x34' + chr(49), 0o10), ehT0Px3KOsy9(chr(606 - 558) + chr(111) + chr(51) + chr(0b11 + 0o64) + '\x36', 0b1000), ehT0Px3KOsy9(chr(0b1 + 0o57) + '\157' + chr(0b110101) + chr(2491 - 2441), 40483 - 40475), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x32' + chr(279 - 230) + chr(1823 - 1772), 27148 - 27140), ehT0Px3KOsy9(chr(1252 - 1204) + '\157' + chr(1001 - 951) + '\062' + chr(54), 55743 - 55735), ehT0Px3KOsy9('\x30' + chr(0b10100 + 0o133) + chr(0b1101 + 0o45) + chr(55), 0o10), ehT0Px3KOsy9(chr(929 - 881) + chr(0b1101111) + chr(2391 - 2337) + chr(0b11011 + 0o31), 41654 - 41646), ehT0Px3KOsy9(chr(48) + '\157' + chr(51) + '\060' + chr(53), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110001) + chr(0b1010 + 0o55) + '\x37', 52956 - 52948), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110010) + '\067' + '\063', 8), ehT0Px3KOsy9('\060' + chr(1895 - 1784) + '\x33' + '\064' + chr(0b110000), 8), ehT0Px3KOsy9(chr(0b110000) + chr(2895 - 2784) + chr(0b1000 + 0o53) + '\x31', 0o10), ehT0Px3KOsy9('\x30' + chr(0b111000 + 0o67) + chr(51) + chr(49), 8), ehT0Px3KOsy9(chr(0b100000 + 0o20) + chr(111) + chr(54) + chr(0b101100 + 0o6), 0b1000), ehT0Px3KOsy9(chr(0b11 + 0o55) + chr(0b1101111) + chr(974 - 925) + chr(1473 - 1422) + chr(0b101 + 0o53), 0o10), ehT0Px3KOsy9(chr(565 - 517) + '\x6f' + chr(51) + chr(50) + '\061', 8), ehT0Px3KOsy9(chr(0b100010 + 0o16) + '\157' + '\x33' + '\x34' + chr(0b10101 + 0o37), 48291 - 48283), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(51) + chr(265 - 213) + '\x32', 0o10), ehT0Px3KOsy9('\x30' + chr(111) + '\066' + chr(51), 0b1000), ehT0Px3KOsy9(chr(0b11011 + 0o25) + chr(0b1101111) + '\061', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110010) + chr(0b110001) + chr(0b110000), 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + chr(11574 - 11463) + '\065' + chr(0b1111 + 0o41), 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xd3'), '\144' + chr(0b11111 + 0o106) + chr(0b100001 + 0o102) + chr(111) + chr(0b1100100) + '\145')(chr(0b1110101) + chr(0b1110100) + chr(2638 - 2536) + chr(1487 - 1442) + '\070') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def QVSGJ0SHE4zl():
ny6shRSJO9Wm = I8Rje5vhkEqd()
ny6shRSJO9Wm.cvqVSw_Th5Qm = xafqLlk3kkUe(SXOLrMavuUCe(b'\x88\x8eV\xa3'), chr(335 - 235) + chr(0b1100101) + chr(0b1100011) + '\x6f' + '\x64' + chr(101))(chr(117) + chr(0b1110100) + '\146' + chr(45) + chr(56))
ny6shRSJO9Wm.ixa3U1BjAQ01 = 0.5
ny6shRSJO9Wm.gHeP0t6GwBIV = 0.5
return ny6shRSJO9Wm
|
tensorflow/tensor2tensor
|
tensor2tensor/models/resnet.py
|
resnet_imagenet_34_td_unit_no_drop
|
def resnet_imagenet_34_td_unit_no_drop():
"""Set of hyperparameters."""
hp = resnet_imagenet_34()
hp.use_td = "unit"
hp.targeting_rate = 0.0
hp.keep_prob = 1.0
return hp
|
python
|
def resnet_imagenet_34_td_unit_no_drop():
"""Set of hyperparameters."""
hp = resnet_imagenet_34()
hp.use_td = "unit"
hp.targeting_rate = 0.0
hp.keep_prob = 1.0
return hp
|
[
"def",
"resnet_imagenet_34_td_unit_no_drop",
"(",
")",
":",
"hp",
"=",
"resnet_imagenet_34",
"(",
")",
"hp",
".",
"use_td",
"=",
"\"unit\"",
"hp",
".",
"targeting_rate",
"=",
"0.0",
"hp",
".",
"keep_prob",
"=",
"1.0",
"return",
"hp"
] |
Set of hyperparameters.
|
[
"Set",
"of",
"hyperparameters",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/models/resnet.py#L701-L708
|
train
|
Set of hyperparameters for unit use.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7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fhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(48) + '\157' + '\x31' + chr(50) + '\061', 12417 - 12409), ehT0Px3KOsy9(chr(0b10010 + 0o36) + chr(111) + '\061' + '\x32' + chr(0b110111), 33457 - 33449), ehT0Px3KOsy9(chr(0b110000) + chr(0b100111 + 0o110) + chr(1448 - 1397) + '\066' + chr(0b110110), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(186 - 135) + chr(0b11011 + 0o26) + '\x34', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110110) + chr(49), 9665 - 9657), ehT0Px3KOsy9(chr(48) + '\157' + chr(1430 - 1380) + '\x31', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(49) + chr(0b110111) + chr(0b110111), 0o10), ehT0Px3KOsy9(chr(1301 - 1253) + '\x6f' + chr(0b110010) + chr(0b101101 + 0o5) + '\066', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1010110 + 0o31) + '\x32' + chr(241 - 189) + chr(49), 0b1000), ehT0Px3KOsy9(chr(2220 - 2172) + chr(111) + chr(0b110011) + chr(0b110010 + 0o0) + '\x35', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x33' + chr(0b110110) + '\x33', 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(51) + '\064' + chr(0b101000 + 0o11), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x33' + chr(55), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\061' + chr(292 - 244) + chr(0b110101 + 0o2), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + '\066' + chr(51), 0b1000), ehT0Px3KOsy9(chr(157 - 109) + '\157' + chr(898 - 848) + '\x35' + chr(0b110001 + 0o2), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + '\x33' + '\067' + chr(53), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b101011 + 0o104) + chr(1722 - 1671) + chr(0b1111 + 0o47) + chr(54), 8), ehT0Px3KOsy9(chr(0b11111 + 0o21) + chr(0b1101111) + chr(0b10011 + 0o40) + chr(2047 - 1998) + '\064', 8), ehT0Px3KOsy9(chr(1389 - 1341) + '\157' + '\x33' + chr(0b101 + 0o60) + chr(0b11101 + 0o31), 24690 - 24682), ehT0Px3KOsy9(chr(48) + '\157' + '\x33' + chr(0b1010 + 0o53) + chr(51), ord("\x08")), ehT0Px3KOsy9(chr(0b1000 + 0o50) + '\157' + '\062' + chr(0b100111 + 0o12) + chr(55), 43005 - 42997), ehT0Px3KOsy9('\x30' + chr(111) + '\x33' + chr(0b110010) + '\x35', 8), ehT0Px3KOsy9(chr(285 - 237) + chr(8635 - 8524) + chr(2483 - 2432), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110010) + chr(1905 - 1854) + chr(51), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b100001 + 0o21) + '\062' + '\x30', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b111101 + 0o62) + '\063' + chr(0b110010) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + '\066', 7505 - 7497), ehT0Px3KOsy9(chr(0b11010 + 0o26) + chr(111) + chr(0b110101), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(6850 - 6739) + chr(0b100 + 0o57) + chr(0b10101 + 0o36) + chr(0b100111 + 0o20), 38854 - 38846), ehT0Px3KOsy9(chr(0b101 + 0o53) + chr(111) + chr(49) + chr(0b110100) + chr(54), 32825 - 32817), ehT0Px3KOsy9(chr(48) + chr(2502 - 2391) + chr(51) + '\x32' + chr(51), ord("\x08")), ehT0Px3KOsy9(chr(0b11010 + 0o26) + chr(0b1101111) + chr(0b110001) + chr(48), 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(53), 8), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\067' + chr(124 - 75), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110011) + chr(0b100 + 0o57) + '\066', ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(0b10000 + 0o41) + '\x36' + '\x35', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110011) + chr(51) + chr(50), 17043 - 17035), ehT0Px3KOsy9('\x30' + chr(1819 - 1708) + chr(1625 - 1574) + '\x35' + chr(0b110010), 0o10), ehT0Px3KOsy9(chr(0b10100 + 0o34) + chr(111) + chr(0b11 + 0o56) + '\067' + chr(53), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b1001 + 0o47) + '\157' + chr(0b10110 + 0o37) + chr(0b110000), 18414 - 18406)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x7f'), chr(2864 - 2764) + '\145' + chr(6137 - 6038) + '\x6f' + chr(100) + chr(7032 - 6931))('\165' + '\x74' + '\146' + '\055' + chr(0b111000)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def feUtLv1QHzDa():
ny6shRSJO9Wm = I8Rje5vhkEqd()
ny6shRSJO9Wm.cvqVSw_Th5Qm = xafqLlk3kkUe(SXOLrMavuUCe(b'$9\x9f\xb8'), chr(0b1111 + 0o125) + '\x65' + '\143' + chr(0b1001110 + 0o41) + '\x64' + '\145')(chr(117) + '\x74' + chr(0b1100110) + chr(49 - 4) + chr(56))
ny6shRSJO9Wm.ixa3U1BjAQ01 = 0.0
ny6shRSJO9Wm.gHeP0t6GwBIV = 1.0
return ny6shRSJO9Wm
|
tensorflow/tensor2tensor
|
tensor2tensor/models/resnet.py
|
resnet_cifar_15
|
def resnet_cifar_15():
"""Set of hyperparameters."""
hp = resnet_base()
hp.block_fn = "residual"
hp.is_cifar = True
hp.layer_sizes = [2, 2, 2]
hp.filter_sizes = [16, 32, 64, 128]
return hp
|
python
|
def resnet_cifar_15():
"""Set of hyperparameters."""
hp = resnet_base()
hp.block_fn = "residual"
hp.is_cifar = True
hp.layer_sizes = [2, 2, 2]
hp.filter_sizes = [16, 32, 64, 128]
return hp
|
[
"def",
"resnet_cifar_15",
"(",
")",
":",
"hp",
"=",
"resnet_base",
"(",
")",
"hp",
".",
"block_fn",
"=",
"\"residual\"",
"hp",
".",
"is_cifar",
"=",
"True",
"hp",
".",
"layer_sizes",
"=",
"[",
"2",
",",
"2",
",",
"2",
"]",
"hp",
".",
"filter_sizes",
"=",
"[",
"16",
",",
"32",
",",
"64",
",",
"128",
"]",
"return",
"hp"
] |
Set of hyperparameters.
|
[
"Set",
"of",
"hyperparameters",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/models/resnet.py#L719-L727
|
train
|
Set of hyperparameters for CIFAR 15.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MM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ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b100001 + 0o17) + chr(10204 - 10093) + chr(50) + '\x33' + '\x32', 5169 - 5161), ehT0Px3KOsy9(chr(0b110000 + 0o0) + chr(111) + '\063' + chr(0b110001) + chr(0b11111 + 0o21), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + '\063' + chr(0b1010 + 0o52), ord("\x08")), ehT0Px3KOsy9(chr(2129 - 2081) + '\x6f' + chr(1393 - 1339) + chr(1279 - 1227), 22851 - 22843), ehT0Px3KOsy9('\060' + '\157' + chr(0b110001) + chr(50), 0b1000), ehT0Px3KOsy9(chr(1074 - 1026) + chr(1438 - 1327) + chr(2404 - 2354) + chr(720 - 671) + '\060', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1001100 + 0o43) + '\067', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110010) + chr(0b110001) + chr(768 - 717), ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + '\061' + '\067' + '\064', 0o10), ehT0Px3KOsy9(chr(535 - 487) + '\x6f' + chr(1481 - 1430) + '\x30' + chr(0b1000 + 0o55), 34497 - 34489), ehT0Px3KOsy9(chr(556 - 508) + chr(0b1101111) + '\061' + '\062' + '\063', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(50) + chr(0b10001 + 0o43) + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(0b1100 + 0o44) + chr(0b1101111) + chr(0b0 + 0o63) + '\x31' + chr(906 - 858), 8), ehT0Px3KOsy9('\060' + '\x6f' + '\063' + '\066' + chr(0b100100 + 0o15), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110010) + chr(0b101100 + 0o4) + '\067', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1010111 + 0o30) + chr(1507 - 1457) + chr(54) + chr(55), 39500 - 39492), ehT0Px3KOsy9(chr(657 - 609) + '\157' + '\x33', 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(2350 - 2299) + chr(55) + chr(0b10101 + 0o41), 34118 - 34110), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x31' + chr(0b110000) + '\060', 0b1000), ehT0Px3KOsy9(chr(0b1 + 0o57) + chr(111) + '\063' + chr(0b110010) + chr(303 - 255), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(0b1111 + 0o42) + chr(62 - 13) + chr(54), ord("\x08")), ehT0Px3KOsy9(chr(1898 - 1850) + chr(0b1101111) + '\063' + chr(2619 - 2565) + chr(0b110100), 23716 - 23708), ehT0Px3KOsy9(chr(967 - 919) + chr(4131 - 4020) + '\x32' + '\066', ord("\x08")), ehT0Px3KOsy9(chr(0b1100 + 0o44) + '\157' + chr(0b110001) + chr(0b1000 + 0o56) + chr(0b110101), 54189 - 54181), ehT0Px3KOsy9(chr(618 - 570) + chr(2671 - 2560) + chr(51) + '\x34' + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(1349 - 1301) + '\157' + chr(0b110 + 0o55) + '\x36' + '\x30', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b10001 + 0o136) + chr(0b10011 + 0o36) + '\064' + '\x35', 0b1000), ehT0Px3KOsy9('\060' + chr(0b1100010 + 0o15) + '\062' + chr(0b10010 + 0o41) + chr(531 - 482), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b11100 + 0o123) + chr(50) + chr(54) + chr(52), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(494 - 445) + chr(0b110101) + chr(0b110101), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b101010 + 0o7) + chr(54) + chr(1231 - 1179), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110010) + chr(48) + chr(0b100100 + 0o21), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x31' + '\063' + '\066', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(1215 - 1164) + chr(0b101100 + 0o7) + chr(0b110000), 0o10), ehT0Px3KOsy9(chr(339 - 291) + chr(111) + '\063' + chr(1339 - 1285) + '\x36', 24008 - 24000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(1148 - 1099) + chr(195 - 140) + chr(0b101101 + 0o6), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110011) + chr(0b1010 + 0o51) + chr(0b110000), 8), ehT0Px3KOsy9(chr(0b101111 + 0o1) + '\157' + '\061' + '\060', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\062' + chr(0b110011) + chr(51), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(920 - 871) + chr(308 - 259) + '\060', ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + '\x6f' + chr(313 - 260) + chr(48), 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xb4'), chr(100) + chr(101) + chr(99) + chr(0b1001111 + 0o40) + chr(0b1100100) + chr(6505 - 6404))(chr(117) + chr(0b1110100) + '\x66' + chr(1925 - 1880) + '\x38') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def lWyrx4ua3Pso():
ny6shRSJO9Wm = jK3BRdw5ap1H()
ny6shRSJO9Wm.cPTxFkUGUZcO = xafqLlk3kkUe(SXOLrMavuUCe(b'\xe8\xado]n\xfdf\xe7'), chr(100) + chr(101) + chr(99) + '\157' + chr(195 - 95) + '\x65')('\x75' + '\164' + '\x66' + '\x2d' + chr(2861 - 2805))
ny6shRSJO9Wm.j7HQiRo8CfFh = ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110001), ord("\x08"))
ny6shRSJO9Wm.kzewOlvk6DmD = [ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b11111 + 0o23), 0o10), ehT0Px3KOsy9(chr(1813 - 1765) + '\157' + chr(0b110010), 8), ehT0Px3KOsy9('\x30' + chr(6042 - 5931) + chr(2073 - 2023), 8)]
ny6shRSJO9Wm.Dvc8g9nINbiy = [ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(50) + chr(48), 25013 - 25005), ehT0Px3KOsy9(chr(0b10111 + 0o31) + chr(0b1001001 + 0o46) + chr(0b110100) + chr(48), 7666 - 7658), ehT0Px3KOsy9(chr(1533 - 1485) + chr(111) + chr(0b11110 + 0o23) + '\060' + '\060', 8), ehT0Px3KOsy9(chr(2209 - 2161) + '\157' + chr(50) + chr(48) + chr(0b110000), ord("\x08"))]
return ny6shRSJO9Wm
|
tensorflow/tensor2tensor
|
tensor2tensor/utils/rouge.py
|
_len_lcs
|
def _len_lcs(x, y):
"""Returns the length of the Longest Common Subsequence between two seqs.
Source: http://www.algorithmist.com/index.php/Longest_Common_Subsequence
Args:
x: sequence of words
y: sequence of words
Returns
integer: Length of LCS between x and y
"""
table = _lcs(x, y)
n, m = len(x), len(y)
return table[n, m]
|
python
|
def _len_lcs(x, y):
"""Returns the length of the Longest Common Subsequence between two seqs.
Source: http://www.algorithmist.com/index.php/Longest_Common_Subsequence
Args:
x: sequence of words
y: sequence of words
Returns
integer: Length of LCS between x and y
"""
table = _lcs(x, y)
n, m = len(x), len(y)
return table[n, m]
|
[
"def",
"_len_lcs",
"(",
"x",
",",
"y",
")",
":",
"table",
"=",
"_lcs",
"(",
"x",
",",
"y",
")",
"n",
",",
"m",
"=",
"len",
"(",
"x",
")",
",",
"len",
"(",
"y",
")",
"return",
"table",
"[",
"n",
",",
"m",
"]"
] |
Returns the length of the Longest Common Subsequence between two seqs.
Source: http://www.algorithmist.com/index.php/Longest_Common_Subsequence
Args:
x: sequence of words
y: sequence of words
Returns
integer: Length of LCS between x and y
|
[
"Returns",
"the",
"length",
"of",
"the",
"Longest",
"Common",
"Subsequence",
"between",
"two",
"seqs",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/utils/rouge.py#L33-L47
|
train
|
Returns the length of the Longest Common Subsequence between two sequences.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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ionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(2118 - 2070) + chr(111) + chr(0b111 + 0o53) + chr(54) + chr(0b110110), 0b1000), ehT0Px3KOsy9(chr(1219 - 1171) + '\x6f' + chr(49) + chr(1114 - 1064) + '\x34', ord("\x08")), ehT0Px3KOsy9(chr(0b101000 + 0o10) + chr(0b111101 + 0o62) + '\x32' + chr(84 - 31) + chr(776 - 727), 61500 - 61492), ehT0Px3KOsy9('\060' + '\157' + chr(131 - 78), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(10259 - 10148) + '\063' + '\x31' + '\062', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(1121 - 1071) + chr(0b110111) + chr(50), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(8258 - 8147) + chr(1232 - 1182) + chr(51) + chr(0b100 + 0o62), 0o10), ehT0Px3KOsy9(chr(48) + chr(438 - 327) + '\x33' + '\x32' + chr(48), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1001001 + 0o46) + chr(2457 - 2405) + chr(0b11 + 0o64), 0o10), ehT0Px3KOsy9(chr(48) + chr(9669 - 9558) + '\x33' + '\061' + chr(0b110111), 0o10), ehT0Px3KOsy9(chr(0b110000 + 0o0) + '\157' + chr(50) + chr(0b110100) + chr(0b10110 + 0o32), 0b1000), ehT0Px3KOsy9(chr(2126 - 2078) + chr(111) + '\061' + chr(1427 - 1377) + chr(956 - 908), 59635 - 59627), ehT0Px3KOsy9(chr(405 - 357) + chr(111) + chr(49) + '\x32' + chr(379 - 325), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(532 - 483) + chr(52) + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(825 - 777) + chr(0b1101111) + chr(0b101110 + 0o5) + chr(0b1100 + 0o47) + chr(122 - 70), 18554 - 18546), ehT0Px3KOsy9('\x30' + chr(9628 - 9517) + '\x31' + chr(0b110001) + chr(581 - 532), 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(49) + chr(55) + chr(0b101011 + 0o10), ord("\x08")), ehT0Px3KOsy9(chr(0b1101 + 0o43) + chr(0b11100 + 0o123) + '\061' + chr(0b110010) + '\063', ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + '\x33' + chr(1966 - 1918) + '\x33', 51414 - 51406), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b101001 + 0o12) + '\061' + chr(51), ord("\x08")), ehT0Px3KOsy9(chr(0b1101 + 0o43) + '\157' + '\063' + '\x36', 0b1000), ehT0Px3KOsy9(chr(699 - 651) + '\157' + chr(0b110110), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + '\063' + chr(1466 - 1418) + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + '\063' + chr(50) + '\062', 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110010) + chr(2033 - 1982) + chr(54), 8), ehT0Px3KOsy9(chr(96 - 48) + chr(111) + '\062' + chr(1040 - 985) + '\062', 8), ehT0Px3KOsy9(chr(48) + '\x6f' + '\063' + chr(0b110010) + chr(1444 - 1392), 36026 - 36018), ehT0Px3KOsy9('\x30' + '\157' + chr(285 - 234) + chr(467 - 412) + '\x33', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(984 - 933) + chr(884 - 836) + chr(0b11001 + 0o32), 8), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b11101 + 0o25) + '\x37' + chr(0b111 + 0o53), 8), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110010) + chr(52) + chr(0b110010), 37517 - 37509), ehT0Px3KOsy9('\060' + chr(111) + chr(52) + chr(655 - 604), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + '\x33' + chr(0b101100 + 0o7) + chr(943 - 889), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1001101 + 0o42) + '\061' + chr(0b10010 + 0o40) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1000010 + 0o55) + chr(0b11001 + 0o31) + '\060' + chr(0b110000 + 0o4), 24652 - 24644), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\062' + chr(0b11 + 0o56) + chr(53), 0b1000), ehT0Px3KOsy9(chr(0b101010 + 0o6) + chr(0b1101111) + chr(0b110000 + 0o3) + chr(393 - 342) + '\x34', 8), ehT0Px3KOsy9(chr(363 - 315) + chr(0b1101111 + 0o0) + '\066' + '\x32', 61112 - 61104), ehT0Px3KOsy9(chr(1037 - 989) + chr(0b10110 + 0o131) + chr(0b110010) + chr(0b110010) + chr(0b1 + 0o57), 0b1000), ehT0Px3KOsy9(chr(0b1011 + 0o45) + chr(0b101010 + 0o105) + '\x34' + '\063', 8)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + '\x6f' + chr(2308 - 2255) + chr(48), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x98'), '\144' + chr(10092 - 9991) + chr(0b111000 + 0o53) + '\157' + chr(2421 - 2321) + chr(101))(chr(0b11 + 0o162) + chr(0b1110100) + '\146' + '\055' + '\070') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def DLCYQfD780pX(OeWW0F1dBPRQ, SqiSOtYOqOJH):
YbLi4ide0_3E = MfYlhfPy_q09(OeWW0F1dBPRQ, SqiSOtYOqOJH)
(m1NkCryOw9Bx, r8ufID9JCHnI) = (c2A0yzQpDQB3(OeWW0F1dBPRQ), c2A0yzQpDQB3(SqiSOtYOqOJH))
return YbLi4ide0_3E[m1NkCryOw9Bx, r8ufID9JCHnI]
|
tensorflow/tensor2tensor
|
tensor2tensor/utils/rouge.py
|
_lcs
|
def _lcs(x, y):
"""Computes the length of the LCS between two seqs.
The implementation below uses a DP programming algorithm and runs
in O(nm) time where n = len(x) and m = len(y).
Source: http://www.algorithmist.com/index.php/Longest_Common_Subsequence
Args:
x: collection of words
y: collection of words
Returns:
Table of dictionary of coord and len lcs
"""
n, m = len(x), len(y)
table = {}
for i in range(n + 1):
for j in range(m + 1):
if i == 0 or j == 0:
table[i, j] = 0
elif x[i - 1] == y[j - 1]:
table[i, j] = table[i - 1, j - 1] + 1
else:
table[i, j] = max(table[i - 1, j], table[i, j - 1])
return table
|
python
|
def _lcs(x, y):
"""Computes the length of the LCS between two seqs.
The implementation below uses a DP programming algorithm and runs
in O(nm) time where n = len(x) and m = len(y).
Source: http://www.algorithmist.com/index.php/Longest_Common_Subsequence
Args:
x: collection of words
y: collection of words
Returns:
Table of dictionary of coord and len lcs
"""
n, m = len(x), len(y)
table = {}
for i in range(n + 1):
for j in range(m + 1):
if i == 0 or j == 0:
table[i, j] = 0
elif x[i - 1] == y[j - 1]:
table[i, j] = table[i - 1, j - 1] + 1
else:
table[i, j] = max(table[i - 1, j], table[i, j - 1])
return table
|
[
"def",
"_lcs",
"(",
"x",
",",
"y",
")",
":",
"n",
",",
"m",
"=",
"len",
"(",
"x",
")",
",",
"len",
"(",
"y",
")",
"table",
"=",
"{",
"}",
"for",
"i",
"in",
"range",
"(",
"n",
"+",
"1",
")",
":",
"for",
"j",
"in",
"range",
"(",
"m",
"+",
"1",
")",
":",
"if",
"i",
"==",
"0",
"or",
"j",
"==",
"0",
":",
"table",
"[",
"i",
",",
"j",
"]",
"=",
"0",
"elif",
"x",
"[",
"i",
"-",
"1",
"]",
"==",
"y",
"[",
"j",
"-",
"1",
"]",
":",
"table",
"[",
"i",
",",
"j",
"]",
"=",
"table",
"[",
"i",
"-",
"1",
",",
"j",
"-",
"1",
"]",
"+",
"1",
"else",
":",
"table",
"[",
"i",
",",
"j",
"]",
"=",
"max",
"(",
"table",
"[",
"i",
"-",
"1",
",",
"j",
"]",
",",
"table",
"[",
"i",
",",
"j",
"-",
"1",
"]",
")",
"return",
"table"
] |
Computes the length of the LCS between two seqs.
The implementation below uses a DP programming algorithm and runs
in O(nm) time where n = len(x) and m = len(y).
Source: http://www.algorithmist.com/index.php/Longest_Common_Subsequence
Args:
x: collection of words
y: collection of words
Returns:
Table of dictionary of coord and len lcs
|
[
"Computes",
"the",
"length",
"of",
"the",
"LCS",
"between",
"two",
"seqs",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/utils/rouge.py#L50-L74
|
train
|
Computes the length of the LCS between two sequences.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDASQ0Qkq,NL8dtWOpbcjF,_bikzMuRfbJG,sznFqDbNBHlx,ZsDPvpP4xdo3,cW7yQuyEnJ6E,KOHQGQ8qLDWm,NE1Yam2HHroQ,ygAzbDzrvRMh,SBRjvOU1ufVC,hOkXjmlu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,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(50) + chr(0b110100), 20902 - 20894), ehT0Px3KOsy9(chr(1804 - 1756) + chr(2647 - 2536) + chr(921 - 870) + chr(0b110010) + '\x31', 37903 - 37895), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110010) + chr(0b110011) + chr(0b11000 + 0o34), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + '\063' + chr(0b110011) + '\066', 40680 - 40672), ehT0Px3KOsy9(chr(0b110000) + chr(0b1100010 + 0o15) + chr(0b1001 + 0o52) + '\x37' + '\x33', ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(0b110011) + chr(53) + chr(2314 - 2261), 0o10), ehT0Px3KOsy9(chr(0b11011 + 0o25) + chr(0b1010000 + 0o37) + chr(0b10010 + 0o37) + chr(54) + '\x33', 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + '\x31' + chr(0b110111) + chr(2693 - 2639), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b11100 + 0o33) + '\x34', ord("\x08")), ehT0Px3KOsy9(chr(513 - 465) + '\x6f' + '\x31' + '\064' + chr(0b110111), 0o10), ehT0Px3KOsy9(chr(2178 - 2130) + chr(1183 - 1072) + '\x31' + chr(0b101100 + 0o5) + chr(0b11100 + 0o24), 41802 - 41794), ehT0Px3KOsy9(chr(0b110000) + chr(0b10010 + 0o135) + chr(1253 - 1200) + chr(0b11110 + 0o25), 0b1000), ehT0Px3KOsy9(chr(2046 - 1998) + chr(0b1101111) + chr(0b110010) + '\x33' + chr(50), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b100110 + 0o13) + chr(0b110101) + chr(2319 - 2265), 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(1581 - 1531) + chr(0b110100), 8), ehT0Px3KOsy9(chr(0b1 + 0o57) + chr(111) + chr(51) + '\x37' + chr(0b110111), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101011 + 0o4) + chr(0b1111 + 0o43) + chr(52), 8), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110011) + chr(0b10000 + 0o45) + chr(52), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110011) + chr(0b11011 + 0o33) + chr(711 - 659), 20379 - 20371), ehT0Px3KOsy9(chr(0b10000 + 0o40) + '\x6f' + chr(0b11111 + 0o22) + chr(455 - 404) + chr(55), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(50) + chr(0b110000) + '\x35', ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110011 + 0o0) + chr(0b110110) + '\x31', ord("\x08")), ehT0Px3KOsy9(chr(1958 - 1910) + '\x6f' + chr(49) + chr(55) + chr(0b110101), 0o10), ehT0Px3KOsy9(chr(0b101010 + 0o6) + '\157' + chr(0b110001) + '\060' + '\x31', ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(0b110000 + 0o1) + chr(50) + '\x30', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1000001 + 0o56) + chr(0b10001 + 0o40) + chr(1883 - 1834) + '\x33', 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(54) + chr(0b110101), 0b1000), ehT0Px3KOsy9('\060' + chr(5500 - 5389) + '\x32' + chr(1337 - 1285) + '\066', ord("\x08")), ehT0Px3KOsy9(chr(2166 - 2118) + chr(7219 - 7108) + '\x31' + chr(0b110000) + '\062', 35100 - 35092), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110011 + 0o0) + '\066' + '\063', 0o10), ehT0Px3KOsy9(chr(1719 - 1671) + chr(0b1011100 + 0o23) + chr(0b100 + 0o55) + '\x31' + chr(0b110111), 0b1000), ehT0Px3KOsy9(chr(1176 - 1128) + chr(0b101010 + 0o105) + chr(0b11111 + 0o22) + '\x37' + '\063', 0o10), ehT0Px3KOsy9('\060' + chr(11278 - 11167) + chr(0b10000 + 0o43) + chr(549 - 496) + '\x36', 0o10), ehT0Px3KOsy9('\x30' + chr(0b111101 + 0o62) + chr(0b101111 + 0o2) + chr(50) + chr(1520 - 1466), 0b1000), ehT0Px3KOsy9(chr(0b1001 + 0o47) + chr(111) + chr(49) + chr(0b101010 + 0o12) + '\x34', 1309 - 1301), ehT0Px3KOsy9(chr(48) + chr(0b1001000 + 0o47) + chr(0b101000 + 0o11) + chr(0b100 + 0o55) + chr(1594 - 1541), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + '\x31' + '\x31', 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(51) + chr(843 - 792), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(51) + '\067' + chr(0b11100 + 0o26), 8219 - 8211), ehT0Px3KOsy9(chr(143 - 95) + '\157' + '\061' + chr(54) + chr(53), ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b101100 + 0o11) + chr(0b101010 + 0o6), 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b':'), chr(0b1100100) + chr(101) + chr(0b1100011) + chr(0b1101 + 0o142) + chr(100) + '\x65')('\x75' + chr(116) + chr(0b1100110) + chr(927 - 882) + chr(2838 - 2782)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def MfYlhfPy_q09(OeWW0F1dBPRQ, SqiSOtYOqOJH):
(m1NkCryOw9Bx, r8ufID9JCHnI) = (c2A0yzQpDQB3(OeWW0F1dBPRQ), c2A0yzQpDQB3(SqiSOtYOqOJH))
YbLi4ide0_3E = {}
for WVxHKyX45z_L in vQr8gNKaIaWE(m1NkCryOw9Bx + ehT0Px3KOsy9('\x30' + '\157' + chr(0b110001), 0b1000)):
for tlORBuYsiw3X in vQr8gNKaIaWE(r8ufID9JCHnI + ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x31', 8)):
if WVxHKyX45z_L == ehT0Px3KOsy9(chr(0b1111 + 0o41) + chr(8703 - 8592) + '\x30', 0o10) or tlORBuYsiw3X == ehT0Px3KOsy9('\x30' + '\157' + chr(48), 8):
YbLi4ide0_3E[WVxHKyX45z_L, tlORBuYsiw3X] = ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(1028 - 980), 8)
elif OeWW0F1dBPRQ[WVxHKyX45z_L - ehT0Px3KOsy9(chr(48) + chr(10208 - 10097) + chr(0b110001), 8)] == SqiSOtYOqOJH[tlORBuYsiw3X - ehT0Px3KOsy9(chr(0b100100 + 0o14) + chr(2800 - 2689) + chr(49), 8)]:
YbLi4ide0_3E[WVxHKyX45z_L, tlORBuYsiw3X] = YbLi4ide0_3E[WVxHKyX45z_L - ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110001), 8), tlORBuYsiw3X - ehT0Px3KOsy9(chr(0b110000) + chr(11556 - 11445) + chr(0b10111 + 0o32), 8)] + ehT0Px3KOsy9(chr(0b101010 + 0o6) + chr(10985 - 10874) + chr(0b110001), 8)
else:
YbLi4ide0_3E[WVxHKyX45z_L, tlORBuYsiw3X] = tsdjvlgh9gDP(YbLi4ide0_3E[WVxHKyX45z_L - ehT0Px3KOsy9('\060' + chr(111) + chr(0b110001), 8), tlORBuYsiw3X], YbLi4ide0_3E[WVxHKyX45z_L, tlORBuYsiw3X - ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110001), 8)])
return YbLi4ide0_3E
|
tensorflow/tensor2tensor
|
tensor2tensor/utils/rouge.py
|
rouge_l_sentence_level
|
def rouge_l_sentence_level(eval_sentences, ref_sentences):
"""Computes ROUGE-L (sentence level) of two collections of sentences.
Source: https://www.microsoft.com/en-us/research/publication/
rouge-a-package-for-automatic-evaluation-of-summaries/
Calculated according to:
R_lcs = LCS(X,Y)/m
P_lcs = LCS(X,Y)/n
F_lcs = ((1 + beta^2)*R_lcs*P_lcs) / (R_lcs + (beta^2) * P_lcs)
where:
X = reference summary
Y = Candidate summary
m = length of reference summary
n = length of candidate summary
Args:
eval_sentences: The sentences that have been picked by the summarizer
ref_sentences: The sentences from the reference set
Returns:
A float: F_lcs
"""
f1_scores = []
for eval_sentence, ref_sentence in zip(eval_sentences, ref_sentences):
m = len(ref_sentence)
n = len(eval_sentence)
lcs = _len_lcs(eval_sentence, ref_sentence)
f1_scores.append(_f_lcs(lcs, m, n))
return np.mean(f1_scores, dtype=np.float32)
|
python
|
def rouge_l_sentence_level(eval_sentences, ref_sentences):
"""Computes ROUGE-L (sentence level) of two collections of sentences.
Source: https://www.microsoft.com/en-us/research/publication/
rouge-a-package-for-automatic-evaluation-of-summaries/
Calculated according to:
R_lcs = LCS(X,Y)/m
P_lcs = LCS(X,Y)/n
F_lcs = ((1 + beta^2)*R_lcs*P_lcs) / (R_lcs + (beta^2) * P_lcs)
where:
X = reference summary
Y = Candidate summary
m = length of reference summary
n = length of candidate summary
Args:
eval_sentences: The sentences that have been picked by the summarizer
ref_sentences: The sentences from the reference set
Returns:
A float: F_lcs
"""
f1_scores = []
for eval_sentence, ref_sentence in zip(eval_sentences, ref_sentences):
m = len(ref_sentence)
n = len(eval_sentence)
lcs = _len_lcs(eval_sentence, ref_sentence)
f1_scores.append(_f_lcs(lcs, m, n))
return np.mean(f1_scores, dtype=np.float32)
|
[
"def",
"rouge_l_sentence_level",
"(",
"eval_sentences",
",",
"ref_sentences",
")",
":",
"f1_scores",
"=",
"[",
"]",
"for",
"eval_sentence",
",",
"ref_sentence",
"in",
"zip",
"(",
"eval_sentences",
",",
"ref_sentences",
")",
":",
"m",
"=",
"len",
"(",
"ref_sentence",
")",
"n",
"=",
"len",
"(",
"eval_sentence",
")",
"lcs",
"=",
"_len_lcs",
"(",
"eval_sentence",
",",
"ref_sentence",
")",
"f1_scores",
".",
"append",
"(",
"_f_lcs",
"(",
"lcs",
",",
"m",
",",
"n",
")",
")",
"return",
"np",
".",
"mean",
"(",
"f1_scores",
",",
"dtype",
"=",
"np",
".",
"float32",
")"
] |
Computes ROUGE-L (sentence level) of two collections of sentences.
Source: https://www.microsoft.com/en-us/research/publication/
rouge-a-package-for-automatic-evaluation-of-summaries/
Calculated according to:
R_lcs = LCS(X,Y)/m
P_lcs = LCS(X,Y)/n
F_lcs = ((1 + beta^2)*R_lcs*P_lcs) / (R_lcs + (beta^2) * P_lcs)
where:
X = reference summary
Y = Candidate summary
m = length of reference summary
n = length of candidate summary
Args:
eval_sentences: The sentences that have been picked by the summarizer
ref_sentences: The sentences from the reference set
Returns:
A float: F_lcs
|
[
"Computes",
"ROUGE",
"-",
"L",
"(",
"sentence",
"level",
")",
"of",
"two",
"collections",
"of",
"sentences",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/utils/rouge.py#L100-L131
|
train
|
Calculates ROUGE - L sentence level of two collections of sentences.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9q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OH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + chr(0b10101 + 0o132) + '\062' + '\x30', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b10100 + 0o133) + chr(0b1001 + 0o52) + chr(0b110001) + chr(0b110010), 60964 - 60956), ehT0Px3KOsy9(chr(0b110000) + chr(4357 - 4246) + '\063' + chr(2911 - 2857) + '\065', 0b1000), ehT0Px3KOsy9('\060' + '\157' + '\062' + chr(0b100100 + 0o21) + chr(1216 - 1161), ord("\x08")), ehT0Px3KOsy9('\060' + chr(8503 - 8392) + chr(585 - 535) + '\x33' + chr(0b110011), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b11010 + 0o33) + chr(0b1101 + 0o52), 0b1000), ehT0Px3KOsy9(chr(0b11010 + 0o26) + '\157' + '\x32' + chr(51) + chr(242 - 194), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\061' + chr(51) + chr(631 - 583), 8041 - 8033), ehT0Px3KOsy9(chr(2034 - 1986) + '\x6f' + chr(0b10001 + 0o42) + chr(49) + '\x30', 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x32' + '\067' + chr(48), 38310 - 38302), ehT0Px3KOsy9(chr(0b11011 + 0o25) + chr(0b1101111) + chr(0b110001) + chr(0b110110) + '\062', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(1006 - 957) + chr(55) + chr(416 - 364), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b10111 + 0o34) + chr(0b10111 + 0o31), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101100 + 0o3) + chr(49) + '\x36' + '\064', ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + '\x31' + '\x37' + chr(0b110000), 44287 - 44279), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110011) + '\x31' + '\061', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(507 - 457) + '\066' + '\x31', ord("\x08")), ehT0Px3KOsy9(chr(541 - 493) + chr(111) + chr(0b100111 + 0o13) + chr(526 - 473) + chr(0b1110 + 0o42), 0b1000), ehT0Px3KOsy9(chr(76 - 28) + chr(0b11011 + 0o124) + chr(0b110010) + chr(0b110001) + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\061' + '\064' + '\x37', 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110001) + chr(0b110000) + '\x37', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(129 - 18) + chr(0b11011 + 0o30) + '\064' + '\064', 29246 - 29238), ehT0Px3KOsy9('\x30' + '\x6f' + '\062' + chr(0b110011) + chr(315 - 263), ord("\x08")), ehT0Px3KOsy9(chr(0b101100 + 0o4) + chr(0b1101111) + '\063' + chr(448 - 398) + '\061', 8374 - 8366), ehT0Px3KOsy9(chr(48) + '\157' + chr(51) + '\060' + chr(1107 - 1056), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(49), 0o10), ehT0Px3KOsy9(chr(0b101010 + 0o6) + '\157' + chr(0b111 + 0o54) + chr(54) + chr(279 - 225), ord("\x08")), ehT0Px3KOsy9(chr(2024 - 1976) + chr(0b1101111) + chr(0b110101) + chr(49), 0o10), ehT0Px3KOsy9(chr(0b111 + 0o51) + chr(0b1101111) + chr(1354 - 1305) + chr(52), ord("\x08")), ehT0Px3KOsy9(chr(0b11100 + 0o24) + '\157' + '\x35' + '\065', ord("\x08")), ehT0Px3KOsy9(chr(960 - 912) + chr(4851 - 4740) + chr(51) + chr(51) + chr(81 - 26), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(51) + chr(0b110001) + chr(0b110001), 8), ehT0Px3KOsy9(chr(1422 - 1374) + chr(0b1101111) + chr(0b111 + 0o54) + chr(51), 0b1000), ehT0Px3KOsy9(chr(48) + chr(5700 - 5589) + chr(0b100100 + 0o15) + chr(0b110010), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(54) + '\065', 0o10), ehT0Px3KOsy9(chr(79 - 31) + chr(0b1101111) + chr(0b110010) + '\x30' + chr(54), 62760 - 62752), ehT0Px3KOsy9('\x30' + '\157' + chr(52) + chr(1363 - 1313), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110011) + '\060' + chr(818 - 767), 8), ehT0Px3KOsy9(chr(0b1001 + 0o47) + '\157' + '\062' + chr(1036 - 984) + '\062', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110011) + '\065', ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9(chr(1877 - 1829) + '\157' + chr(0b101000 + 0o15) + chr(0b110000), ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'>'), chr(6632 - 6532) + chr(101) + chr(0b1100011) + chr(111) + chr(0b1100100) + '\x65')(chr(0b1110101) + '\164' + '\x66' + '\x2d' + chr(0b111000)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def wOIZImtIHL33(svbxwa7c1AiL, zn3hIo3CHs_w):
EIzogWlMxCLS = []
for (pRJ_32rwkD7E, iMaJRcY7pTs2) in pZ0NK2y6HRbn(svbxwa7c1AiL, zn3hIo3CHs_w):
r8ufID9JCHnI = c2A0yzQpDQB3(iMaJRcY7pTs2)
m1NkCryOw9Bx = c2A0yzQpDQB3(pRJ_32rwkD7E)
yMRi3BG95Xia = DLCYQfD780pX(pRJ_32rwkD7E, iMaJRcY7pTs2)
xafqLlk3kkUe(EIzogWlMxCLS, xafqLlk3kkUe(SXOLrMavuUCe(b'q\xba\x85\xca\xf5K'), chr(6100 - 6000) + chr(0b1100101) + chr(0b1010111 + 0o14) + chr(0b1101111) + chr(0b111011 + 0o51) + chr(0b1100101))(chr(0b0 + 0o165) + chr(0b1110100) + chr(2976 - 2874) + chr(45) + chr(0b110 + 0o62)))(pOYJk0bwQv1v(yMRi3BG95Xia, r8ufID9JCHnI, m1NkCryOw9Bx))
return xafqLlk3kkUe(WqUC3KWvYVup, xafqLlk3kkUe(SXOLrMavuUCe(b'q\x80\x9d\xe6\xefl\xc7\x0e\xa9\xcf\x1e\x0b'), '\x64' + chr(0b1100101) + chr(99) + chr(3756 - 3645) + chr(0b1100100) + chr(101))(chr(5496 - 5379) + chr(0b1110100) + chr(5448 - 5346) + chr(973 - 928) + chr(1127 - 1071)))(EIzogWlMxCLS, dtype=xafqLlk3kkUe(WqUC3KWvYVup, xafqLlk3kkUe(SXOLrMavuUCe(b'v\xa6\x9a\xce\xef\x1c\xaa'), chr(100) + chr(6843 - 6742) + '\x63' + chr(111) + '\x64' + chr(101))(chr(0b1110101) + chr(0b1101110 + 0o6) + chr(9306 - 9204) + chr(0b10101 + 0o30) + chr(0b110010 + 0o6))))
|
tensorflow/tensor2tensor
|
tensor2tensor/utils/rouge.py
|
rouge_l_fscore
|
def rouge_l_fscore(predictions, labels, **unused_kwargs):
"""ROUGE scores computation between labels and predictions.
This is an approximate ROUGE scoring method since we do not glue word pieces
or decode the ids and tokenize the output.
Args:
predictions: tensor, model predictions
labels: tensor, gold output.
Returns:
rouge_l_fscore: approx rouge-l f1 score.
"""
outputs = tf.to_int32(tf.argmax(predictions, axis=-1))
# Convert the outputs and labels to a [batch_size, input_length] tensor.
outputs = tf.squeeze(outputs, axis=[-1, -2])
labels = tf.squeeze(labels, axis=[-1, -2])
rouge_l_f_score = tf.py_func(rouge_l_sentence_level, (outputs, labels),
tf.float32)
return rouge_l_f_score, tf.constant(1.0)
|
python
|
def rouge_l_fscore(predictions, labels, **unused_kwargs):
"""ROUGE scores computation between labels and predictions.
This is an approximate ROUGE scoring method since we do not glue word pieces
or decode the ids and tokenize the output.
Args:
predictions: tensor, model predictions
labels: tensor, gold output.
Returns:
rouge_l_fscore: approx rouge-l f1 score.
"""
outputs = tf.to_int32(tf.argmax(predictions, axis=-1))
# Convert the outputs and labels to a [batch_size, input_length] tensor.
outputs = tf.squeeze(outputs, axis=[-1, -2])
labels = tf.squeeze(labels, axis=[-1, -2])
rouge_l_f_score = tf.py_func(rouge_l_sentence_level, (outputs, labels),
tf.float32)
return rouge_l_f_score, tf.constant(1.0)
|
[
"def",
"rouge_l_fscore",
"(",
"predictions",
",",
"labels",
",",
"*",
"*",
"unused_kwargs",
")",
":",
"outputs",
"=",
"tf",
".",
"to_int32",
"(",
"tf",
".",
"argmax",
"(",
"predictions",
",",
"axis",
"=",
"-",
"1",
")",
")",
"# Convert the outputs and labels to a [batch_size, input_length] tensor.",
"outputs",
"=",
"tf",
".",
"squeeze",
"(",
"outputs",
",",
"axis",
"=",
"[",
"-",
"1",
",",
"-",
"2",
"]",
")",
"labels",
"=",
"tf",
".",
"squeeze",
"(",
"labels",
",",
"axis",
"=",
"[",
"-",
"1",
",",
"-",
"2",
"]",
")",
"rouge_l_f_score",
"=",
"tf",
".",
"py_func",
"(",
"rouge_l_sentence_level",
",",
"(",
"outputs",
",",
"labels",
")",
",",
"tf",
".",
"float32",
")",
"return",
"rouge_l_f_score",
",",
"tf",
".",
"constant",
"(",
"1.0",
")"
] |
ROUGE scores computation between labels and predictions.
This is an approximate ROUGE scoring method since we do not glue word pieces
or decode the ids and tokenize the output.
Args:
predictions: tensor, model predictions
labels: tensor, gold output.
Returns:
rouge_l_fscore: approx rouge-l f1 score.
|
[
"ROUGE",
"scores",
"computation",
"between",
"labels",
"and",
"predictions",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/utils/rouge.py#L134-L153
|
train
|
ROUGE scores computation between labels and predictions.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvh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,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\060' + chr(111) + chr(0b110001) + chr(1899 - 1851) + chr(0b100000 + 0o24), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(2275 - 2164) + chr(0b10101 + 0o34) + '\x34' + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x33' + '\064' + chr(1109 - 1057), 0b1000), ehT0Px3KOsy9('\x30' + chr(5585 - 5474) + chr(0b110001 + 0o1) + '\x32' + chr(50), 6569 - 6561), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(591 - 541) + chr(0b101101 + 0o4) + '\065', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b100111 + 0o110) + chr(49) + '\061', 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\061' + chr(424 - 371) + chr(1834 - 1786), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110111) + '\065', 36675 - 36667), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(53) + chr(53), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(55), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(50) + '\x30' + '\063', 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(0b101 + 0o56) + '\x31' + '\x32', 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(557 - 508) + chr(52) + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(3500 - 3389) + chr(0b110011) + '\x37' + chr(1812 - 1757), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(49) + chr(51) + chr(54), 26849 - 26841), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\062' + chr(0b101000 + 0o10) + chr(0b110010 + 0o5), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110001) + chr(0b10101 + 0o34), 8), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b1011 + 0o46) + chr(0b11010 + 0o34) + '\062', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(50) + chr(0b110001) + '\x37', ord("\x08")), ehT0Px3KOsy9(chr(154 - 106) + chr(0b1101111) + chr(49) + '\x34' + chr(687 - 637), ord("\x08")), ehT0Px3KOsy9(chr(0b11110 + 0o22) + '\157' + chr(50) + '\x34' + chr(48), 0o10), ehT0Px3KOsy9('\060' + chr(11062 - 10951) + '\063', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x32' + '\065', ord("\x08")), ehT0Px3KOsy9(chr(0b101000 + 0o10) + chr(2835 - 2724) + chr(0b110010) + chr(0b110011 + 0o1) + chr(53), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b11001 + 0o30) + '\065' + chr(0b101010 + 0o13), 26125 - 26117), ehT0Px3KOsy9('\060' + chr(1103 - 992) + chr(754 - 704) + '\x36' + chr(54), 50022 - 50014), ehT0Px3KOsy9('\x30' + chr(0b1101011 + 0o4) + chr(50) + chr(0b110110) + '\060', 0o10), ehT0Px3KOsy9(chr(0b101010 + 0o6) + '\x6f' + chr(0b100100 + 0o16) + chr(48) + '\063', 8), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b1110 + 0o43) + chr(0b1101 + 0o51) + chr(0b110101), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1100110 + 0o11) + '\062' + chr(0b110011) + '\x35', 3338 - 3330), ehT0Px3KOsy9(chr(0b10110 + 0o32) + chr(0b100000 + 0o117) + '\061' + chr(1042 - 991) + chr(0b1 + 0o66), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(50) + '\x35' + chr(0b110111), 317 - 309), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110001) + '\x33' + chr(1038 - 988), 53427 - 53419), ehT0Px3KOsy9(chr(0b110000 + 0o0) + '\157' + chr(2444 - 2393) + chr(1586 - 1534) + '\x34', 8), ehT0Px3KOsy9(chr(0b100010 + 0o16) + chr(0b110001 + 0o76) + chr(0b1001 + 0o50) + '\x35' + chr(1398 - 1350), 8), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110010) + '\x34' + chr(0b101110 + 0o7), 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b11001 + 0o126) + chr(49) + chr(2308 - 2254) + '\062', 8), ehT0Px3KOsy9(chr(0b110000) + chr(4689 - 4578) + chr(49) + '\060' + chr(672 - 623), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(1149 - 1100) + chr(1253 - 1200) + chr(0b110000), 8), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(1436 - 1386) + chr(0b110101) + chr(0b111 + 0o51), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + chr(7270 - 7159) + chr(488 - 435) + chr(48), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'j'), chr(1521 - 1421) + chr(0b11011 + 0o112) + '\x63' + chr(111) + chr(8566 - 8466) + chr(0b1100101))(chr(0b101110 + 0o107) + '\164' + '\x66' + '\055' + chr(0b101001 + 0o17)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def kaA56q5exjly(qIQi_VFCIFZL, uXMK81tmdpTM, **Dl7jGuYToI93):
Dx_DllZ8uCko = IDJ2eXGCBCDu.to_int32(IDJ2eXGCBCDu.argmax(qIQi_VFCIFZL, axis=-ehT0Px3KOsy9('\x30' + '\157' + '\061', ord("\x08"))))
Dx_DllZ8uCko = IDJ2eXGCBCDu.squeeze(Dx_DllZ8uCko, axis=[-ehT0Px3KOsy9(chr(0b100010 + 0o16) + '\157' + chr(0b11011 + 0o26), 8), -ehT0Px3KOsy9(chr(353 - 305) + chr(0b110101 + 0o72) + '\x32', ord("\x08"))])
uXMK81tmdpTM = IDJ2eXGCBCDu.squeeze(uXMK81tmdpTM, axis=[-ehT0Px3KOsy9(chr(2112 - 2064) + '\x6f' + '\x31', 8), -ehT0Px3KOsy9(chr(599 - 551) + chr(0b1100 + 0o143) + '\062', 8)])
VPGNKuwecRFG = IDJ2eXGCBCDu.py_func(wOIZImtIHL33, (Dx_DllZ8uCko, uXMK81tmdpTM), IDJ2eXGCBCDu.float32)
return (VPGNKuwecRFG, xafqLlk3kkUe(IDJ2eXGCBCDu, xafqLlk3kkUe(SXOLrMavuUCe(b"'\x0f\x8a\xe1\xf9h\x06I"), '\x64' + chr(101) + chr(99) + chr(111) + chr(4232 - 4132) + '\145')(chr(117) + chr(2602 - 2486) + '\146' + '\055' + '\x38'))(1.0))
|
tensorflow/tensor2tensor
|
tensor2tensor/utils/rouge.py
|
_get_ngrams
|
def _get_ngrams(n, text):
"""Calculates n-grams.
Args:
n: which n-grams to calculate
text: An array of tokens
Returns:
A set of n-grams
"""
ngram_set = set()
text_length = len(text)
max_index_ngram_start = text_length - n
for i in range(max_index_ngram_start + 1):
ngram_set.add(tuple(text[i:i + n]))
return ngram_set
|
python
|
def _get_ngrams(n, text):
"""Calculates n-grams.
Args:
n: which n-grams to calculate
text: An array of tokens
Returns:
A set of n-grams
"""
ngram_set = set()
text_length = len(text)
max_index_ngram_start = text_length - n
for i in range(max_index_ngram_start + 1):
ngram_set.add(tuple(text[i:i + n]))
return ngram_set
|
[
"def",
"_get_ngrams",
"(",
"n",
",",
"text",
")",
":",
"ngram_set",
"=",
"set",
"(",
")",
"text_length",
"=",
"len",
"(",
"text",
")",
"max_index_ngram_start",
"=",
"text_length",
"-",
"n",
"for",
"i",
"in",
"range",
"(",
"max_index_ngram_start",
"+",
"1",
")",
":",
"ngram_set",
".",
"add",
"(",
"tuple",
"(",
"text",
"[",
"i",
":",
"i",
"+",
"n",
"]",
")",
")",
"return",
"ngram_set"
] |
Calculates n-grams.
Args:
n: which n-grams to calculate
text: An array of tokens
Returns:
A set of n-grams
|
[
"Calculates",
"n",
"-",
"grams",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/utils/rouge.py#L156-L171
|
train
|
Calculates n - grams in a set of tokens.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x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ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(130 - 82) + chr(11586 - 11475) + chr(0b110011) + chr(0b110000) + chr(0b1010 + 0o50), 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(0b110011) + chr(0b110101) + chr(0b110011), ord("\x08")), ehT0Px3KOsy9(chr(0b0 + 0o60) + chr(0b1101000 + 0o7) + chr(0b110011) + chr(51) + chr(51), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110100) + chr(50), 0b1000), ehT0Px3KOsy9('\060' + chr(0b11110 + 0o121) + chr(311 - 260) + '\065' + chr(2379 - 2326), 17201 - 17193), ehT0Px3KOsy9(chr(0b110000) + chr(0b101000 + 0o107) + chr(51) + chr(48) + chr(0b110000), ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + '\x33' + '\x33' + chr(53), 0b1000), ehT0Px3KOsy9(chr(0b1110 + 0o42) + chr(0b111001 + 0o66) + '\067' + '\x37', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b100001 + 0o116) + chr(0b100010 + 0o20) + chr(1844 - 1792) + chr(0b110111), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1010010 + 0o35) + chr(54) + '\x31', ord("\x08")), ehT0Px3KOsy9(chr(0b101 + 0o53) + chr(111) + chr(374 - 319) + chr(458 - 405), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(9258 - 9147) + chr(0b101001 + 0o12) + '\x34' + '\x34', 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\062' + '\x37' + chr(0b110001), 0b1000), ehT0Px3KOsy9(chr(2107 - 2059) + chr(0b1000100 + 0o53) + '\x33' + chr(0b101111 + 0o3) + '\067', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(426 - 376) + chr(0b10011 + 0o44) + chr(0b110011), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + '\x31' + chr(975 - 922) + chr(732 - 680), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1011011 + 0o24) + chr(51) + '\067' + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(2174 - 2126) + chr(111) + chr(0b10100 + 0o36) + '\x31' + chr(0b110010), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(3067 - 2956) + '\x32' + '\061', 0o10), ehT0Px3KOsy9(chr(1437 - 1389) + chr(111) + chr(0b101 + 0o56), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b11 + 0o154) + '\061' + chr(55) + '\x30', 12989 - 12981), ehT0Px3KOsy9('\x30' + '\x6f' + '\x32' + '\067' + chr(0b11111 + 0o23), ord("\x08")), ehT0Px3KOsy9(chr(1203 - 1155) + '\x6f' + '\x31' + chr(51) + chr(0b110101), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1100110 + 0o11) + '\061' + chr(53) + '\x31', 62837 - 62829), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\062' + chr(2385 - 2335) + chr(1815 - 1762), 7809 - 7801), ehT0Px3KOsy9('\060' + chr(111) + chr(570 - 521) + '\x37' + chr(0b110000), 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b100010 + 0o115) + chr(0b110001) + chr(52) + '\x30', 0o10), ehT0Px3KOsy9(chr(48) + chr(8456 - 8345) + '\063' + '\067' + chr(2454 - 2403), 54546 - 54538), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\065' + chr(2207 - 2153), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x32' + '\x35' + chr(0b110110), 0b1000), ehT0Px3KOsy9(chr(338 - 290) + '\157' + '\066' + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(1354 - 1306) + chr(0b111011 + 0o64) + '\x32' + chr(0b110111) + '\x33', 8), ehT0Px3KOsy9(chr(1430 - 1382) + '\157' + chr(51) + chr(1800 - 1748) + chr(0b10010 + 0o37), 35596 - 35588), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\061' + chr(1397 - 1342), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1000 + 0o147) + chr(1827 - 1773) + chr(50), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1001011 + 0o44) + chr(0b11 + 0o56) + chr(50) + chr(53), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(4782 - 4671) + '\066' + '\061', 8), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110011), 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b111011 + 0o64) + chr(0b110001) + chr(2516 - 2464) + '\x37', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b100000 + 0o22) + chr(0b11101 + 0o26) + '\x35', 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\065' + chr(2284 - 2236), 64971 - 64963)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xec'), '\x64' + chr(0b10011 + 0o122) + '\x63' + chr(0b110001 + 0o76) + '\x64' + chr(9078 - 8977))(chr(117) + '\x74' + '\146' + '\x2d' + chr(0b100001 + 0o27)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def U5y_eLalhMou(m1NkCryOw9Bx, Ah1rInvg48Hb):
Bo20gaZfz4L1 = MVEN8G6CxlvR()
qn6MJHZSjNjQ = c2A0yzQpDQB3(Ah1rInvg48Hb)
mrB5OsJm_TUQ = qn6MJHZSjNjQ - m1NkCryOw9Bx
for WVxHKyX45z_L in vQr8gNKaIaWE(mrB5OsJm_TUQ + ehT0Px3KOsy9('\060' + '\x6f' + '\061', ord("\x08"))):
xafqLlk3kkUe(Bo20gaZfz4L1, xafqLlk3kkUe(SXOLrMavuUCe(b'\xa3\x8f\xbf'), '\144' + '\145' + chr(1581 - 1482) + chr(0b101000 + 0o107) + chr(100) + chr(7242 - 7141))(chr(11779 - 11662) + '\164' + '\x66' + chr(45) + chr(1703 - 1647)))(KNyTy8rYcwji(Ah1rInvg48Hb[WVxHKyX45z_L:WVxHKyX45z_L + m1NkCryOw9Bx]))
return Bo20gaZfz4L1
|
tensorflow/tensor2tensor
|
tensor2tensor/utils/rouge.py
|
rouge_2_fscore
|
def rouge_2_fscore(predictions, labels, **unused_kwargs):
"""ROUGE-2 F1 score computation between labels and predictions.
This is an approximate ROUGE scoring method since we do not glue word pieces
or decode the ids and tokenize the output.
Args:
predictions: tensor, model predictions
labels: tensor, gold output.
Returns:
rouge2_fscore: approx rouge-2 f1 score.
"""
outputs = tf.to_int32(tf.argmax(predictions, axis=-1))
# Convert the outputs and labels to a [batch_size, input_length] tensor.
outputs = tf.squeeze(outputs, axis=[-1, -2])
labels = tf.squeeze(labels, axis=[-1, -2])
rouge_2_f_score = tf.py_func(rouge_n, (outputs, labels), tf.float32)
return rouge_2_f_score, tf.constant(1.0)
|
python
|
def rouge_2_fscore(predictions, labels, **unused_kwargs):
"""ROUGE-2 F1 score computation between labels and predictions.
This is an approximate ROUGE scoring method since we do not glue word pieces
or decode the ids and tokenize the output.
Args:
predictions: tensor, model predictions
labels: tensor, gold output.
Returns:
rouge2_fscore: approx rouge-2 f1 score.
"""
outputs = tf.to_int32(tf.argmax(predictions, axis=-1))
# Convert the outputs and labels to a [batch_size, input_length] tensor.
outputs = tf.squeeze(outputs, axis=[-1, -2])
labels = tf.squeeze(labels, axis=[-1, -2])
rouge_2_f_score = tf.py_func(rouge_n, (outputs, labels), tf.float32)
return rouge_2_f_score, tf.constant(1.0)
|
[
"def",
"rouge_2_fscore",
"(",
"predictions",
",",
"labels",
",",
"*",
"*",
"unused_kwargs",
")",
":",
"outputs",
"=",
"tf",
".",
"to_int32",
"(",
"tf",
".",
"argmax",
"(",
"predictions",
",",
"axis",
"=",
"-",
"1",
")",
")",
"# Convert the outputs and labels to a [batch_size, input_length] tensor.",
"outputs",
"=",
"tf",
".",
"squeeze",
"(",
"outputs",
",",
"axis",
"=",
"[",
"-",
"1",
",",
"-",
"2",
"]",
")",
"labels",
"=",
"tf",
".",
"squeeze",
"(",
"labels",
",",
"axis",
"=",
"[",
"-",
"1",
",",
"-",
"2",
"]",
")",
"rouge_2_f_score",
"=",
"tf",
".",
"py_func",
"(",
"rouge_n",
",",
"(",
"outputs",
",",
"labels",
")",
",",
"tf",
".",
"float32",
")",
"return",
"rouge_2_f_score",
",",
"tf",
".",
"constant",
"(",
"1.0",
")"
] |
ROUGE-2 F1 score computation between labels and predictions.
This is an approximate ROUGE scoring method since we do not glue word pieces
or decode the ids and tokenize the output.
Args:
predictions: tensor, model predictions
labels: tensor, gold output.
Returns:
rouge2_fscore: approx rouge-2 f1 score.
|
[
"ROUGE",
"-",
"2",
"F1",
"score",
"computation",
"between",
"labels",
"and",
"predictions",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/utils/rouge.py#L217-L236
|
train
|
ROUGE - 2 F1 score computation between labels and predictions.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICj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BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110111) + chr(1185 - 1130), 14508 - 14500), ehT0Px3KOsy9(chr(0b101011 + 0o5) + chr(5659 - 5548) + chr(0b100 + 0o57) + chr(0b100001 + 0o17) + chr(50), 0o10), ehT0Px3KOsy9(chr(0b1011 + 0o45) + '\157' + chr(0b0 + 0o63) + chr(0b11 + 0o60) + chr(0b110001), 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(900 - 849) + chr(1753 - 1702) + chr(1029 - 980), 8), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110011) + chr(0b100010 + 0o21) + chr(55), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x32' + chr(50) + chr(51), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b10 + 0o61) + chr(0b10010 + 0o36) + chr(49), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(51) + '\x34', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b10000 + 0o43) + '\062', ord("\x08")), ehT0Px3KOsy9(chr(2035 - 1987) + chr(0b1101111) + '\061' + chr(55) + chr(539 - 490), 0o10), ehT0Px3KOsy9(chr(959 - 911) + chr(7706 - 7595) + chr(50) + chr(0b110000) + chr(0b110001), 0o10), ehT0Px3KOsy9(chr(48) + chr(9050 - 8939) + '\063' + '\x30' + chr(52), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(518 - 407) + chr(596 - 541) + '\x30', 9794 - 9786), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x31' + chr(2204 - 2155) + chr(0b10011 + 0o40), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(51) + chr(397 - 345), 8), ehT0Px3KOsy9(chr(0b100001 + 0o17) + chr(6287 - 6176) + '\061' + chr(103 - 53) + chr(0b110110), 0b1000), ehT0Px3KOsy9(chr(0b100001 + 0o17) + chr(0b1001 + 0o146) + chr(49) + chr(52) + chr(778 - 727), 0b1000), ehT0Px3KOsy9(chr(0b100000 + 0o20) + chr(0b1101111) + chr(1120 - 1069) + chr(1505 - 1450) + chr(2098 - 2044), 25915 - 25907), ehT0Px3KOsy9('\060' + '\x6f' + '\062' + chr(0b1101 + 0o43), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + '\065' + chr(0b110001), 22294 - 22286), ehT0Px3KOsy9(chr(48) + chr(983 - 872) + chr(0b100101 + 0o15) + chr(1157 - 1107) + chr(0b101101 + 0o11), 0b1000), ehT0Px3KOsy9(chr(1411 - 1363) + chr(1677 - 1566) + chr(0b110010) + chr(697 - 646) + chr(0b110011), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(55) + chr(2088 - 2035), 0o10), ehT0Px3KOsy9('\x30' + chr(5089 - 4978) + chr(0b110001) + '\065' + '\060', 0o10), ehT0Px3KOsy9(chr(639 - 591) + '\157' + chr(0b101010 + 0o7) + chr(0b110001 + 0o2) + chr(52), 7697 - 7689), ehT0Px3KOsy9('\060' + chr(111) + '\061' + '\x34' + '\060', 27295 - 27287), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b101100 + 0o6) + chr(2644 - 2591) + chr(1929 - 1876), 0o10), ehT0Px3KOsy9(chr(0b1 + 0o57) + chr(111) + chr(369 - 318) + chr(0b110001), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b10000 + 0o43) + '\x34' + chr(0b110111), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(50) + chr(0b110001) + chr(782 - 731), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(804 - 753) + chr(0b110110) + '\x35', 0o10), ehT0Px3KOsy9('\060' + '\x6f' + '\062' + '\067' + chr(0b101001 + 0o16), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110010) + '\065', ord("\x08")), ehT0Px3KOsy9('\060' + chr(9566 - 9455) + chr(50) + chr(0b11 + 0o55) + chr(0b110011), 19096 - 19088), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\061' + '\x34' + chr(2791 - 2737), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\061' + chr(0b110101) + chr(463 - 410), ord("\x08")), ehT0Px3KOsy9(chr(0b100000 + 0o20) + chr(0b1101111) + chr(0b110001) + chr(1059 - 1008) + chr(54), 13282 - 13274), ehT0Px3KOsy9(chr(795 - 747) + '\x6f' + chr(0b110011) + '\060' + chr(0b100100 + 0o22), ord("\x08")), ehT0Px3KOsy9(chr(890 - 842) + chr(111) + chr(0b10110 + 0o33) + chr(1256 - 1202), 29277 - 29269), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(50) + chr(52) + chr(650 - 599), ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(573 - 520) + '\060', 55248 - 55240)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x11'), chr(100) + chr(101) + chr(0b111011 + 0o50) + chr(0b1101111) + chr(0b1100100) + chr(101))(chr(0b1100111 + 0o16) + chr(116) + chr(0b1011 + 0o133) + '\x2d' + chr(266 - 210)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def GrRTsglkmdoi(qIQi_VFCIFZL, uXMK81tmdpTM, **Dl7jGuYToI93):
Dx_DllZ8uCko = IDJ2eXGCBCDu.to_int32(IDJ2eXGCBCDu.argmax(qIQi_VFCIFZL, axis=-ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b101 + 0o54), ord("\x08"))))
Dx_DllZ8uCko = IDJ2eXGCBCDu.squeeze(Dx_DllZ8uCko, axis=[-ehT0Px3KOsy9(chr(48) + '\157' + chr(0b11100 + 0o25), 8), -ehT0Px3KOsy9('\x30' + chr(111) + '\062', 0b1000)])
uXMK81tmdpTM = IDJ2eXGCBCDu.squeeze(uXMK81tmdpTM, axis=[-ehT0Px3KOsy9(chr(48) + '\x6f' + chr(49), 8), -ehT0Px3KOsy9(chr(0b110000) + chr(12206 - 12095) + chr(50), 8)])
BnsoDWQNsbhj = IDJ2eXGCBCDu.py_func(f7Vn6UH4WL71, (Dx_DllZ8uCko, uXMK81tmdpTM), IDJ2eXGCBCDu.float32)
return (BnsoDWQNsbhj, xafqLlk3kkUe(IDJ2eXGCBCDu, xafqLlk3kkUe(SXOLrMavuUCe(b'\\\xad\xb7\xaa\xab\xf2\xafh'), '\144' + '\145' + '\143' + chr(111) + chr(100) + '\145')('\x75' + chr(12030 - 11914) + chr(102) + chr(1212 - 1167) + '\070'))(1.0))
|
tensorflow/tensor2tensor
|
tensor2tensor/data_generators/multi_problem.py
|
normalize_example_nlp
|
def normalize_example_nlp(task, example, is_infer, vocab_type, vocab_offset,
max_input_length, max_target_length,
fixed_train_length):
"""Normalize the examples from different tasks so they can be merged.
This function is specific to NLP tasks and normalizes them so that in the
end the example only has "targets" and "task_id". For tasks that originally
have inputs, this is done by appending task_id to the inputs and prepending
targets, so normalized_targets = inputs task_id targets. For classification
tasks, targets are constructed by spelling out the class.
Args:
task: the Problem class of the task we are normalizing.
example: a dictionary of tensors, the example to normalize.
is_infer: bool, whether we are performing inference or not.
vocab_type: the type of vocabulary in use.
vocab_offset: integer, offset index for subword vocabularies.
max_input_length: maximum length to cut inputs to.
max_target_length: maximum length to cut targets to.
fixed_train_length: set length to this size if > 0.
Returns:
a dictionary of tensors, like example, after normalizing, which in this
case means that it only has "targets" and "task_id" as feature.
"""
if task.has_inputs:
example["inputs"] = example["inputs"][:-1] # remove EOS token
if hasattr(task, "class_labels"):
if vocab_type == text_problems.VocabType.CHARACTER:
# TODO(urvashik): handle the case where num_labels > 9
example["targets"] = tf.cast(discretization.int_to_bit(
example["targets"], 1, base=10) + 50, tf.int64)
example["targets"] = tf.squeeze(example["targets"], axis=[-1])
elif vocab_type == text_problems.VocabType.SUBWORD:
example["targets"] = vocab_offset + example["targets"]
else:
# sequence with inputs and targets eg: summarization
if task.has_inputs:
if max_input_length > 0:
example["inputs"] = example["inputs"][:max_input_length]
# Do not truncate targets during inference with beam decoding.
if max_target_length > 0 and not is_infer:
example["targets"] = example["targets"][:max_target_length]
def make_constant_shape(x, size):
x = x[:size]
xlen = tf.shape(x)[0]
x = tf.pad(x, [[0, size - xlen]])
return tf.reshape(x, [size])
if task.has_inputs:
if is_infer:
concat_list = [example["inputs"], [task.task_id]]
example["inputs"] = tf.concat(concat_list, axis=0)
else:
inputs = example.pop("inputs")
concat_list = [inputs, [task.task_id], example["targets"]]
example["targets"] = tf.concat(concat_list, axis=0)
if fixed_train_length > 0:
example["targets"] = make_constant_shape(
example["targets"], fixed_train_length)
else:
concat_list = [[task.task_id], example["targets"]]
example["targets"] = tf.concat(concat_list, axis=0)
if not is_infer and fixed_train_length > 0:
example["targets"] = make_constant_shape(
example["targets"], fixed_train_length)
example["task_id"] = tf.constant([task.task_id], dtype=tf.int64)
return example
|
python
|
def normalize_example_nlp(task, example, is_infer, vocab_type, vocab_offset,
max_input_length, max_target_length,
fixed_train_length):
"""Normalize the examples from different tasks so they can be merged.
This function is specific to NLP tasks and normalizes them so that in the
end the example only has "targets" and "task_id". For tasks that originally
have inputs, this is done by appending task_id to the inputs and prepending
targets, so normalized_targets = inputs task_id targets. For classification
tasks, targets are constructed by spelling out the class.
Args:
task: the Problem class of the task we are normalizing.
example: a dictionary of tensors, the example to normalize.
is_infer: bool, whether we are performing inference or not.
vocab_type: the type of vocabulary in use.
vocab_offset: integer, offset index for subword vocabularies.
max_input_length: maximum length to cut inputs to.
max_target_length: maximum length to cut targets to.
fixed_train_length: set length to this size if > 0.
Returns:
a dictionary of tensors, like example, after normalizing, which in this
case means that it only has "targets" and "task_id" as feature.
"""
if task.has_inputs:
example["inputs"] = example["inputs"][:-1] # remove EOS token
if hasattr(task, "class_labels"):
if vocab_type == text_problems.VocabType.CHARACTER:
# TODO(urvashik): handle the case where num_labels > 9
example["targets"] = tf.cast(discretization.int_to_bit(
example["targets"], 1, base=10) + 50, tf.int64)
example["targets"] = tf.squeeze(example["targets"], axis=[-1])
elif vocab_type == text_problems.VocabType.SUBWORD:
example["targets"] = vocab_offset + example["targets"]
else:
# sequence with inputs and targets eg: summarization
if task.has_inputs:
if max_input_length > 0:
example["inputs"] = example["inputs"][:max_input_length]
# Do not truncate targets during inference with beam decoding.
if max_target_length > 0 and not is_infer:
example["targets"] = example["targets"][:max_target_length]
def make_constant_shape(x, size):
x = x[:size]
xlen = tf.shape(x)[0]
x = tf.pad(x, [[0, size - xlen]])
return tf.reshape(x, [size])
if task.has_inputs:
if is_infer:
concat_list = [example["inputs"], [task.task_id]]
example["inputs"] = tf.concat(concat_list, axis=0)
else:
inputs = example.pop("inputs")
concat_list = [inputs, [task.task_id], example["targets"]]
example["targets"] = tf.concat(concat_list, axis=0)
if fixed_train_length > 0:
example["targets"] = make_constant_shape(
example["targets"], fixed_train_length)
else:
concat_list = [[task.task_id], example["targets"]]
example["targets"] = tf.concat(concat_list, axis=0)
if not is_infer and fixed_train_length > 0:
example["targets"] = make_constant_shape(
example["targets"], fixed_train_length)
example["task_id"] = tf.constant([task.task_id], dtype=tf.int64)
return example
|
[
"def",
"normalize_example_nlp",
"(",
"task",
",",
"example",
",",
"is_infer",
",",
"vocab_type",
",",
"vocab_offset",
",",
"max_input_length",
",",
"max_target_length",
",",
"fixed_train_length",
")",
":",
"if",
"task",
".",
"has_inputs",
":",
"example",
"[",
"\"inputs\"",
"]",
"=",
"example",
"[",
"\"inputs\"",
"]",
"[",
":",
"-",
"1",
"]",
"# remove EOS token",
"if",
"hasattr",
"(",
"task",
",",
"\"class_labels\"",
")",
":",
"if",
"vocab_type",
"==",
"text_problems",
".",
"VocabType",
".",
"CHARACTER",
":",
"# TODO(urvashik): handle the case where num_labels > 9",
"example",
"[",
"\"targets\"",
"]",
"=",
"tf",
".",
"cast",
"(",
"discretization",
".",
"int_to_bit",
"(",
"example",
"[",
"\"targets\"",
"]",
",",
"1",
",",
"base",
"=",
"10",
")",
"+",
"50",
",",
"tf",
".",
"int64",
")",
"example",
"[",
"\"targets\"",
"]",
"=",
"tf",
".",
"squeeze",
"(",
"example",
"[",
"\"targets\"",
"]",
",",
"axis",
"=",
"[",
"-",
"1",
"]",
")",
"elif",
"vocab_type",
"==",
"text_problems",
".",
"VocabType",
".",
"SUBWORD",
":",
"example",
"[",
"\"targets\"",
"]",
"=",
"vocab_offset",
"+",
"example",
"[",
"\"targets\"",
"]",
"else",
":",
"# sequence with inputs and targets eg: summarization",
"if",
"task",
".",
"has_inputs",
":",
"if",
"max_input_length",
">",
"0",
":",
"example",
"[",
"\"inputs\"",
"]",
"=",
"example",
"[",
"\"inputs\"",
"]",
"[",
":",
"max_input_length",
"]",
"# Do not truncate targets during inference with beam decoding.",
"if",
"max_target_length",
">",
"0",
"and",
"not",
"is_infer",
":",
"example",
"[",
"\"targets\"",
"]",
"=",
"example",
"[",
"\"targets\"",
"]",
"[",
":",
"max_target_length",
"]",
"def",
"make_constant_shape",
"(",
"x",
",",
"size",
")",
":",
"x",
"=",
"x",
"[",
":",
"size",
"]",
"xlen",
"=",
"tf",
".",
"shape",
"(",
"x",
")",
"[",
"0",
"]",
"x",
"=",
"tf",
".",
"pad",
"(",
"x",
",",
"[",
"[",
"0",
",",
"size",
"-",
"xlen",
"]",
"]",
")",
"return",
"tf",
".",
"reshape",
"(",
"x",
",",
"[",
"size",
"]",
")",
"if",
"task",
".",
"has_inputs",
":",
"if",
"is_infer",
":",
"concat_list",
"=",
"[",
"example",
"[",
"\"inputs\"",
"]",
",",
"[",
"task",
".",
"task_id",
"]",
"]",
"example",
"[",
"\"inputs\"",
"]",
"=",
"tf",
".",
"concat",
"(",
"concat_list",
",",
"axis",
"=",
"0",
")",
"else",
":",
"inputs",
"=",
"example",
".",
"pop",
"(",
"\"inputs\"",
")",
"concat_list",
"=",
"[",
"inputs",
",",
"[",
"task",
".",
"task_id",
"]",
",",
"example",
"[",
"\"targets\"",
"]",
"]",
"example",
"[",
"\"targets\"",
"]",
"=",
"tf",
".",
"concat",
"(",
"concat_list",
",",
"axis",
"=",
"0",
")",
"if",
"fixed_train_length",
">",
"0",
":",
"example",
"[",
"\"targets\"",
"]",
"=",
"make_constant_shape",
"(",
"example",
"[",
"\"targets\"",
"]",
",",
"fixed_train_length",
")",
"else",
":",
"concat_list",
"=",
"[",
"[",
"task",
".",
"task_id",
"]",
",",
"example",
"[",
"\"targets\"",
"]",
"]",
"example",
"[",
"\"targets\"",
"]",
"=",
"tf",
".",
"concat",
"(",
"concat_list",
",",
"axis",
"=",
"0",
")",
"if",
"not",
"is_infer",
"and",
"fixed_train_length",
">",
"0",
":",
"example",
"[",
"\"targets\"",
"]",
"=",
"make_constant_shape",
"(",
"example",
"[",
"\"targets\"",
"]",
",",
"fixed_train_length",
")",
"example",
"[",
"\"task_id\"",
"]",
"=",
"tf",
".",
"constant",
"(",
"[",
"task",
".",
"task_id",
"]",
",",
"dtype",
"=",
"tf",
".",
"int64",
")",
"return",
"example"
] |
Normalize the examples from different tasks so they can be merged.
This function is specific to NLP tasks and normalizes them so that in the
end the example only has "targets" and "task_id". For tasks that originally
have inputs, this is done by appending task_id to the inputs and prepending
targets, so normalized_targets = inputs task_id targets. For classification
tasks, targets are constructed by spelling out the class.
Args:
task: the Problem class of the task we are normalizing.
example: a dictionary of tensors, the example to normalize.
is_infer: bool, whether we are performing inference or not.
vocab_type: the type of vocabulary in use.
vocab_offset: integer, offset index for subword vocabularies.
max_input_length: maximum length to cut inputs to.
max_target_length: maximum length to cut targets to.
fixed_train_length: set length to this size if > 0.
Returns:
a dictionary of tensors, like example, after normalizing, which in this
case means that it only has "targets" and "task_id" as feature.
|
[
"Normalize",
"the",
"examples",
"from",
"different",
"tasks",
"so",
"they",
"can",
"be",
"merged",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/data_generators/multi_problem.py#L38-L108
|
train
|
This function normalizes the examples from different tasks so they can be merged.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJC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ferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\060' + '\157' + chr(0b1110 + 0o43) + chr(0b100000 + 0o20) + '\060', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b11000 + 0o127) + chr(1174 - 1124) + chr(50) + chr(1364 - 1312), 0b1000), ehT0Px3KOsy9(chr(750 - 702) + '\x6f' + chr(0b11000 + 0o31) + chr(0b110000) + chr(1897 - 1849), 8), ehT0Px3KOsy9('\x30' + chr(111) + chr(1472 - 1419) + chr(0b110010), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(51) + '\x31' + chr(0b110101), 0o10), ehT0Px3KOsy9(chr(0b110 + 0o52) + '\157' + chr(1786 - 1737) + chr(0b10111 + 0o31) + '\067', 0o10), ehT0Px3KOsy9(chr(1217 - 1169) + chr(0b1101111) + chr(0b1100 + 0o47) + '\x35' + '\x35', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(7645 - 7534) + chr(0b10001 + 0o41) + '\065' + '\x35', 51569 - 51561), ehT0Px3KOsy9(chr(565 - 517) + '\x6f' + chr(0b110011) + chr(146 - 93) + chr(0b0 + 0o64), 0o10), ehT0Px3KOsy9(chr(0b100111 + 0o11) + chr(997 - 886) + chr(1611 - 1562) + chr(0b101100 + 0o12) + chr(52), 29422 - 29414), ehT0Px3KOsy9(chr(0b100111 + 0o11) + chr(124 - 13) + chr(564 - 515) + chr(0b110000) + chr(2027 - 1977), 0o10), ehT0Px3KOsy9('\x30' + chr(4873 - 4762) + chr(51) + '\x35' + chr(0b100111 + 0o20), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b111 + 0o52) + '\066' + '\x32', 0o10), ehT0Px3KOsy9(chr(48) + chr(7492 - 7381) + chr(51) + chr(0b110110) + '\x36', 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(604 - 555) + chr(818 - 769) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(0b101 + 0o53) + chr(1115 - 1004) + chr(0b110011), 0o10), ehT0Px3KOsy9(chr(129 - 81) + chr(0b1101111) + '\x32' + chr(605 - 552) + chr(51), 0o10), ehT0Px3KOsy9(chr(2239 - 2191) + chr(0b1101111) + '\x32' + chr(0b110100) + '\066', ord("\x08")), ehT0Px3KOsy9(chr(1952 - 1904) + '\157' + chr(0b110001) + chr(50) + chr(0b110001), ord("\x08")), ehT0Px3KOsy9(chr(427 - 379) + chr(0b1101111) + chr(1830 - 1780) + chr(49) + chr(0b101110 + 0o7), 0b1000), ehT0Px3KOsy9('\060' + '\157' + '\x37' + chr(0b11100 + 0o30), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + '\067' + chr(0b100111 + 0o11), 0o10), ehT0Px3KOsy9(chr(48) + chr(3572 - 3461) + chr(239 - 190) + chr(995 - 943) + chr(0b11001 + 0o33), 0o10), ehT0Px3KOsy9(chr(825 - 777) + '\157' + '\065', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(1214 - 1164) + chr(0b110101) + chr(0b110111), 0b1000), ehT0Px3KOsy9(chr(0b10100 + 0o34) + '\x6f' + '\x36' + chr(0b110010), 28906 - 28898), ehT0Px3KOsy9('\060' + chr(0b111100 + 0o63) + chr(0b101110 + 0o3) + chr(51) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(50) + chr(55) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b111111 + 0o60) + chr(51) + chr(0b110000 + 0o2) + '\060', 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(53) + chr(54), 6612 - 6604), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x32' + chr(0b110011) + chr(1393 - 1344), 0b1000), ehT0Px3KOsy9(chr(1907 - 1859) + chr(111) + '\062' + chr(55) + '\x34', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110 + 0o55) + chr(108 - 59) + chr(52), ord("\x08")), ehT0Px3KOsy9(chr(2008 - 1960) + '\x6f' + chr(0b110001) + '\x32' + '\x35', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1001110 + 0o41) + chr(0b110100) + '\x37', 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(1008 - 954) + '\x32', 8), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110001) + '\x33' + '\066', ord("\x08")), ehT0Px3KOsy9(chr(0b100000 + 0o20) + chr(0b1101111) + chr(0b10110 + 0o33) + '\x31', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(50) + chr(0b10011 + 0o41) + chr(49), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(4521 - 4410) + chr(2125 - 2072) + '\x37', 32429 - 32421)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b111 + 0o51) + '\157' + '\065' + chr(48), ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'n'), chr(7985 - 7885) + '\145' + chr(0b1100011) + chr(0b1010110 + 0o31) + '\144' + chr(0b1100101))(chr(6968 - 6851) + chr(0b1110100) + chr(0b110010 + 0o64) + chr(1356 - 1311) + chr(0b111000)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def _nHSm8T5TUZe(md1d2YtjKvCG, kP4qaKv0ZkGv, b_o_LKDx445U, u9HmDYfas07P, itubyMKOAlsy, hX_7BMNobORJ, _93hATE4geR3, IYqY9K8m5qcC):
if xafqLlk3kkUe(md1d2YtjKvCG, xafqLlk3kkUe(SXOLrMavuUCe(b'(\xf53u\xa4)\x9d\xd8\x98\x07'), '\x64' + '\x65' + '\x63' + chr(0b1100010 + 0o15) + '\144' + '\145')(chr(0b1110101 + 0o0) + '\164' + chr(0b1100110) + chr(117 - 72) + chr(56))):
kP4qaKv0ZkGv[xafqLlk3kkUe(SXOLrMavuUCe(b')\xfa0_\xb94'), chr(0b1100100) + chr(101) + chr(0b1100011) + '\157' + chr(0b1100100) + chr(4239 - 4138))(chr(0b1110101) + '\164' + chr(4210 - 4108) + '\x2d' + chr(0b110101 + 0o3))] = kP4qaKv0ZkGv[xafqLlk3kkUe(SXOLrMavuUCe(b')\xfa0_\xb94'), chr(3471 - 3371) + chr(0b1100101) + chr(0b1100011) + '\x6f' + '\x64' + chr(0b11010 + 0o113))('\x75' + chr(116) + chr(102) + chr(1945 - 1900) + chr(0b100101 + 0o23))][:-ehT0Px3KOsy9(chr(0b11111 + 0o21) + chr(0b1101111) + '\061', 51359 - 51351)]
if lot1PSoAwYhj(md1d2YtjKvCG, xafqLlk3kkUe(SXOLrMavuUCe(b'#\xf8!Y\xbe\x18\x81\xcc\x8e\x11.\x9c'), chr(100) + '\x65' + chr(3888 - 3789) + chr(8429 - 8318) + '\144' + '\x65')(chr(4483 - 4366) + chr(10082 - 9966) + chr(0b1011011 + 0o13) + chr(0b100001 + 0o14) + chr(1851 - 1795))):
if u9HmDYfas07P == xafqLlk3kkUe(GkH56QMxhclz.VocabType, xafqLlk3kkUe(SXOLrMavuUCe(b'\x03\xdc\x01x\x8c\x04\xb9\xe8\xbe'), '\144' + '\145' + '\143' + chr(0b1101111) + chr(0b1100100) + chr(0b1100101))(chr(8249 - 8132) + '\164' + chr(0b1100110) + chr(0b101101) + chr(56))):
kP4qaKv0ZkGv[xafqLlk3kkUe(SXOLrMavuUCe(b'4\xf52M\xa83\x9e'), chr(100) + chr(0b1100101) + '\x63' + chr(11995 - 11884) + '\x64' + chr(4069 - 3968))(chr(117) + chr(0b1110100) + '\146' + chr(0b101101) + '\070')] = IDJ2eXGCBCDu.cast(mllfN6mU2TGo.int_to_bit(kP4qaKv0ZkGv[xafqLlk3kkUe(SXOLrMavuUCe(b'4\xf52M\xa83\x9e'), '\144' + '\145' + chr(0b110111 + 0o54) + chr(111) + '\x64' + '\145')('\165' + chr(116) + chr(1199 - 1097) + chr(45) + chr(56))], ehT0Px3KOsy9(chr(191 - 143) + chr(0b10000 + 0o137) + chr(2063 - 2014), 8), base=ehT0Px3KOsy9(chr(123 - 75) + '\157' + '\x31' + '\062', 0o10)) + ehT0Px3KOsy9(chr(48) + '\x6f' + chr(54) + chr(0b110010), 8), IDJ2eXGCBCDu.int64)
kP4qaKv0ZkGv[xafqLlk3kkUe(SXOLrMavuUCe(b'4\xf52M\xa83\x9e'), '\x64' + '\145' + chr(0b1100011) + chr(7633 - 7522) + '\x64' + chr(101))('\165' + '\x74' + chr(0b110111 + 0o57) + chr(0b101101) + chr(0b1010 + 0o56))] = IDJ2eXGCBCDu.squeeze(kP4qaKv0ZkGv[xafqLlk3kkUe(SXOLrMavuUCe(b'4\xf52M\xa83\x9e'), '\144' + chr(0b1100101) + chr(0b1100011) + chr(0b11110 + 0o121) + chr(0b1101 + 0o127) + chr(0b110011 + 0o62))('\165' + '\x74' + chr(2433 - 2331) + '\055' + '\x38')], axis=[-ehT0Px3KOsy9(chr(0b101000 + 0o10) + '\x6f' + chr(75 - 26), 8)])
elif u9HmDYfas07P == xafqLlk3kkUe(GkH56QMxhclz.VocabType, xafqLlk3kkUe(SXOLrMavuUCe(b'\x13\xc1\x02}\x82\x15\xa9'), chr(0b1010100 + 0o20) + chr(0b1100101) + '\x63' + chr(111) + '\x64' + chr(6869 - 6768))('\x75' + chr(7032 - 6916) + chr(0b100110 + 0o100) + chr(593 - 548) + '\x38')):
kP4qaKv0ZkGv[xafqLlk3kkUe(SXOLrMavuUCe(b'4\xf52M\xa83\x9e'), '\144' + chr(1638 - 1537) + '\143' + '\x6f' + '\144' + chr(101))(chr(0b1110101) + '\164' + chr(0b110110 + 0o60) + '\055' + chr(1039 - 983))] = itubyMKOAlsy + kP4qaKv0ZkGv[xafqLlk3kkUe(SXOLrMavuUCe(b'4\xf52M\xa83\x9e'), chr(100) + chr(101) + '\x63' + chr(111) + chr(0b1100100) + chr(101))(chr(0b1110101) + chr(0b1010010 + 0o42) + chr(3251 - 3149) + chr(1311 - 1266) + '\x38')]
elif xafqLlk3kkUe(md1d2YtjKvCG, xafqLlk3kkUe(SXOLrMavuUCe(b'(\xf53u\xa4)\x9d\xd8\x98\x07'), chr(0b1100100) + '\x65' + chr(0b10010 + 0o121) + chr(0b1101111) + chr(0b1010110 + 0o16) + chr(0b101010 + 0o73))(chr(0b1100000 + 0o25) + chr(116) + '\x66' + chr(45) + chr(0b101111 + 0o11))):
if hX_7BMNobORJ > ehT0Px3KOsy9(chr(48) + '\157' + chr(1142 - 1094), ord("\x08")):
kP4qaKv0ZkGv[xafqLlk3kkUe(SXOLrMavuUCe(b')\xfa0_\xb94'), chr(0b1100100) + chr(101) + chr(1814 - 1715) + chr(0b1101111) + '\144' + '\x65')(chr(0b111 + 0o156) + '\x74' + '\146' + '\055' + '\x38')] = kP4qaKv0ZkGv[xafqLlk3kkUe(SXOLrMavuUCe(b')\xfa0_\xb94'), '\144' + chr(0b1000111 + 0o36) + '\143' + chr(0b10001 + 0o136) + '\144' + chr(101))('\165' + chr(0b1110100) + '\x66' + chr(0b100100 + 0o11) + chr(0b111000))][:hX_7BMNobORJ]
if _93hATE4geR3 > ehT0Px3KOsy9(chr(0b11100 + 0o24) + '\x6f' + '\x30', 8) and (not b_o_LKDx445U):
kP4qaKv0ZkGv[xafqLlk3kkUe(SXOLrMavuUCe(b'4\xf52M\xa83\x9e'), '\144' + chr(0b1011100 + 0o11) + chr(0b11000 + 0o113) + chr(4871 - 4760) + chr(100) + '\x65')(chr(0b1110101) + '\x74' + '\x66' + chr(0b101101) + '\070')] = kP4qaKv0ZkGv[xafqLlk3kkUe(SXOLrMavuUCe(b'4\xf52M\xa83\x9e'), chr(9167 - 9067) + '\145' + chr(99) + chr(10590 - 10479) + '\x64' + chr(101))(chr(13674 - 13557) + '\x74' + '\146' + chr(45) + chr(56))][:_93hATE4geR3]
def ZBsVUStGPa6p(OeWW0F1dBPRQ, NLcc3BCJnQka):
OeWW0F1dBPRQ = OeWW0F1dBPRQ[:NLcc3BCJnQka]
smSLNxHiAc55 = IDJ2eXGCBCDu.nauYfLglTpcb(OeWW0F1dBPRQ)[ehT0Px3KOsy9(chr(0b110000) + '\157' + '\060', 8)]
OeWW0F1dBPRQ = IDJ2eXGCBCDu.pad(OeWW0F1dBPRQ, [[ehT0Px3KOsy9(chr(1519 - 1471) + chr(111) + '\060', 8), NLcc3BCJnQka - smSLNxHiAc55]])
return xafqLlk3kkUe(IDJ2eXGCBCDu, xafqLlk3kkUe(SXOLrMavuUCe(b'2\xf13B\xac7\x88'), chr(0b1010100 + 0o20) + chr(101) + '\x63' + chr(0b1101111) + '\144' + '\145')(chr(0b1010000 + 0o45) + chr(116) + '\146' + chr(45) + '\x38'))(OeWW0F1dBPRQ, [NLcc3BCJnQka])
if xafqLlk3kkUe(md1d2YtjKvCG, xafqLlk3kkUe(SXOLrMavuUCe(b'(\xf53u\xa4)\x9d\xd8\x98\x07'), chr(6726 - 6626) + '\145' + chr(978 - 879) + chr(111) + chr(0b1100100) + chr(0b1100101))(chr(0b1001001 + 0o54) + chr(0b1110100) + chr(102) + '\055' + chr(2041 - 1985))):
if b_o_LKDx445U:
sFVmOaqCtE1U = [kP4qaKv0ZkGv[xafqLlk3kkUe(SXOLrMavuUCe(b')\xfa0_\xb94'), chr(0b1100100) + chr(0b100110 + 0o77) + '\x63' + chr(0b1011111 + 0o20) + chr(5856 - 5756) + chr(0b1100101))('\x75' + chr(116) + '\x66' + chr(45) + chr(56))], [md1d2YtjKvCG.task_id]]
kP4qaKv0ZkGv[xafqLlk3kkUe(SXOLrMavuUCe(b')\xfa0_\xb94'), chr(0b111010 + 0o52) + chr(101) + chr(0b1100011) + '\x6f' + chr(0b1100100) + chr(101))(chr(0b1101001 + 0o14) + '\x74' + '\x66' + '\055' + chr(0b111000))] = IDJ2eXGCBCDu.concat(sFVmOaqCtE1U, axis=ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(48), 8))
else:
vXoupepMtCXU = kP4qaKv0ZkGv.pop(xafqLlk3kkUe(SXOLrMavuUCe(b')\xfa0_\xb94'), chr(100) + chr(1733 - 1632) + chr(99) + '\x6f' + '\x64' + '\x65')(chr(0b110111 + 0o76) + chr(116) + chr(0b1100110) + chr(0b101101) + chr(0b111000)))
sFVmOaqCtE1U = [vXoupepMtCXU, [md1d2YtjKvCG.task_id], kP4qaKv0ZkGv[xafqLlk3kkUe(SXOLrMavuUCe(b'4\xf52M\xa83\x9e'), chr(0b1001000 + 0o34) + chr(101) + chr(0b1100010 + 0o1) + chr(0b1101111) + chr(6267 - 6167) + chr(0b1100101))(chr(0b1010 + 0o153) + chr(5859 - 5743) + chr(3774 - 3672) + chr(509 - 464) + '\070')]]
kP4qaKv0ZkGv[xafqLlk3kkUe(SXOLrMavuUCe(b'4\xf52M\xa83\x9e'), chr(100) + chr(0b1100101) + '\x63' + chr(0b1101111) + chr(100) + chr(101))('\165' + chr(116) + '\146' + chr(411 - 366) + chr(3128 - 3072))] = IDJ2eXGCBCDu.concat(sFVmOaqCtE1U, axis=ehT0Px3KOsy9(chr(2183 - 2135) + chr(0b1011000 + 0o27) + chr(0b110000), 8))
if IYqY9K8m5qcC > ehT0Px3KOsy9('\060' + '\x6f' + chr(48), 8):
kP4qaKv0ZkGv[xafqLlk3kkUe(SXOLrMavuUCe(b'4\xf52M\xa83\x9e'), '\144' + chr(0b1000010 + 0o43) + chr(0b1000000 + 0o43) + '\157' + chr(298 - 198) + chr(8949 - 8848))('\x75' + chr(116) + chr(4653 - 4551) + chr(0b101101) + chr(0b111000))] = ZBsVUStGPa6p(kP4qaKv0ZkGv[xafqLlk3kkUe(SXOLrMavuUCe(b'4\xf52M\xa83\x9e'), chr(5902 - 5802) + chr(4205 - 4104) + chr(99) + '\x6f' + chr(100) + chr(101))(chr(707 - 590) + '\x74' + chr(0b1100110) + chr(461 - 416) + '\x38')], IYqY9K8m5qcC)
else:
sFVmOaqCtE1U = [[md1d2YtjKvCG.task_id], kP4qaKv0ZkGv[xafqLlk3kkUe(SXOLrMavuUCe(b'4\xf52M\xa83\x9e'), '\x64' + '\x65' + chr(6317 - 6218) + '\157' + chr(0b1011101 + 0o7) + chr(101))('\165' + '\x74' + chr(0b1100110) + chr(45) + '\070')]]
kP4qaKv0ZkGv[xafqLlk3kkUe(SXOLrMavuUCe(b'4\xf52M\xa83\x9e'), chr(9960 - 9860) + '\145' + chr(99) + chr(10533 - 10422) + chr(0b1100000 + 0o4) + chr(0b1100101))('\x75' + '\x74' + chr(0b1100110) + '\055' + chr(0b100011 + 0o25))] = IDJ2eXGCBCDu.concat(sFVmOaqCtE1U, axis=ehT0Px3KOsy9(chr(0b10000 + 0o40) + chr(0b1101111) + '\x30', 8))
if not b_o_LKDx445U and IYqY9K8m5qcC > ehT0Px3KOsy9(chr(1532 - 1484) + '\x6f' + chr(0b110000), 8):
kP4qaKv0ZkGv[xafqLlk3kkUe(SXOLrMavuUCe(b'4\xf52M\xa83\x9e'), chr(0b1100100) + '\145' + '\143' + chr(0b1101111) + chr(0b1100100) + chr(0b1100101))(chr(117) + chr(9923 - 9807) + chr(0b1100110) + chr(0b101101) + chr(199 - 143))] = ZBsVUStGPa6p(kP4qaKv0ZkGv[xafqLlk3kkUe(SXOLrMavuUCe(b'4\xf52M\xa83\x9e'), chr(0b1100100) + chr(9795 - 9694) + '\x63' + chr(0b101010 + 0o105) + '\x64' + chr(0b1100101))('\x75' + chr(116) + chr(0b1100110) + chr(1133 - 1088) + chr(0b1100 + 0o54))], IYqY9K8m5qcC)
kP4qaKv0ZkGv[xafqLlk3kkUe(SXOLrMavuUCe(b'4\xf53A\x92.\x89'), chr(0b1100100) + chr(0b111001 + 0o54) + chr(0b1100011) + chr(0b1000000 + 0o57) + chr(100) + chr(101))('\165' + chr(0b1001011 + 0o51) + chr(0b1001100 + 0o32) + chr(0b101101) + '\070')] = IDJ2eXGCBCDu.constant([md1d2YtjKvCG.task_id], dtype=IDJ2eXGCBCDu.int64)
return kP4qaKv0ZkGv
|
tensorflow/tensor2tensor
|
tensor2tensor/data_generators/multi_problem.py
|
flatten_zip_dataset
|
def flatten_zip_dataset(*args):
"""A list of examples to a dataset containing mixed examples.
Given a list of `n` dataset examples, flatten them by converting
each element into a dataset and concatenating them to convert into a
single dataset.
Args:
*args: A list containing one example each from `n` different datasets.
Returns:
flattened: A new dataset containing the examples from the list as part
of a single dataset.
"""
flattened = tf.data.Dataset.from_tensors(args[0])
for ex in args[1:]:
flattened = flattened.concatenate(tf.data.Dataset.from_tensors(ex))
return flattened
|
python
|
def flatten_zip_dataset(*args):
"""A list of examples to a dataset containing mixed examples.
Given a list of `n` dataset examples, flatten them by converting
each element into a dataset and concatenating them to convert into a
single dataset.
Args:
*args: A list containing one example each from `n` different datasets.
Returns:
flattened: A new dataset containing the examples from the list as part
of a single dataset.
"""
flattened = tf.data.Dataset.from_tensors(args[0])
for ex in args[1:]:
flattened = flattened.concatenate(tf.data.Dataset.from_tensors(ex))
return flattened
|
[
"def",
"flatten_zip_dataset",
"(",
"*",
"args",
")",
":",
"flattened",
"=",
"tf",
".",
"data",
".",
"Dataset",
".",
"from_tensors",
"(",
"args",
"[",
"0",
"]",
")",
"for",
"ex",
"in",
"args",
"[",
"1",
":",
"]",
":",
"flattened",
"=",
"flattened",
".",
"concatenate",
"(",
"tf",
".",
"data",
".",
"Dataset",
".",
"from_tensors",
"(",
"ex",
")",
")",
"return",
"flattened"
] |
A list of examples to a dataset containing mixed examples.
Given a list of `n` dataset examples, flatten them by converting
each element into a dataset and concatenating them to convert into a
single dataset.
Args:
*args: A list containing one example each from `n` different datasets.
Returns:
flattened: A new dataset containing the examples from the list as part
of a single dataset.
|
[
"A",
"list",
"of",
"examples",
"to",
"a",
"dataset",
"containing",
"mixed",
"examples",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/data_generators/multi_problem.py#L111-L128
|
train
|
A list of examples to a dataset containing mixed examples.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEa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mY,reqGiMiVQ77y,bsS9P6_LpdIe,sbGAZlkZOtyh,Cf_Qef15s3_F,eX02hlZjMfR0,wLqBDw8l0eIm,g1Uy6IV0tyJQ,f9CsFWzvg0Vq,YlkZvXL8qwsX,MCqssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x31' + chr(0b101110 + 0o5) + '\064', ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(51) + chr(0b110110) + '\x35', 47874 - 47866), ehT0Px3KOsy9(chr(48) + '\157' + chr(49) + chr(0b10101 + 0o36) + '\062', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(71 - 21) + chr(55) + chr(49), 0b1000), ehT0Px3KOsy9('\060' + chr(0b100011 + 0o114) + '\x30', 0o10), ehT0Px3KOsy9(chr(1814 - 1766) + chr(6545 - 6434) + chr(50) + '\062' + chr(0b100010 + 0o21), 65352 - 65344), ehT0Px3KOsy9(chr(0b111 + 0o51) + chr(0b1010111 + 0o30) + '\x32' + '\x33' + chr(53), 25214 - 25206), ehT0Px3KOsy9('\060' + chr(111) + chr(52), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(12236 - 12125) + '\x31' + '\065' + '\061', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1001110 + 0o41) + chr(0b1101 + 0o44), 0b1000), ehT0Px3KOsy9(chr(0b111 + 0o51) + chr(111) + chr(50) + '\x30' + chr(51), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110011) + chr(0b110000) + '\060', ord("\x08")), ehT0Px3KOsy9(chr(0b101001 + 0o7) + '\x6f' + '\x31' + chr(48) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(11656 - 11545) + chr(55) + chr(1694 - 1643), 64534 - 64526), ehT0Px3KOsy9('\x30' + '\x6f' + '\063' + chr(0b11111 + 0o25) + chr(0b110000), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(49) + '\067' + chr(76 - 24), 0o10), ehT0Px3KOsy9(chr(257 - 209) + '\157' + '\061' + '\061' + '\061', 60295 - 60287), ehT0Px3KOsy9('\060' + chr(0b1011001 + 0o26) + chr(49) + chr(54), 0o10), ehT0Px3KOsy9('\x30' + chr(6485 - 6374) + '\063' + chr(51) + chr(0b110011), ord("\x08")), ehT0Px3KOsy9(chr(0b100011 + 0o15) + '\157' + chr(51) + chr(49), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(1864 - 1815) + chr(1264 - 1210) + '\x36', 0o10), ehT0Px3KOsy9(chr(2177 - 2129) + chr(8930 - 8819) + chr(2408 - 2358) + '\060', 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\062' + chr(2004 - 1953) + chr(0b110110), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\061' + chr(0b110010) + chr(1977 - 1923), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(4189 - 4078) + chr(51) + chr(54) + chr(52), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(2099 - 2048) + chr(0b110011) + '\x34', 0b1000), ehT0Px3KOsy9('\060' + chr(111) + '\x31' + chr(2220 - 2165) + chr(53), 0b1000), ehT0Px3KOsy9(chr(0b1010 + 0o46) + chr(0b1001001 + 0o46) + chr(1309 - 1260) + '\065' + chr(52), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + '\063' + chr(2385 - 2335) + chr(358 - 307), 0b1000), ehT0Px3KOsy9('\060' + chr(7188 - 7077) + '\062' + chr(0b110101), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + '\061' + chr(49) + '\x37', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1010010 + 0o35) + '\060', 8), ehT0Px3KOsy9(chr(0b110000) + chr(2110 - 1999) + chr(0b110001) + chr(0b110000) + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(0b11111 + 0o21) + chr(0b1101111) + chr(0b110001) + chr(0b110010) + chr(52), 0o10), ehT0Px3KOsy9(chr(0b100010 + 0o16) + '\x6f' + '\x32' + '\067' + chr(49), 8), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b11101 + 0o26) + '\064', 35837 - 35829), ehT0Px3KOsy9(chr(0b10110 + 0o32) + chr(111) + chr(1914 - 1865) + '\x31' + '\x37', 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b1001100 + 0o43) + chr(77 - 26) + chr(2408 - 2358) + chr(1490 - 1441), 0o10), ehT0Px3KOsy9(chr(48) + chr(1817 - 1706) + '\063' + chr(52) + chr(54), 0o10), ehT0Px3KOsy9(chr(48) + chr(8922 - 8811) + '\061' + chr(0b11001 + 0o27) + '\065', 32232 - 32224)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b10 + 0o56) + chr(0b10100 + 0o133) + chr(53) + chr(0b1111 + 0o41), ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'r'), chr(0b1100100) + chr(0b1100101) + chr(0b10100 + 0o117) + chr(0b1101111) + '\x64' + chr(6884 - 6783))(chr(117) + '\x74' + chr(0b1011010 + 0o14) + chr(0b10 + 0o53) + chr(56)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def MkM2Qv1k1d4x(*kJDRfRhcZHjS):
p5MEUvPjpug9 = IDJ2eXGCBCDu.data.Dataset.from_tensors(kJDRfRhcZHjS[ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110000), 8)])
for DfdhY28yEwAF in kJDRfRhcZHjS[ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x31', 8):]:
p5MEUvPjpug9 = p5MEUvPjpug9.concatenate(IDJ2eXGCBCDu.data.Dataset.from_tensors(DfdhY28yEwAF))
return p5MEUvPjpug9
|
tensorflow/tensor2tensor
|
tensor2tensor/data_generators/multi_problem.py
|
aggregate_task_losses
|
def aggregate_task_losses(hparams,
problem_hparams,
logits,
feature_name,
feature):
"""Multiproblem loss function."""
# If no reweighting, we want the default loss to mimic the LM loss.
if not hparams.multiproblem_reweight_label_loss:
return aggregate_task_lm_losses(hparams=hparams,
problem_hparams=problem_hparams,
logits=logits,
feature_name=feature_name,
feature=feature)
summaries = []
main_task_id = hparams.problem.task_list[0].task_id
vocab_size = problem_hparams.vocab_size[feature_name]
if vocab_size is not None and hasattr(hparams, "vocab_divisor"):
vocab_size += (-vocab_size) % hparams.vocab_divisor
modality = problem_hparams.modality[feature_name]
loss = hparams.loss.get(feature_name, modalities.get_loss(modality))
weights_fn = hparams.weights_fn.get(
feature_name, modalities.get_weights_fn(modality))
# Primary task loss
loss_num, loss_den = loss(
logits, feature,
lambda x: common_layers.weights_multi_problem_all(x, main_task_id),
hparams, vocab_size, weights_fn)
loss_val = loss_num / tf.maximum(1.0, loss_den)
summaries.append([hparams.problem.task_list[0].name+"_loss", loss_val])
# Since the losses may undergo rescaling, they cannot exist as separate
# numerators and denominators. Set the denominators to 1 in order to faciliate
# loss averaging.
loss_num = loss_val
loss_den = tf.minimum(tf.convert_to_tensor(1, dtype=tf.float32), loss_den)
for task in hparams.problem.task_list[1:]:
# Loss only from the input sequence -- the auxiliary LM loss.
seq_loss_num, seq_loss_den = loss(
logits, feature,
lambda x: common_layers.weights_multi_problem_input(x, task.task_id), # pylint: disable=cell-var-from-loop
hparams, vocab_size)
seq_loss_num *= problem_hparams.loss_multiplier
# Unscaled sequence loss.
seq_loss = seq_loss_num / tf.maximum(1.0, seq_loss_den)
summaries.append([task.name+"_seq_loss", seq_loss])
if hasattr(task, "num_classes"):
# Loss only from the classification label.
label_loss_num, label_loss_den = loss(
logits, feature,
lambda x: common_layers.weights_multi_problem(x, task.task_id), # pylint: disable=cell-var-from-loop
hparams, vocab_size)
label_loss_num *= problem_hparams.loss_multiplier
# Unscaled classification label loss.
label_loss = label_loss_num / tf.maximum(1.0, label_loss_den)
summaries.append([task.name+"_label_loss", label_loss])
# Scaling.
if hparams.multiproblem_reweight_label_loss:
label_loss *= hparams.multiproblem_label_weight
seq_loss *= (1 - hparams.multiproblem_label_weight)
# This is the training loss for the optimizer after scaling.
task_loss_val = seq_loss + label_loss
loss_den_ = label_loss_den
else:
# Loss only from the target sequence.
target_loss_num, target_loss_den = loss(
logits, feature,
lambda x: common_layers.weights_multi_problem(x, task.task_id), # pylint: disable=cell-var-from-loop
hparams, vocab_size)
target_loss_num *= problem_hparams.loss_multiplier
# Unscaled target sequence loss.
target_loss = target_loss_num / tf.maximum(1.0, target_loss_den)
summaries.append([task.name+"_target_loss", target_loss])
# Scaling.
if hparams.multiproblem_reweight_label_loss:
target_loss *= hparams.multiproblem_label_weight
seq_loss *= (1 - hparams.multiproblem_label_weight)
# This is the training loss for the optimizer after all the scaling.
task_loss_val = seq_loss + target_loss
loss_den_ = target_loss_den
summaries.append([task.name+"_loss", task_loss_val])
# Adding 1 to the loss den for each task leads to averaging task losses.
# TODO(urvashik): Fix combination with other task losses - weighted
# average based on the number of examples from that task.
loss_num += task_loss_val
loss_den += tf.minimum(tf.convert_to_tensor(1, dtype=tf.float32),
loss_den_)
return loss_num, loss_den, summaries
|
python
|
def aggregate_task_losses(hparams,
problem_hparams,
logits,
feature_name,
feature):
"""Multiproblem loss function."""
# If no reweighting, we want the default loss to mimic the LM loss.
if not hparams.multiproblem_reweight_label_loss:
return aggregate_task_lm_losses(hparams=hparams,
problem_hparams=problem_hparams,
logits=logits,
feature_name=feature_name,
feature=feature)
summaries = []
main_task_id = hparams.problem.task_list[0].task_id
vocab_size = problem_hparams.vocab_size[feature_name]
if vocab_size is not None and hasattr(hparams, "vocab_divisor"):
vocab_size += (-vocab_size) % hparams.vocab_divisor
modality = problem_hparams.modality[feature_name]
loss = hparams.loss.get(feature_name, modalities.get_loss(modality))
weights_fn = hparams.weights_fn.get(
feature_name, modalities.get_weights_fn(modality))
# Primary task loss
loss_num, loss_den = loss(
logits, feature,
lambda x: common_layers.weights_multi_problem_all(x, main_task_id),
hparams, vocab_size, weights_fn)
loss_val = loss_num / tf.maximum(1.0, loss_den)
summaries.append([hparams.problem.task_list[0].name+"_loss", loss_val])
# Since the losses may undergo rescaling, they cannot exist as separate
# numerators and denominators. Set the denominators to 1 in order to faciliate
# loss averaging.
loss_num = loss_val
loss_den = tf.minimum(tf.convert_to_tensor(1, dtype=tf.float32), loss_den)
for task in hparams.problem.task_list[1:]:
# Loss only from the input sequence -- the auxiliary LM loss.
seq_loss_num, seq_loss_den = loss(
logits, feature,
lambda x: common_layers.weights_multi_problem_input(x, task.task_id), # pylint: disable=cell-var-from-loop
hparams, vocab_size)
seq_loss_num *= problem_hparams.loss_multiplier
# Unscaled sequence loss.
seq_loss = seq_loss_num / tf.maximum(1.0, seq_loss_den)
summaries.append([task.name+"_seq_loss", seq_loss])
if hasattr(task, "num_classes"):
# Loss only from the classification label.
label_loss_num, label_loss_den = loss(
logits, feature,
lambda x: common_layers.weights_multi_problem(x, task.task_id), # pylint: disable=cell-var-from-loop
hparams, vocab_size)
label_loss_num *= problem_hparams.loss_multiplier
# Unscaled classification label loss.
label_loss = label_loss_num / tf.maximum(1.0, label_loss_den)
summaries.append([task.name+"_label_loss", label_loss])
# Scaling.
if hparams.multiproblem_reweight_label_loss:
label_loss *= hparams.multiproblem_label_weight
seq_loss *= (1 - hparams.multiproblem_label_weight)
# This is the training loss for the optimizer after scaling.
task_loss_val = seq_loss + label_loss
loss_den_ = label_loss_den
else:
# Loss only from the target sequence.
target_loss_num, target_loss_den = loss(
logits, feature,
lambda x: common_layers.weights_multi_problem(x, task.task_id), # pylint: disable=cell-var-from-loop
hparams, vocab_size)
target_loss_num *= problem_hparams.loss_multiplier
# Unscaled target sequence loss.
target_loss = target_loss_num / tf.maximum(1.0, target_loss_den)
summaries.append([task.name+"_target_loss", target_loss])
# Scaling.
if hparams.multiproblem_reweight_label_loss:
target_loss *= hparams.multiproblem_label_weight
seq_loss *= (1 - hparams.multiproblem_label_weight)
# This is the training loss for the optimizer after all the scaling.
task_loss_val = seq_loss + target_loss
loss_den_ = target_loss_den
summaries.append([task.name+"_loss", task_loss_val])
# Adding 1 to the loss den for each task leads to averaging task losses.
# TODO(urvashik): Fix combination with other task losses - weighted
# average based on the number of examples from that task.
loss_num += task_loss_val
loss_den += tf.minimum(tf.convert_to_tensor(1, dtype=tf.float32),
loss_den_)
return loss_num, loss_den, summaries
|
[
"def",
"aggregate_task_losses",
"(",
"hparams",
",",
"problem_hparams",
",",
"logits",
",",
"feature_name",
",",
"feature",
")",
":",
"# If no reweighting, we want the default loss to mimic the LM loss.",
"if",
"not",
"hparams",
".",
"multiproblem_reweight_label_loss",
":",
"return",
"aggregate_task_lm_losses",
"(",
"hparams",
"=",
"hparams",
",",
"problem_hparams",
"=",
"problem_hparams",
",",
"logits",
"=",
"logits",
",",
"feature_name",
"=",
"feature_name",
",",
"feature",
"=",
"feature",
")",
"summaries",
"=",
"[",
"]",
"main_task_id",
"=",
"hparams",
".",
"problem",
".",
"task_list",
"[",
"0",
"]",
".",
"task_id",
"vocab_size",
"=",
"problem_hparams",
".",
"vocab_size",
"[",
"feature_name",
"]",
"if",
"vocab_size",
"is",
"not",
"None",
"and",
"hasattr",
"(",
"hparams",
",",
"\"vocab_divisor\"",
")",
":",
"vocab_size",
"+=",
"(",
"-",
"vocab_size",
")",
"%",
"hparams",
".",
"vocab_divisor",
"modality",
"=",
"problem_hparams",
".",
"modality",
"[",
"feature_name",
"]",
"loss",
"=",
"hparams",
".",
"loss",
".",
"get",
"(",
"feature_name",
",",
"modalities",
".",
"get_loss",
"(",
"modality",
")",
")",
"weights_fn",
"=",
"hparams",
".",
"weights_fn",
".",
"get",
"(",
"feature_name",
",",
"modalities",
".",
"get_weights_fn",
"(",
"modality",
")",
")",
"# Primary task loss",
"loss_num",
",",
"loss_den",
"=",
"loss",
"(",
"logits",
",",
"feature",
",",
"lambda",
"x",
":",
"common_layers",
".",
"weights_multi_problem_all",
"(",
"x",
",",
"main_task_id",
")",
",",
"hparams",
",",
"vocab_size",
",",
"weights_fn",
")",
"loss_val",
"=",
"loss_num",
"/",
"tf",
".",
"maximum",
"(",
"1.0",
",",
"loss_den",
")",
"summaries",
".",
"append",
"(",
"[",
"hparams",
".",
"problem",
".",
"task_list",
"[",
"0",
"]",
".",
"name",
"+",
"\"_loss\"",
",",
"loss_val",
"]",
")",
"# Since the losses may undergo rescaling, they cannot exist as separate",
"# numerators and denominators. Set the denominators to 1 in order to faciliate",
"# loss averaging.",
"loss_num",
"=",
"loss_val",
"loss_den",
"=",
"tf",
".",
"minimum",
"(",
"tf",
".",
"convert_to_tensor",
"(",
"1",
",",
"dtype",
"=",
"tf",
".",
"float32",
")",
",",
"loss_den",
")",
"for",
"task",
"in",
"hparams",
".",
"problem",
".",
"task_list",
"[",
"1",
":",
"]",
":",
"# Loss only from the input sequence -- the auxiliary LM loss.",
"seq_loss_num",
",",
"seq_loss_den",
"=",
"loss",
"(",
"logits",
",",
"feature",
",",
"lambda",
"x",
":",
"common_layers",
".",
"weights_multi_problem_input",
"(",
"x",
",",
"task",
".",
"task_id",
")",
",",
"# pylint: disable=cell-var-from-loop",
"hparams",
",",
"vocab_size",
")",
"seq_loss_num",
"*=",
"problem_hparams",
".",
"loss_multiplier",
"# Unscaled sequence loss.",
"seq_loss",
"=",
"seq_loss_num",
"/",
"tf",
".",
"maximum",
"(",
"1.0",
",",
"seq_loss_den",
")",
"summaries",
".",
"append",
"(",
"[",
"task",
".",
"name",
"+",
"\"_seq_loss\"",
",",
"seq_loss",
"]",
")",
"if",
"hasattr",
"(",
"task",
",",
"\"num_classes\"",
")",
":",
"# Loss only from the classification label.",
"label_loss_num",
",",
"label_loss_den",
"=",
"loss",
"(",
"logits",
",",
"feature",
",",
"lambda",
"x",
":",
"common_layers",
".",
"weights_multi_problem",
"(",
"x",
",",
"task",
".",
"task_id",
")",
",",
"# pylint: disable=cell-var-from-loop",
"hparams",
",",
"vocab_size",
")",
"label_loss_num",
"*=",
"problem_hparams",
".",
"loss_multiplier",
"# Unscaled classification label loss.",
"label_loss",
"=",
"label_loss_num",
"/",
"tf",
".",
"maximum",
"(",
"1.0",
",",
"label_loss_den",
")",
"summaries",
".",
"append",
"(",
"[",
"task",
".",
"name",
"+",
"\"_label_loss\"",
",",
"label_loss",
"]",
")",
"# Scaling.",
"if",
"hparams",
".",
"multiproblem_reweight_label_loss",
":",
"label_loss",
"*=",
"hparams",
".",
"multiproblem_label_weight",
"seq_loss",
"*=",
"(",
"1",
"-",
"hparams",
".",
"multiproblem_label_weight",
")",
"# This is the training loss for the optimizer after scaling.",
"task_loss_val",
"=",
"seq_loss",
"+",
"label_loss",
"loss_den_",
"=",
"label_loss_den",
"else",
":",
"# Loss only from the target sequence.",
"target_loss_num",
",",
"target_loss_den",
"=",
"loss",
"(",
"logits",
",",
"feature",
",",
"lambda",
"x",
":",
"common_layers",
".",
"weights_multi_problem",
"(",
"x",
",",
"task",
".",
"task_id",
")",
",",
"# pylint: disable=cell-var-from-loop",
"hparams",
",",
"vocab_size",
")",
"target_loss_num",
"*=",
"problem_hparams",
".",
"loss_multiplier",
"# Unscaled target sequence loss.",
"target_loss",
"=",
"target_loss_num",
"/",
"tf",
".",
"maximum",
"(",
"1.0",
",",
"target_loss_den",
")",
"summaries",
".",
"append",
"(",
"[",
"task",
".",
"name",
"+",
"\"_target_loss\"",
",",
"target_loss",
"]",
")",
"# Scaling.",
"if",
"hparams",
".",
"multiproblem_reweight_label_loss",
":",
"target_loss",
"*=",
"hparams",
".",
"multiproblem_label_weight",
"seq_loss",
"*=",
"(",
"1",
"-",
"hparams",
".",
"multiproblem_label_weight",
")",
"# This is the training loss for the optimizer after all the scaling.",
"task_loss_val",
"=",
"seq_loss",
"+",
"target_loss",
"loss_den_",
"=",
"target_loss_den",
"summaries",
".",
"append",
"(",
"[",
"task",
".",
"name",
"+",
"\"_loss\"",
",",
"task_loss_val",
"]",
")",
"# Adding 1 to the loss den for each task leads to averaging task losses.",
"# TODO(urvashik): Fix combination with other task losses - weighted",
"# average based on the number of examples from that task.",
"loss_num",
"+=",
"task_loss_val",
"loss_den",
"+=",
"tf",
".",
"minimum",
"(",
"tf",
".",
"convert_to_tensor",
"(",
"1",
",",
"dtype",
"=",
"tf",
".",
"float32",
")",
",",
"loss_den_",
")",
"return",
"loss_num",
",",
"loss_den",
",",
"summaries"
] |
Multiproblem loss function.
|
[
"Multiproblem",
"loss",
"function",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/data_generators/multi_problem.py#L419-L522
|
train
|
Aggregate task losses.
|
Pu7Z6IJCgH3a,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6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\x30' + chr(9008 - 8897) + chr(0b110001) + chr(0b1100 + 0o52) + '\065', ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + chr(0b101110 + 0o7) + '\061', 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + '\x32' + chr(0b110111) + chr(0b110111), 16304 - 16296), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x33' + chr(0b110010) + chr(0b11000 + 0o37), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(51) + chr(714 - 666) + '\063', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1010011 + 0o34) + '\061' + chr(48) + chr(0b10001 + 0o37), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b1000 + 0o53) + '\x35' + chr(1406 - 1355), 59237 - 59229), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x33' + chr(53) + chr(0b101100 + 0o10), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(50) + chr(51) + '\063', 26382 - 26374), ehT0Px3KOsy9('\060' + chr(0b110010 + 0o75) + '\063' + chr(0b110010) + chr(0b101000 + 0o14), 29080 - 29072), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b11100 + 0o25) + chr(0b101110 + 0o2) + '\063', 3310 - 3302), ehT0Px3KOsy9(chr(0b110000) + chr(0b1100000 + 0o17) + chr(51) + chr(1006 - 952) + '\064', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x32' + chr(55) + '\064', ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + '\x32' + chr(0b0 + 0o64) + chr(0b110100), 0b1000), ehT0Px3KOsy9(chr(670 - 622) + '\x6f' + chr(51) + '\x35' + '\x30', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(5952 - 5841) + chr(0b110010 + 0o4) + chr(0b110111), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + '\x35' + chr(51), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101110 + 0o1) + chr(449 - 400) + chr(0b101 + 0o53) + chr(0b100100 + 0o22), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\062' + '\064' + chr(0b110011), 54002 - 53994), ehT0Px3KOsy9(chr(48) + chr(111) + chr(49) + chr(55) + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x32' + chr(48) + '\063', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(51) + chr(0b110101) + '\065', ord("\x08")), ehT0Px3KOsy9(chr(1850 - 1802) + chr(0b1101111) + chr(2174 - 2124) + chr(49), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b10110 + 0o35) + chr(0b110101) + chr(0b1111 + 0o47), 0o10), ehT0Px3KOsy9(chr(726 - 678) + chr(0b1101111) + chr(129 - 79) + chr(53) + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1010110 + 0o31) + chr(0b110000), ord("\x08")), ehT0Px3KOsy9(chr(733 - 685) + chr(11506 - 11395) + chr(0b101100 + 0o6) + '\066' + '\065', 0o10), ehT0Px3KOsy9(chr(0b11000 + 0o30) + chr(8072 - 7961) + chr(0b100111 + 0o12) + chr(0b110100) + chr(0b110101), 38382 - 38374), ehT0Px3KOsy9(chr(897 - 849) + chr(0b1101111) + chr(0b1001 + 0o52) + chr(1193 - 1141) + chr(925 - 873), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b1101 + 0o51) + chr(0b110100), 45993 - 45985), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\061' + chr(52) + chr(55), ord("\x08")), ehT0Px3KOsy9(chr(2102 - 2054) + chr(7122 - 7011) + '\062' + '\x36' + '\060', ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + '\062' + chr(0b110001) + '\x33', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(1493 - 1444) + '\x36' + chr(1440 - 1389), 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(191 - 141) + '\x31' + '\060', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1100001 + 0o16) + chr(0b110 + 0o56) + '\x35', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b101101 + 0o102) + chr(572 - 523) + '\066' + chr(1931 - 1877), 0o10), ehT0Px3KOsy9(chr(0b11010 + 0o26) + chr(0b1010000 + 0o37) + '\064' + chr(0b110101), 8), ehT0Px3KOsy9(chr(2076 - 2028) + '\157' + chr(51) + chr(0b110010) + chr(0b100111 + 0o13), 0o10), ehT0Px3KOsy9(chr(1594 - 1546) + chr(0b1101111) + '\x35' + chr(1582 - 1530), ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + chr(0b11000 + 0o127) + chr(784 - 731) + chr(0b101110 + 0o2), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'['), '\144' + chr(7776 - 7675) + '\143' + chr(2636 - 2525) + chr(0b1100100) + chr(5287 - 5186))(chr(0b1110101) + chr(116) + chr(0b1100110) + chr(0b100 + 0o51) + '\x38') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def gwNFN5ZwlzdS(n4ljua2gi1Pr, sXqesioLf7Ji, wF9nmvjsKjYM, lPuZQT6rFAxL, fVxZREPfp9Oo):
if not xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'\x16N\xd3\x9b\x8c6\x91\xd4\xa2\x81*\x98'), chr(5255 - 5155) + chr(8764 - 8663) + '\x63' + chr(111) + '\x64' + chr(0b111100 + 0o51))(chr(0b110100 + 0o101) + chr(116) + '\146' + chr(0b101101) + '\x38')):
return WOR_I_hS8EK9(hparams=n4ljua2gi1Pr, problem_hparams=sXqesioLf7Ji, logits=wF9nmvjsKjYM, feature_name=lPuZQT6rFAxL, feature=fVxZREPfp9Oo)
Ss61w8pBYeZH = []
pPtZJGLKFeqg = n4ljua2gi1Pr.problem.task_list[ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(331 - 283), 8)].task_id
CeyMIoSyrpkQ = sXqesioLf7Ji.CeyMIoSyrpkQ[lPuZQT6rFAxL]
if CeyMIoSyrpkQ is not None and lot1PSoAwYhj(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'\x03F\xdc\xb6\xa1\x1f\x8f\x85\xed\xbd0\x9b\xce'), '\x64' + chr(0b1000000 + 0o45) + chr(0b10100 + 0o117) + chr(0b101 + 0o152) + '\x64' + chr(7597 - 7496))(chr(117) + chr(0b1110100) + '\146' + '\x2d' + chr(0b111000 + 0o0))):
CeyMIoSyrpkQ += -CeyMIoSyrpkQ % n4ljua2gi1Pr.uDahGBSW4HJn
bYPswhysd3s2 = sXqesioLf7Ji.bYPswhysd3s2[lPuZQT6rFAxL]
YpO0BcZ6fMsf = n4ljua2gi1Pr.loss.get(lPuZQT6rFAxL, PuPeNl0CuqOQ.get_loss(bYPswhysd3s2))
Pdbc6Q2jZ4RQ = n4ljua2gi1Pr.weights_fn.get(lPuZQT6rFAxL, PuPeNl0CuqOQ.get_weights_fn(bYPswhysd3s2))
(ezRZFHpxj7YX, bNn6FMpPN5Af) = YpO0BcZ6fMsf(wF9nmvjsKjYM, fVxZREPfp9Oo, lambda OeWW0F1dBPRQ: jSKPaHwSAfVv.weights_multi_problem_all(OeWW0F1dBPRQ, pPtZJGLKFeqg), n4ljua2gi1Pr, CeyMIoSyrpkQ, Pdbc6Q2jZ4RQ)
TosWBOlGf8bW = ezRZFHpxj7YX / IDJ2eXGCBCDu.maximum(1.0, bNn6FMpPN5Af)
xafqLlk3kkUe(Ss61w8pBYeZH, xafqLlk3kkUe(SXOLrMavuUCe(b'\x14Y\xcf\xb2\xad$'), chr(100) + chr(3444 - 3343) + chr(99) + chr(0b1101111) + chr(100) + chr(7142 - 7041))(chr(117) + chr(6892 - 6776) + '\x66' + '\055' + '\070'))([xafqLlk3kkUe(n4ljua2gi1Pr.problem.task_list[ehT0Px3KOsy9(chr(0b100011 + 0o15) + '\157' + chr(354 - 306), 8)], xafqLlk3kkUe(SXOLrMavuUCe(b'4`\xc9\x9d\x91:\xa7\x88\xdf\xb2$\xb2'), '\x64' + chr(2188 - 2087) + chr(0b111001 + 0o52) + chr(111) + chr(100) + chr(101))(chr(3022 - 2905) + chr(116) + '\146' + chr(496 - 451) + '\070')) + xafqLlk3kkUe(SXOLrMavuUCe(b'*E\xd0\xa4\xb0'), chr(100) + chr(101) + chr(99) + '\x6f' + chr(2470 - 2370) + chr(0b1100101))(chr(117) + '\164' + '\x66' + '\055' + chr(56)), TosWBOlGf8bW])
ezRZFHpxj7YX = TosWBOlGf8bW
bNn6FMpPN5Af = IDJ2eXGCBCDu.minimum(IDJ2eXGCBCDu.convert_to_tensor(ehT0Px3KOsy9(chr(1695 - 1647) + chr(111) + chr(2056 - 2007), 0o10), dtype=IDJ2eXGCBCDu.float32), bNn6FMpPN5Af)
for md1d2YtjKvCG in xafqLlk3kkUe(n4ljua2gi1Pr.problem, xafqLlk3kkUe(SXOLrMavuUCe(b'\x01H\xcc\xbc\x9c,\x82\x9f\xef'), '\x64' + '\145' + chr(6041 - 5942) + '\x6f' + chr(0b1100100) + chr(1493 - 1392))(chr(117) + '\164' + chr(7358 - 7256) + '\055' + chr(91 - 35)))[ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x31', 8):]:
(Sx9dMfwD0KdH, cIUk04ePjoj1) = YpO0BcZ6fMsf(wF9nmvjsKjYM, fVxZREPfp9Oo, lambda OeWW0F1dBPRQ: jSKPaHwSAfVv.weights_multi_problem_input(OeWW0F1dBPRQ, md1d2YtjKvCG.task_id), n4ljua2gi1Pr, CeyMIoSyrpkQ)
Sx9dMfwD0KdH *= sXqesioLf7Ji.loss_multiplier
g3YatrkHtpcT = Sx9dMfwD0KdH / IDJ2eXGCBCDu.maximum(1.0, cIUk04ePjoj1)
xafqLlk3kkUe(Ss61w8pBYeZH, xafqLlk3kkUe(SXOLrMavuUCe(b'\x14Y\xcf\xb2\xad$'), '\144' + chr(7039 - 6938) + chr(3430 - 3331) + '\157' + chr(3473 - 3373) + '\x65')(chr(0b1011010 + 0o33) + '\164' + chr(0b1000111 + 0o37) + chr(0b101101) + chr(56)))([xafqLlk3kkUe(md1d2YtjKvCG, xafqLlk3kkUe(SXOLrMavuUCe(b'4`\xc9\x9d\x91:\xa7\x88\xdf\xb2$\xb2'), chr(5377 - 5277) + '\x65' + chr(0b1001100 + 0o27) + chr(0b1011000 + 0o27) + chr(2433 - 2333) + chr(8158 - 8057))(chr(0b1110001 + 0o4) + chr(0b1110100) + '\x66' + chr(0b1010 + 0o43) + '\070')) + xafqLlk3kkUe(SXOLrMavuUCe(b'*Z\xda\xa6\x9c,\x84\x9f\xe8'), '\144' + chr(0b111101 + 0o50) + chr(0b1100011) + '\157' + '\144' + chr(0b1100101))(chr(117) + chr(4161 - 4045) + chr(102) + chr(45) + chr(0b111000)), g3YatrkHtpcT])
if lot1PSoAwYhj(md1d2YtjKvCG, xafqLlk3kkUe(SXOLrMavuUCe(b'\x1b\\\xd2\x88\xa0,\x8a\x9f\xe8\xb10'), chr(100) + chr(0b1001110 + 0o27) + chr(8901 - 8802) + chr(0b1101111) + chr(100) + '\x65')(chr(0b1110101) + '\164' + chr(0b1000010 + 0o44) + chr(977 - 932) + chr(56))):
(lPUw60vENZT6, YLJ4_6_HVWYo) = YpO0BcZ6fMsf(wF9nmvjsKjYM, fVxZREPfp9Oo, lambda OeWW0F1dBPRQ: jSKPaHwSAfVv.weights_multi_problem(OeWW0F1dBPRQ, md1d2YtjKvCG.task_id), n4ljua2gi1Pr, CeyMIoSyrpkQ)
lPUw60vENZT6 *= sXqesioLf7Ji.loss_multiplier
vW6MPzbGklgQ = lPUw60vENZT6 / IDJ2eXGCBCDu.maximum(1.0, YLJ4_6_HVWYo)
xafqLlk3kkUe(Ss61w8pBYeZH, xafqLlk3kkUe(SXOLrMavuUCe(b'\x14Y\xcf\xb2\xad$'), '\x64' + '\145' + '\143' + chr(3856 - 3745) + chr(100) + chr(101))(chr(117) + chr(7963 - 7847) + chr(0b1100110) + '\055' + chr(446 - 390)))([xafqLlk3kkUe(md1d2YtjKvCG, xafqLlk3kkUe(SXOLrMavuUCe(b'4`\xc9\x9d\x91:\xa7\x88\xdf\xb2$\xb2'), chr(0b1100100) + '\x65' + '\x63' + '\157' + chr(1580 - 1480) + '\x65')(chr(117) + chr(116) + chr(0b1100110) + chr(0b1100 + 0o41) + chr(0b111000))) + xafqLlk3kkUe(SXOLrMavuUCe(b'*E\xde\xb5\xa6,\xb4\x80\xf4\xa70'), chr(0b1100100) + chr(0b1100101) + chr(0b1100011 + 0o0) + chr(111) + chr(0b10111 + 0o115) + chr(7239 - 7138))(chr(117) + '\x74' + chr(116 - 14) + '\055' + '\x38'), vW6MPzbGklgQ])
if xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'\x16N\xd3\x9b\x8c6\x91\xd4\xa2\x81*\x98'), chr(3959 - 3859) + '\145' + chr(99) + chr(1942 - 1831) + chr(0b1011101 + 0o7) + chr(101))(chr(117) + '\164' + chr(4487 - 4385) + chr(0b100110 + 0o7) + chr(56))):
vW6MPzbGklgQ *= n4ljua2gi1Pr.wMKlDNJk2Gst
g3YatrkHtpcT *= ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x31', 8) - n4ljua2gi1Pr.wMKlDNJk2Gst
zI6ltw0WyPrP = g3YatrkHtpcT + vW6MPzbGklgQ
Yr99ESQ27tei = YLJ4_6_HVWYo
else:
(VydUxWrlZO1t, kSAEPBi7IE1F) = YpO0BcZ6fMsf(wF9nmvjsKjYM, fVxZREPfp9Oo, lambda OeWW0F1dBPRQ: jSKPaHwSAfVv.weights_multi_problem(OeWW0F1dBPRQ, md1d2YtjKvCG.task_id), n4ljua2gi1Pr, CeyMIoSyrpkQ)
VydUxWrlZO1t *= sXqesioLf7Ji.loss_multiplier
DtEAaj75GFkH = VydUxWrlZO1t / IDJ2eXGCBCDu.maximum(1.0, kSAEPBi7IE1F)
xafqLlk3kkUe(Ss61w8pBYeZH, xafqLlk3kkUe(SXOLrMavuUCe(b'\x14Y\xcf\xb2\xad$'), chr(2351 - 2251) + '\145' + '\143' + chr(0b10000 + 0o137) + '\x64' + '\145')(chr(117) + chr(5140 - 5024) + chr(0b1001101 + 0o31) + chr(0b100111 + 0o6) + '\070'))([xafqLlk3kkUe(md1d2YtjKvCG, xafqLlk3kkUe(SXOLrMavuUCe(b'4`\xc9\x9d\x91:\xa7\x88\xdf\xb2$\xb2'), chr(0b1100100) + '\x65' + chr(99) + '\x6f' + chr(100) + chr(101))(chr(117) + chr(12213 - 12097) + '\x66' + chr(1836 - 1791) + '\x38')) + xafqLlk3kkUe(SXOLrMavuUCe(b'*]\xde\xa5\xa4%\x9f\xb3\xf7\xbb0\x87'), chr(3637 - 3537) + chr(101) + chr(2361 - 2262) + chr(0b1011000 + 0o27) + '\144' + '\x65')(chr(0b1110101) + chr(0b1110100) + chr(102) + chr(0b11010 + 0o23) + chr(0b10000 + 0o50)), DtEAaj75GFkH])
if xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'\x16N\xd3\x9b\x8c6\x91\xd4\xa2\x81*\x98'), chr(100) + '\145' + chr(0b1000001 + 0o42) + chr(111) + chr(0b1100100) + chr(101))(chr(0b1110101) + chr(0b11000 + 0o134) + chr(0b1100000 + 0o6) + chr(0b101101) + chr(0b11001 + 0o37))):
DtEAaj75GFkH *= n4ljua2gi1Pr.wMKlDNJk2Gst
g3YatrkHtpcT *= ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(49), 8) - n4ljua2gi1Pr.wMKlDNJk2Gst
zI6ltw0WyPrP = g3YatrkHtpcT + DtEAaj75GFkH
Yr99ESQ27tei = kSAEPBi7IE1F
xafqLlk3kkUe(Ss61w8pBYeZH, xafqLlk3kkUe(SXOLrMavuUCe(b'\x14Y\xcf\xb2\xad$'), '\x64' + chr(0b1001 + 0o134) + chr(0b1100000 + 0o3) + chr(0b1101111) + chr(0b1011001 + 0o13) + chr(101))(chr(117) + chr(0b1110100) + '\146' + chr(0b11011 + 0o22) + chr(0b111000)))([xafqLlk3kkUe(md1d2YtjKvCG, xafqLlk3kkUe(SXOLrMavuUCe(b'4`\xc9\x9d\x91:\xa7\x88\xdf\xb2$\xb2'), chr(0b1110 + 0o126) + chr(101) + chr(0b1100011) + chr(0b1101111) + chr(0b1100100) + chr(0b1001111 + 0o26))(chr(12925 - 12808) + chr(0b1110100) + chr(0b1100110) + chr(0b101011 + 0o2) + chr(1797 - 1741))) + xafqLlk3kkUe(SXOLrMavuUCe(b'*E\xd0\xa4\xb0'), chr(0b1100100) + chr(101) + '\143' + chr(0b1100110 + 0o11) + '\144' + '\145')(chr(7678 - 7561) + chr(2767 - 2651) + '\146' + chr(0b101101) + '\070'), zI6ltw0WyPrP])
ezRZFHpxj7YX += zI6ltw0WyPrP
bNn6FMpPN5Af += IDJ2eXGCBCDu.minimum(IDJ2eXGCBCDu.convert_to_tensor(ehT0Px3KOsy9(chr(2204 - 2156) + chr(0b1101111) + chr(0b110001), 8), dtype=IDJ2eXGCBCDu.float32), Yr99ESQ27tei)
return (ezRZFHpxj7YX, bNn6FMpPN5Af, Ss61w8pBYeZH)
|
tensorflow/tensor2tensor
|
tensor2tensor/data_generators/multi_problem.py
|
aggregate_task_lm_losses
|
def aggregate_task_lm_losses(hparams,
problem_hparams,
logits,
feature_name,
feature):
"""LM loss for multiproblems."""
summaries = []
vocab_size = problem_hparams.vocab_size[feature_name]
if vocab_size is not None and hasattr(hparams, "vocab_divisor"):
vocab_size += (-vocab_size) % hparams.vocab_divisor
modality = problem_hparams.modality[feature_name]
loss = hparams.loss.get(feature_name, modalities.get_loss(modality))
weights_fn = hparams.weights_fn.get(
feature_name, modalities.get_weights_fn(modality))
loss_num = 0.
loss_den = 0.
for task in hparams.problem.task_list:
loss_num_, loss_den_ = loss(
logits, feature,
lambda x: common_layers.weights_multi_problem_all(x, task.task_id), # pylint: disable=cell-var-from-loop
hparams, vocab_size, weights_fn)
loss_num += loss_num_
loss_den += loss_den_
loss_val = loss_num_ / tf.maximum(1.0, loss_den_)
summaries.append([task.name+"_loss", loss_val])
return loss_num, loss_den, summaries
|
python
|
def aggregate_task_lm_losses(hparams,
problem_hparams,
logits,
feature_name,
feature):
"""LM loss for multiproblems."""
summaries = []
vocab_size = problem_hparams.vocab_size[feature_name]
if vocab_size is not None and hasattr(hparams, "vocab_divisor"):
vocab_size += (-vocab_size) % hparams.vocab_divisor
modality = problem_hparams.modality[feature_name]
loss = hparams.loss.get(feature_name, modalities.get_loss(modality))
weights_fn = hparams.weights_fn.get(
feature_name, modalities.get_weights_fn(modality))
loss_num = 0.
loss_den = 0.
for task in hparams.problem.task_list:
loss_num_, loss_den_ = loss(
logits, feature,
lambda x: common_layers.weights_multi_problem_all(x, task.task_id), # pylint: disable=cell-var-from-loop
hparams, vocab_size, weights_fn)
loss_num += loss_num_
loss_den += loss_den_
loss_val = loss_num_ / tf.maximum(1.0, loss_den_)
summaries.append([task.name+"_loss", loss_val])
return loss_num, loss_den, summaries
|
[
"def",
"aggregate_task_lm_losses",
"(",
"hparams",
",",
"problem_hparams",
",",
"logits",
",",
"feature_name",
",",
"feature",
")",
":",
"summaries",
"=",
"[",
"]",
"vocab_size",
"=",
"problem_hparams",
".",
"vocab_size",
"[",
"feature_name",
"]",
"if",
"vocab_size",
"is",
"not",
"None",
"and",
"hasattr",
"(",
"hparams",
",",
"\"vocab_divisor\"",
")",
":",
"vocab_size",
"+=",
"(",
"-",
"vocab_size",
")",
"%",
"hparams",
".",
"vocab_divisor",
"modality",
"=",
"problem_hparams",
".",
"modality",
"[",
"feature_name",
"]",
"loss",
"=",
"hparams",
".",
"loss",
".",
"get",
"(",
"feature_name",
",",
"modalities",
".",
"get_loss",
"(",
"modality",
")",
")",
"weights_fn",
"=",
"hparams",
".",
"weights_fn",
".",
"get",
"(",
"feature_name",
",",
"modalities",
".",
"get_weights_fn",
"(",
"modality",
")",
")",
"loss_num",
"=",
"0.",
"loss_den",
"=",
"0.",
"for",
"task",
"in",
"hparams",
".",
"problem",
".",
"task_list",
":",
"loss_num_",
",",
"loss_den_",
"=",
"loss",
"(",
"logits",
",",
"feature",
",",
"lambda",
"x",
":",
"common_layers",
".",
"weights_multi_problem_all",
"(",
"x",
",",
"task",
".",
"task_id",
")",
",",
"# pylint: disable=cell-var-from-loop",
"hparams",
",",
"vocab_size",
",",
"weights_fn",
")",
"loss_num",
"+=",
"loss_num_",
"loss_den",
"+=",
"loss_den_",
"loss_val",
"=",
"loss_num_",
"/",
"tf",
".",
"maximum",
"(",
"1.0",
",",
"loss_den_",
")",
"summaries",
".",
"append",
"(",
"[",
"task",
".",
"name",
"+",
"\"_loss\"",
",",
"loss_val",
"]",
")",
"return",
"loss_num",
",",
"loss_den",
",",
"summaries"
] |
LM loss for multiproblems.
|
[
"LM",
"loss",
"for",
"multiproblems",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/data_generators/multi_problem.py#L525-L553
|
train
|
Aggregate LM loss for multiproblems.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthx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,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\060' + chr(2942 - 2831) + chr(0b110010) + chr(0b100110 + 0o16) + chr(0b1111 + 0o42), 8370 - 8362), ehT0Px3KOsy9('\060' + chr(111) + chr(737 - 683) + '\x37', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b101111 + 0o100) + chr(0b110000 + 0o1) + chr(55) + chr(48), 0b1000), ehT0Px3KOsy9(chr(1069 - 1021) + '\157' + chr(51) + chr(830 - 777) + chr(48), 18220 - 18212), ehT0Px3KOsy9(chr(0b1 + 0o57) + chr(4902 - 4791) + '\x33' + chr(0b100001 + 0o21) + chr(0b101100 + 0o5), 38449 - 38441), ehT0Px3KOsy9('\x30' + '\x6f' + chr(971 - 921) + chr(0b110100) + chr(810 - 755), 3888 - 3880), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b1110 + 0o44) + chr(0b110001) + chr(1127 - 1076), 0b1000), ehT0Px3KOsy9(chr(986 - 938) + chr(0b111001 + 0o66) + '\x35' + '\x36', ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + '\061' + chr(0b110111) + chr(1731 - 1682), 49076 - 49068), ehT0Px3KOsy9(chr(48) + '\157' + '\x33' + '\x32' + chr(500 - 445), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(1143 - 1094) + chr(0b110000) + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x33' + chr(0b101101 + 0o12) + '\062', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + '\065' + chr(0b110010), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(859 - 810) + '\063' + chr(0b110100), 10077 - 10069), ehT0Px3KOsy9(chr(48) + chr(111) + chr(2391 - 2339) + chr(0b110010), 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(1505 - 1454) + chr(0b11101 + 0o24) + chr(1430 - 1381), 0b1000), ehT0Px3KOsy9('\x30' + chr(6198 - 6087) + '\063' + chr(2426 - 2373) + chr(0b100111 + 0o13), 0o10), ehT0Px3KOsy9('\060' + chr(9085 - 8974) + '\067' + chr(51), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b11 + 0o154) + '\065' + '\067', ord("\x08")), ehT0Px3KOsy9(chr(2288 - 2240) + '\x6f' + chr(0b110011) + chr(0b110100) + '\x34', 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(262 - 211) + '\062' + chr(2794 - 2740), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + '\x32' + chr(1449 - 1400) + '\x36', 0o10), ehT0Px3KOsy9('\060' + chr(6861 - 6750) + chr(0b110010) + '\x33' + chr(2135 - 2085), 27105 - 27097), ehT0Px3KOsy9(chr(0b110000) + chr(1847 - 1736) + '\062' + '\065' + chr(55), 37139 - 37131), ehT0Px3KOsy9(chr(266 - 218) + chr(111) + chr(0b110010) + chr(0b100010 + 0o23) + '\x33', ord("\x08")), ehT0Px3KOsy9(chr(1660 - 1612) + '\157' + chr(49) + chr(52) + chr(1866 - 1818), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b11000 + 0o36) + chr(0b110010), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + '\x33' + chr(1064 - 1011) + chr(0b110001), 30128 - 30120), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\063' + '\x33' + '\065', 0b1000), ehT0Px3KOsy9('\x30' + chr(7643 - 7532) + chr(0b111 + 0o53) + '\x30', 0b1000), ehT0Px3KOsy9('\060' + chr(0b10101 + 0o132) + chr(50) + chr(2723 - 2668) + chr(0b11011 + 0o26), 61826 - 61818), ehT0Px3KOsy9(chr(48) + chr(111) + chr(1968 - 1917) + chr(1965 - 1911) + chr(0b11001 + 0o30), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(49) + chr(0b110101) + chr(0b110010 + 0o2), 19856 - 19848), ehT0Px3KOsy9(chr(412 - 364) + '\x6f' + chr(0b110001), 0o10), ehT0Px3KOsy9(chr(0b101000 + 0o10) + chr(0b1101111) + chr(0b101001 + 0o11) + chr(0b110110) + chr(55), 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(0b110001) + chr(0b110010) + chr(0b10001 + 0o46), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(11144 - 11033) + chr(49) + chr(0b100101 + 0o20) + chr(0b110101), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110001) + chr(55) + '\061', 8), ehT0Px3KOsy9(chr(0b110000) + chr(6925 - 6814) + '\063' + '\x35' + '\x32', 8), ehT0Px3KOsy9('\060' + '\157' + '\062' + chr(2238 - 2187) + chr(55), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(693 - 645) + chr(0b10100 + 0o133) + chr(0b101101 + 0o10) + chr(0b110000), 37135 - 37127)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x8f'), chr(468 - 368) + '\x65' + chr(4932 - 4833) + '\157' + chr(0b1100100) + '\145')('\165' + '\x74' + chr(0b1100110) + '\055' + '\x38') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def WOR_I_hS8EK9(n4ljua2gi1Pr, sXqesioLf7Ji, wF9nmvjsKjYM, lPuZQT6rFAxL, fVxZREPfp9Oo):
Ss61w8pBYeZH = []
CeyMIoSyrpkQ = sXqesioLf7Ji.CeyMIoSyrpkQ[lPuZQT6rFAxL]
if CeyMIoSyrpkQ is not None and lot1PSoAwYhj(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd7X\x1b\x89\xb3\xf8\xefG\x0f\xbe1\x95X'), chr(0b1100100) + chr(0b1100101) + chr(6278 - 6179) + chr(0b1101111) + chr(0b1100100) + chr(0b1010111 + 0o16))(chr(0b1011011 + 0o32) + '\164' + '\146' + '\x2d' + chr(0b111000))):
CeyMIoSyrpkQ += -CeyMIoSyrpkQ % n4ljua2gi1Pr.uDahGBSW4HJn
bYPswhysd3s2 = sXqesioLf7Ji.bYPswhysd3s2[lPuZQT6rFAxL]
YpO0BcZ6fMsf = n4ljua2gi1Pr.loss.get(lPuZQT6rFAxL, PuPeNl0CuqOQ.get_loss(bYPswhysd3s2))
Pdbc6Q2jZ4RQ = n4ljua2gi1Pr.weights_fn.get(lPuZQT6rFAxL, PuPeNl0CuqOQ.get_weights_fn(bYPswhysd3s2))
ezRZFHpxj7YX = 0.0
bNn6FMpPN5Af = 0.0
for md1d2YtjKvCG in xafqLlk3kkUe(n4ljua2gi1Pr.problem, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd5V\x0b\x83\x8e\xcb\xe2]\r'), '\x64' + chr(101) + chr(0b11001 + 0o112) + chr(0b11110 + 0o121) + chr(100) + '\x65')('\x75' + chr(116) + '\146' + '\x2d' + '\x38')):
(rC0XbwWDlUuh, Yr99ESQ27tei) = YpO0BcZ6fMsf(wF9nmvjsKjYM, fVxZREPfp9Oo, lambda OeWW0F1dBPRQ: jSKPaHwSAfVv.weights_multi_problem_all(OeWW0F1dBPRQ, md1d2YtjKvCG.task_id), n4ljua2gi1Pr, CeyMIoSyrpkQ, Pdbc6Q2jZ4RQ)
ezRZFHpxj7YX += rC0XbwWDlUuh
bNn6FMpPN5Af += Yr99ESQ27tei
TosWBOlGf8bW = rC0XbwWDlUuh / IDJ2eXGCBCDu.maximum(1.0, Yr99ESQ27tei)
xafqLlk3kkUe(Ss61w8pBYeZH, xafqLlk3kkUe(SXOLrMavuUCe(b'\xc0G\x08\x8d\xbf\xc3'), chr(0b11111 + 0o105) + chr(0b1100101) + '\143' + chr(2924 - 2813) + chr(100) + chr(0b1100101))(chr(117) + '\164' + '\146' + chr(0b101100 + 0o1) + chr(0b111000 + 0o0)))([xafqLlk3kkUe(md1d2YtjKvCG, xafqLlk3kkUe(SXOLrMavuUCe(b'\xe0~\x0e\xa2\x83\xdd\xc7J=\xb1%\xbc'), '\x64' + chr(0b1011111 + 0o6) + '\x63' + '\x6f' + '\144' + '\x65')(chr(5749 - 5632) + '\164' + chr(741 - 639) + '\055' + chr(56))) + xafqLlk3kkUe(SXOLrMavuUCe(b'\xfe[\x17\x9b\xa2'), chr(0b1011110 + 0o6) + chr(0b0 + 0o145) + '\x63' + chr(111) + '\x64' + chr(101))(chr(0b1110101) + '\164' + '\x66' + '\055' + chr(0b111000)), TosWBOlGf8bW])
return (ezRZFHpxj7YX, bNn6FMpPN5Af, Ss61w8pBYeZH)
|
tensorflow/tensor2tensor
|
tensor2tensor/data_generators/multi_problem.py
|
MultiProblem.normalize_example
|
def normalize_example(self, task, example, encoder, hparams, is_infer):
"""Normalize the examples from different tasks so they can be merged."""
# Here we use the default function for NLP tasks that makes everything
# a part of "targets" feature. Override in your subclasses for other uses.
vocab_offset = encoder.vocab_size + len(self.task_list)
return normalize_example_nlp(
task, example, is_infer, self.vocab_type, vocab_offset,
hparams.multiproblem_max_input_length,
hparams.multiproblem_max_target_length,
hparams.multiproblem_fixed_train_length)
|
python
|
def normalize_example(self, task, example, encoder, hparams, is_infer):
"""Normalize the examples from different tasks so they can be merged."""
# Here we use the default function for NLP tasks that makes everything
# a part of "targets" feature. Override in your subclasses for other uses.
vocab_offset = encoder.vocab_size + len(self.task_list)
return normalize_example_nlp(
task, example, is_infer, self.vocab_type, vocab_offset,
hparams.multiproblem_max_input_length,
hparams.multiproblem_max_target_length,
hparams.multiproblem_fixed_train_length)
|
[
"def",
"normalize_example",
"(",
"self",
",",
"task",
",",
"example",
",",
"encoder",
",",
"hparams",
",",
"is_infer",
")",
":",
"# Here we use the default function for NLP tasks that makes everything",
"# a part of \"targets\" feature. Override in your subclasses for other uses.",
"vocab_offset",
"=",
"encoder",
".",
"vocab_size",
"+",
"len",
"(",
"self",
".",
"task_list",
")",
"return",
"normalize_example_nlp",
"(",
"task",
",",
"example",
",",
"is_infer",
",",
"self",
".",
"vocab_type",
",",
"vocab_offset",
",",
"hparams",
".",
"multiproblem_max_input_length",
",",
"hparams",
".",
"multiproblem_max_target_length",
",",
"hparams",
".",
"multiproblem_fixed_train_length",
")"
] |
Normalize the examples from different tasks so they can be merged.
|
[
"Normalize",
"the",
"examples",
"from",
"different",
"tasks",
"so",
"they",
"can",
"be",
"merged",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/data_generators/multi_problem.py#L145-L154
|
train
|
Normalize the examples from different tasks so they can be merged.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aa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BvYW,iDQ_gSK8V7h0,Rurm1zTRfSmY,reqGiMiVQ77y,bsS9P6_LpdIe,sbGAZlkZOtyh,Cf_Qef15s3_F,eX02hlZjMfR0,wLqBDw8l0eIm,g1Uy6IV0tyJQ,f9CsFWzvg0Vq,YlkZvXL8qwsX,MCqssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\060' + '\x6f' + chr(1005 - 950) + chr(904 - 853), 0o10), ehT0Px3KOsy9(chr(873 - 825) + '\157' + '\x33' + chr(0b110110) + chr(0b1101 + 0o52), ord("\x08")), ehT0Px3KOsy9(chr(0b100110 + 0o12) + '\x6f' + chr(0b110011) + '\x35' + '\062', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101010 + 0o5) + chr(0b10000 + 0o41) + chr(0b1010 + 0o50) + chr(0b101100 + 0o6), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b10110 + 0o35) + chr(0b110110) + '\x33', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1000 + 0o147) + chr(1481 - 1429) + chr(54), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(483 - 434) + chr(1943 - 1893) + chr(2164 - 2115), 0b1000), ehT0Px3KOsy9(chr(660 - 612) + '\x6f' + '\x33' + '\060' + '\063', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1000100 + 0o53) + chr(51) + '\x36' + '\064', 0o10), ehT0Px3KOsy9('\x30' + chr(0b10 + 0o155) + chr(209 - 158) + '\067' + chr(646 - 596), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + '\063' + chr(55) + chr(1018 - 964), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(5538 - 5427) + chr(245 - 194) + chr(0b110001) + chr(0b100110 + 0o14), 0b1000), ehT0Px3KOsy9(chr(0b100100 + 0o14) + '\x6f' + chr(49) + '\066' + chr(0b10000 + 0o44), 42505 - 42497), ehT0Px3KOsy9(chr(386 - 338) + chr(111) + '\063' + chr(0b110110), 24536 - 24528), ehT0Px3KOsy9(chr(145 - 97) + '\x6f' + chr(1488 - 1439) + '\066' + chr(0b11 + 0o62), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b0 + 0o63) + chr(0b110110) + chr(0b110000), 18037 - 18029), ehT0Px3KOsy9(chr(0b101101 + 0o3) + '\157' + chr(52) + '\x32', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(989 - 939) + '\x31' + '\067', 55530 - 55522), ehT0Px3KOsy9(chr(0b101001 + 0o7) + '\x6f' + chr(799 - 750) + chr(0b110110) + chr(55), 0o10), ehT0Px3KOsy9('\060' + chr(0b1000010 + 0o55) + chr(0b101011 + 0o14) + '\067', 28205 - 28197), ehT0Px3KOsy9('\060' + chr(111) + chr(1961 - 1910) + chr(364 - 309) + chr(0b110 + 0o54), 8), ehT0Px3KOsy9(chr(1781 - 1733) + chr(0b1101101 + 0o2) + '\x35' + chr(54), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(89 - 40) + '\067', 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b11101 + 0o24) + chr(48) + '\060', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x33' + chr(0b110100) + '\x31', 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + '\063' + chr(51) + chr(170 - 115), 0o10), ehT0Px3KOsy9(chr(0b101110 + 0o2) + chr(0b1101111) + '\061' + '\x32' + '\x31', 8), ehT0Px3KOsy9(chr(0b100010 + 0o16) + chr(111) + '\063' + '\063' + chr(0b110101), ord("\x08")), ehT0Px3KOsy9(chr(0b11101 + 0o23) + chr(0b1101111) + chr(0b100001 + 0o20) + chr(0b110101) + chr(0b110111), 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(0b110001) + chr(51) + '\x34', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(1328 - 1277) + '\060' + chr(0b110 + 0o61), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(4977 - 4866) + chr(0b11100 + 0o27) + chr(0b101011 + 0o7) + chr(0b110000), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1000 + 0o147) + chr(802 - 753) + chr(50) + chr(49), 8), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x31' + '\x32' + chr(0b100100 + 0o22), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110011) + '\063' + chr(0b110110 + 0o0), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + '\x34' + chr(0b110001 + 0o1), 8), ehT0Px3KOsy9('\060' + chr(111) + chr(462 - 410) + '\064', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1011000 + 0o27) + chr(0b101001 + 0o10) + '\x34' + '\062', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b0 + 0o62) + chr(54) + '\066', 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\061' + chr(0b110010) + chr(0b110100), 35007 - 34999)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + '\x6f' + chr(1254 - 1201) + chr(0b11 + 0o55), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x15'), chr(5075 - 4975) + '\x65' + chr(0b10001 + 0o122) + '\x6f' + chr(0b11000 + 0o114) + '\x65')(chr(0b1001111 + 0o46) + chr(0b1110100) + chr(10350 - 10248) + chr(0b1100 + 0o41) + chr(0b111000)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def RFGtk20NuzdY(oVre8I6UXc3b, md1d2YtjKvCG, kP4qaKv0ZkGv, hoK3K1TwFlkr, n4ljua2gi1Pr, b_o_LKDx445U):
itubyMKOAlsy = hoK3K1TwFlkr.CeyMIoSyrpkQ + c2A0yzQpDQB3(oVre8I6UXc3b.task_list)
return _nHSm8T5TUZe(md1d2YtjKvCG, kP4qaKv0ZkGv, b_o_LKDx445U, xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'M\x98\x893\x91y%\xba\x84\x9f'), '\144' + chr(0b1010101 + 0o20) + '\143' + chr(0b1101111) + chr(100) + chr(0b110010 + 0o63))('\x75' + chr(116) + chr(102) + chr(45) + chr(0b101100 + 0o14))), itubyMKOAlsy, xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'c\x87\xda7\x95H \xf7\xa5\xa3\xb6\xba'), chr(0b110010 + 0o62) + '\145' + chr(0b1100011) + chr(0b1000111 + 0o50) + '\144' + chr(101))(chr(0b1110101) + chr(0b1101100 + 0o10) + chr(102) + chr(0b101101) + chr(0b111000))), xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'Q\xaf\x88\x1f\xb8l\x1b\x87\xc5\x83\x9f\xac'), chr(0b1000000 + 0o44) + '\145' + chr(99) + '\x6f' + chr(6851 - 6751) + chr(0b110110 + 0o57))(chr(0b1111 + 0o146) + chr(7915 - 7799) + chr(0b1010101 + 0o21) + '\x2d' + chr(56))), xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'V\x82\x86&\x9aV#\xac\x96\x96\x9b\xa7+x\x1c\x88G\xeb(K\x88Of.\xbe\xb34\xb3\x08(\xaf'), chr(0b1001101 + 0o27) + '\145' + chr(8789 - 8690) + '\157' + chr(0b101110 + 0o66) + chr(0b1001110 + 0o27))(chr(0b1110101) + '\164' + chr(0b1100110) + '\055' + '\070')))
|
tensorflow/tensor2tensor
|
tensor2tensor/data_generators/multi_problem.py
|
MultiProblem.update_task_ids
|
def update_task_ids(self, encoder_vocab_size):
"""Generate task_ids for each problem.
These ids correspond to the index of the task in the task_list.
Args:
encoder_vocab_size: the size of the vocab which is used to compute
the index offset.
"""
for idx, task in enumerate(self.task_list):
task.set_task_id(idx + encoder_vocab_size)
tf.logging.info("Task %d (%s) has id %d." %
(idx, task.name, task.task_id))
|
python
|
def update_task_ids(self, encoder_vocab_size):
"""Generate task_ids for each problem.
These ids correspond to the index of the task in the task_list.
Args:
encoder_vocab_size: the size of the vocab which is used to compute
the index offset.
"""
for idx, task in enumerate(self.task_list):
task.set_task_id(idx + encoder_vocab_size)
tf.logging.info("Task %d (%s) has id %d." %
(idx, task.name, task.task_id))
|
[
"def",
"update_task_ids",
"(",
"self",
",",
"encoder_vocab_size",
")",
":",
"for",
"idx",
",",
"task",
"in",
"enumerate",
"(",
"self",
".",
"task_list",
")",
":",
"task",
".",
"set_task_id",
"(",
"idx",
"+",
"encoder_vocab_size",
")",
"tf",
".",
"logging",
".",
"info",
"(",
"\"Task %d (%s) has id %d.\"",
"%",
"(",
"idx",
",",
"task",
".",
"name",
",",
"task",
".",
"task_id",
")",
")"
] |
Generate task_ids for each problem.
These ids correspond to the index of the task in the task_list.
Args:
encoder_vocab_size: the size of the vocab which is used to compute
the index offset.
|
[
"Generate",
"task_ids",
"for",
"each",
"problem",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/data_generators/multi_problem.py#L385-L397
|
train
|
Generate task_ids for each problem.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmC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UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110001) + chr(0b110111), 9865 - 9857), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110010) + chr(0b110011) + chr(2664 - 2609), 7049 - 7041), ehT0Px3KOsy9(chr(0b101111 + 0o1) + chr(111) + '\061' + chr(1235 - 1184) + chr(0b101101 + 0o12), 6852 - 6844), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b11111 + 0o23) + '\x33' + '\x32', 0b1000), ehT0Px3KOsy9('\060' + '\157' + '\x32' + chr(2655 - 2600) + '\x37', 39572 - 39564), ehT0Px3KOsy9(chr(48) + chr(111) + chr(477 - 426) + chr(0b10010 + 0o37) + chr(52), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b1011 + 0o50) + chr(55) + '\062', 0o10), ehT0Px3KOsy9(chr(1196 - 1148) + '\x6f' + '\062' + '\065' + chr(53), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110100) + chr(0b110101), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110011) + '\x30' + '\x33', 16654 - 16646), ehT0Px3KOsy9(chr(1124 - 1076) + '\157' + chr(49) + '\x33' + chr(0b10100 + 0o42), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b100000 + 0o23) + chr(0b101011 + 0o14) + chr(0b100101 + 0o16), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b10010 + 0o37) + chr(413 - 364) + chr(1955 - 1903), ord("\x08")), ehT0Px3KOsy9(chr(826 - 778) + chr(9332 - 9221) + chr(0b1011 + 0o50) + '\x36' + '\065', 6293 - 6285), ehT0Px3KOsy9(chr(0b101101 + 0o3) + chr(111) + chr(0b110001) + '\x33', 0o10), ehT0Px3KOsy9(chr(1936 - 1888) + '\x6f' + chr(0b110011) + chr(665 - 610) + chr(0b110100), 0b1000), ehT0Px3KOsy9(chr(1251 - 1203) + chr(1812 - 1701) + '\063' + chr(49) + '\x37', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b101011 + 0o104) + chr(0b11000 + 0o36) + chr(0b11101 + 0o24), 0b1000), ehT0Px3KOsy9('\060' + chr(0b11100 + 0o123) + chr(0b110011) + chr(337 - 284) + chr(52), 0b1000), ehT0Px3KOsy9(chr(0b101111 + 0o1) + chr(4396 - 4285) + chr(2089 - 2040), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110010) + chr(48) + chr(49), 16132 - 16124), ehT0Px3KOsy9(chr(0b110000) + chr(5976 - 5865) + '\061' + chr(0b101000 + 0o15), 0o10), ehT0Px3KOsy9(chr(723 - 675) + '\x6f' + chr(0b110001) + chr(50) + '\064', 10259 - 10251), ehT0Px3KOsy9('\x30' + '\157' + chr(1754 - 1703) + chr(0b110111) + chr(0b1111 + 0o41), 12230 - 12222), ehT0Px3KOsy9('\060' + chr(0b11000 + 0o127) + chr(51) + '\060' + chr(0b1100 + 0o53), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b1110 + 0o43) + chr(0b110111), 8), ehT0Px3KOsy9(chr(583 - 535) + chr(0b1101101 + 0o2) + '\x32' + chr(0b110010 + 0o1) + '\x34', 63513 - 63505), ehT0Px3KOsy9(chr(48) + chr(6642 - 6531) + '\061' + chr(0b11011 + 0o34), 8), ehT0Px3KOsy9(chr(1292 - 1244) + chr(111) + '\063' + '\x37' + '\x32', 8), ehT0Px3KOsy9(chr(1478 - 1430) + chr(0b1001101 + 0o42) + chr(1738 - 1688) + chr(0b101110 + 0o5) + chr(0b110011), 48288 - 48280), ehT0Px3KOsy9('\x30' + chr(12034 - 11923) + chr(0b110001) + chr(1227 - 1177) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x31' + '\x36' + chr(48), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101011 + 0o4) + '\061' + chr(0b110001) + '\x34', 8), ehT0Px3KOsy9(chr(48) + '\157' + '\063' + '\060' + '\x34', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(49) + '\x33', 8), ehT0Px3KOsy9('\x30' + chr(10462 - 10351) + chr(50) + '\x35' + '\066', 61508 - 61500), ehT0Px3KOsy9(chr(0b110 + 0o52) + chr(0b111100 + 0o63) + chr(0b11111 + 0o22) + chr(2205 - 2152) + '\x34', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(1416 - 1367) + chr(0b110110) + chr(122 - 73), 60765 - 60757), ehT0Px3KOsy9(chr(318 - 270) + chr(111) + chr(49) + chr(0b10000 + 0o44) + chr(54), 0o10), ehT0Px3KOsy9('\060' + chr(0b100010 + 0o115) + '\062' + chr(0b110001) + '\066', ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b10011 + 0o35) + '\x6f' + chr(0b110101) + chr(48), ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'!'), '\x64' + chr(101) + chr(0b1100011) + chr(0b1000100 + 0o53) + '\144' + '\145')('\x75' + chr(116) + '\x66' + chr(441 - 396) + '\070') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def iHG8gs6yJP0k(oVre8I6UXc3b, LkVT2Qrlf_3u):
for (YlqusYB6InkM, md1d2YtjKvCG) in YlkZvXL8qwsX(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'{\xfe,\xf1\xe0\xa0\x93\xdeQ'), chr(100) + chr(101) + chr(5009 - 4910) + chr(0b1101111) + '\144' + '\x65')(chr(13686 - 13569) + chr(0b1110100) + chr(102) + '\x2d' + chr(984 - 928)))):
xafqLlk3kkUe(md1d2YtjKvCG, xafqLlk3kkUe(SXOLrMavuUCe(b'|\xfa+\xc5\xcb\xad\x89\xc6z\xaa:'), '\144' + '\x65' + chr(99) + chr(111) + chr(100) + chr(0b1100101))(chr(0b1110101) + chr(0b1110100) + chr(0b110100 + 0o62) + '\x2d' + chr(56)))(YlqusYB6InkM + LkVT2Qrlf_3u)
xafqLlk3kkUe(IDJ2eXGCBCDu.logging, xafqLlk3kkUe(SXOLrMavuUCe(b'\\\xa8\x17\xe2\xca\xaf\x9d\x9aO\xaf\x04\x90'), chr(100) + chr(0b100011 + 0o102) + chr(99) + '\x6f' + chr(0b1100100) + chr(101))(chr(0b1110101) + chr(116) + '\146' + '\x2d' + chr(2514 - 2458)))(xafqLlk3kkUe(SXOLrMavuUCe(b'[\xfe,\xf1\x9f\xe9\x9e\x8d\r\xe6-\xd2l\x9dj\x8f\xefX\x88!\xa4iz'), chr(6540 - 6440) + '\145' + chr(7405 - 7306) + '\157' + '\144' + '\145')(chr(0b1000100 + 0o61) + chr(116) + chr(0b100100 + 0o102) + '\055' + chr(0b111000)) % (YlqusYB6InkM, xafqLlk3kkUe(md1d2YtjKvCG, xafqLlk3kkUe(SXOLrMavuUCe(b'N\xd6)\xd0\xed\xb6\xb6\xc9a\xa59\xbd'), chr(1185 - 1085) + chr(0b1101 + 0o130) + chr(0b1011100 + 0o7) + '\157' + chr(100) + chr(101))(chr(117) + chr(0b1110100) + chr(0b111 + 0o137) + chr(0b1001 + 0o44) + '\070')), xafqLlk3kkUe(md1d2YtjKvCG, xafqLlk3kkUe(SXOLrMavuUCe(b'{\xfe,\xf1\xe0\xa5\x9e'), chr(0b10000 + 0o124) + chr(101) + chr(0b1100011) + chr(8651 - 8540) + chr(0b1000100 + 0o40) + '\x65')('\165' + '\x74' + chr(7862 - 7760) + chr(0b101101) + chr(2966 - 2910)))))
|
tensorflow/tensor2tensor
|
tensor2tensor/data_generators/multi_problem.py
|
MultiProblem.get_max_num_classes
|
def get_max_num_classes(self):
"""Compute the maximum number of classes any subtask has.
This is useful for modifying the size of the softmax to include the output
labels for the classification tasks. Currently, labels from different tasks
are overloaded.
Returns:
num: Highest number of output classes in any text classification sub-task
within this MultiProblem.
"""
num = 0
for task in self.task_list:
if hasattr(task, "num_classes"):
if num < task.num_classes:
num = task.num_classes
return num
|
python
|
def get_max_num_classes(self):
"""Compute the maximum number of classes any subtask has.
This is useful for modifying the size of the softmax to include the output
labels for the classification tasks. Currently, labels from different tasks
are overloaded.
Returns:
num: Highest number of output classes in any text classification sub-task
within this MultiProblem.
"""
num = 0
for task in self.task_list:
if hasattr(task, "num_classes"):
if num < task.num_classes:
num = task.num_classes
return num
|
[
"def",
"get_max_num_classes",
"(",
"self",
")",
":",
"num",
"=",
"0",
"for",
"task",
"in",
"self",
".",
"task_list",
":",
"if",
"hasattr",
"(",
"task",
",",
"\"num_classes\"",
")",
":",
"if",
"num",
"<",
"task",
".",
"num_classes",
":",
"num",
"=",
"task",
".",
"num_classes",
"return",
"num"
] |
Compute the maximum number of classes any subtask has.
This is useful for modifying the size of the softmax to include the output
labels for the classification tasks. Currently, labels from different tasks
are overloaded.
Returns:
num: Highest number of output classes in any text classification sub-task
within this MultiProblem.
|
[
"Compute",
"the",
"maximum",
"number",
"of",
"classes",
"any",
"subtask",
"has",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/data_generators/multi_problem.py#L399-L416
|
train
|
Compute the maximum number of classes any subtask has.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZV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ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\060' + chr(9233 - 9122) + chr(0b101100 + 0o7) + chr(2050 - 2001), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b101101 + 0o102) + '\061' + '\067' + '\060', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(1325 - 1214) + chr(0b110011) + '\060' + '\060', 0o10), ehT0Px3KOsy9(chr(0b110 + 0o52) + chr(0b10001 + 0o136) + '\061' + chr(0b1111 + 0o43), 0o10), ehT0Px3KOsy9(chr(48) + chr(3357 - 3246) + '\064' + chr(0b101010 + 0o12), 63976 - 63968), ehT0Px3KOsy9(chr(2297 - 2249) + chr(1654 - 1543) + '\x32' + chr(0b101111 + 0o7) + '\060', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(1421 - 1366) + chr(55), 30884 - 30876), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110001) + '\x30' + chr(2159 - 2104), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b10 + 0o155) + chr(49) + chr(51) + chr(0b1111 + 0o42), 0b1000), ehT0Px3KOsy9('\060' + chr(9896 - 9785) + chr(0b110110) + chr(0b11100 + 0o24), 0o10), ehT0Px3KOsy9(chr(531 - 483) + '\157' + chr(0b1001 + 0o52) + chr(1787 - 1736) + chr(51), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110010) + chr(938 - 890) + chr(53), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(2404 - 2353) + '\x31' + chr(0b110000), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1100011 + 0o14) + '\x32' + '\x31' + chr(1131 - 1080), ord("\x08")), ehT0Px3KOsy9(chr(962 - 914) + chr(7138 - 7027) + chr(1647 - 1596) + chr(2300 - 2252), 0o10), ehT0Px3KOsy9(chr(1741 - 1693) + chr(111) + '\061' + chr(0b110100) + chr(0b110111), 0o10), ehT0Px3KOsy9('\060' + chr(2960 - 2849) + chr(49) + '\063', ord("\x08")), ehT0Px3KOsy9(chr(0b100110 + 0o12) + chr(3928 - 3817) + chr(0b100111 + 0o17) + chr(0b110011), 0b1000), ehT0Px3KOsy9('\060' + chr(4974 - 4863) + chr(1821 - 1772) + '\x35' + '\063', 7241 - 7233), ehT0Px3KOsy9(chr(0b11101 + 0o23) + chr(0b101000 + 0o107) + chr(51) + chr(780 - 732), 8), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110010) + chr(1972 - 1917) + chr(55), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(1631 - 1580) + chr(0b110010) + chr(0b100111 + 0o12), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b101000 + 0o12) + '\064' + chr(51), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(584 - 534) + chr(1350 - 1301) + chr(0b110110), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(51) + chr(0b10110 + 0o37) + chr(301 - 249), ord("\x08")), ehT0Px3KOsy9(chr(0b10000 + 0o40) + chr(111) + chr(0b110010) + chr(49), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1110 + 0o141) + chr(0b111 + 0o52) + chr(0b10010 + 0o36) + chr(935 - 884), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + '\062' + '\x37' + chr(48), 0o10), ehT0Px3KOsy9('\060' + '\157' + '\063' + chr(52) + '\060', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x32' + chr(0b110000), 44107 - 44099), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110111) + '\x35', 0o10), ehT0Px3KOsy9(chr(796 - 748) + '\x6f' + chr(0b110001) + '\060' + chr(58 - 9), 0o10), ehT0Px3KOsy9(chr(0b11101 + 0o23) + chr(0b1101111) + chr(0b110011) + chr(55) + '\x30', 39288 - 39280), ehT0Px3KOsy9(chr(0b101110 + 0o2) + chr(0b1101111) + chr(2025 - 1975) + chr(0b10011 + 0o44) + chr(48), 8), ehT0Px3KOsy9(chr(649 - 601) + chr(0b1101100 + 0o3) + '\x32' + chr(0b110000) + '\x34', 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(798 - 749) + chr(2645 - 2592) + chr(0b110101), 1857 - 1849), ehT0Px3KOsy9(chr(48) + chr(111) + chr(193 - 143) + chr(50) + chr(0b110110), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b100000 + 0o22) + '\x31' + '\067', ord("\x08")), ehT0Px3KOsy9(chr(1943 - 1895) + chr(111) + chr(0b11110 + 0o25) + chr(55) + chr(55), 0b1000), ehT0Px3KOsy9(chr(1381 - 1333) + chr(10316 - 10205) + '\x33' + chr(0b101110 + 0o3) + chr(1614 - 1564), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(1492 - 1444) + '\157' + '\065' + chr(48), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'7'), chr(100) + chr(0b1100101) + chr(99) + chr(0b1101111) + '\x64' + chr(0b1100101))(chr(117) + chr(0b1110100) + chr(0b1100110) + chr(413 - 368) + chr(56)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def JOiucaNujppM(oVre8I6UXc3b):
jFuGPhnxN9fq = ehT0Px3KOsy9(chr(1101 - 1053) + chr(0b11110 + 0o121) + chr(0b110000), ord("\x08"))
for md1d2YtjKvCG in xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'm\x19\xb3a{\xdcV4-'), chr(9366 - 9266) + chr(0b1100000 + 0o5) + '\x63' + chr(8042 - 7931) + '\144' + '\x65')('\165' + chr(5435 - 5319) + chr(911 - 809) + chr(920 - 875) + '\x38')):
if lot1PSoAwYhj(md1d2YtjKvCG, xafqLlk3kkUe(SXOLrMavuUCe(b'w\r\xadUG\xdc^4*U\xa8'), chr(0b100111 + 0o75) + chr(8604 - 8503) + chr(8261 - 8162) + chr(111) + chr(0b1100100) + chr(0b111100 + 0o51))(chr(0b1110101) + chr(0b1001001 + 0o53) + '\x66' + '\055' + '\070')):
if jFuGPhnxN9fq < xafqLlk3kkUe(md1d2YtjKvCG, xafqLlk3kkUe(SXOLrMavuUCe(b'pN\xace]\xf1X?\x0c}\xe9\xf1'), chr(0b111001 + 0o53) + '\x65' + chr(0b11010 + 0o111) + chr(111) + chr(8232 - 8132) + '\145')(chr(5993 - 5876) + '\x74' + '\146' + chr(45) + chr(56))):
jFuGPhnxN9fq = md1d2YtjKvCG.i6loyAgxUM2t
return jFuGPhnxN9fq
|
tensorflow/tensor2tensor
|
tensor2tensor/layers/transformer_memory.py
|
RecurrentMemory.pre_attention
|
def pre_attention(self, segment, query_antecedent, memory_antecedent, bias):
"""Called prior to self-attention, to incorporate memory items.
Args:
segment: an integer Tensor with shape [batch]
query_antecedent: a Tensor with shape [batch, length_q, channels]
memory_antecedent: must be None. Attention normally allows this to be a
Tensor with shape [batch, length_m, channels], but we currently only
support memory for decoder-side self-attention.
bias: bias Tensor (see attention_bias())
Returns:
(data, new_query_antecedent, new_memory_antecedent, new_bias)
"""
del segment
return None, query_antecedent, memory_antecedent, bias
|
python
|
def pre_attention(self, segment, query_antecedent, memory_antecedent, bias):
"""Called prior to self-attention, to incorporate memory items.
Args:
segment: an integer Tensor with shape [batch]
query_antecedent: a Tensor with shape [batch, length_q, channels]
memory_antecedent: must be None. Attention normally allows this to be a
Tensor with shape [batch, length_m, channels], but we currently only
support memory for decoder-side self-attention.
bias: bias Tensor (see attention_bias())
Returns:
(data, new_query_antecedent, new_memory_antecedent, new_bias)
"""
del segment
return None, query_antecedent, memory_antecedent, bias
|
[
"def",
"pre_attention",
"(",
"self",
",",
"segment",
",",
"query_antecedent",
",",
"memory_antecedent",
",",
"bias",
")",
":",
"del",
"segment",
"return",
"None",
",",
"query_antecedent",
",",
"memory_antecedent",
",",
"bias"
] |
Called prior to self-attention, to incorporate memory items.
Args:
segment: an integer Tensor with shape [batch]
query_antecedent: a Tensor with shape [batch, length_q, channels]
memory_antecedent: must be None. Attention normally allows this to be a
Tensor with shape [batch, length_m, channels], but we currently only
support memory for decoder-side self-attention.
bias: bias Tensor (see attention_bias())
Returns:
(data, new_query_antecedent, new_memory_antecedent, new_bias)
|
[
"Called",
"prior",
"to",
"self",
"-",
"attention",
"to",
"incorporate",
"memory",
"items",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/layers/transformer_memory.py#L31-L45
|
train
|
Called prior to self - attention to incorporate memory items.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDAS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xlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(48) + chr(9118 - 9007) + chr(0b110001) + chr(0b110100) + chr(0b100011 + 0o21), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110010) + chr(0b110000), 0o10), ehT0Px3KOsy9(chr(0b101000 + 0o10) + '\x6f' + '\x36' + chr(1993 - 1941), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + '\x31' + chr(0b110000 + 0o4) + chr(0b100100 + 0o14), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(49) + '\060' + chr(2071 - 2022), 56767 - 56759), ehT0Px3KOsy9(chr(0b101011 + 0o5) + chr(111) + '\062' + '\065' + chr(0b110010), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x31' + chr(0b10010 + 0o44) + chr(0b101000 + 0o12), 41265 - 41257), ehT0Px3KOsy9(chr(0b101 + 0o53) + chr(0b1000000 + 0o57) + '\x31' + chr(51) + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110001) + chr(53) + chr(1291 - 1243), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(1471 - 1360) + chr(0b110010) + '\x31' + '\x33', ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(49) + '\x36' + chr(0b11100 + 0o30), 0b1000), ehT0Px3KOsy9(chr(0b101001 + 0o7) + '\x6f' + '\064', ord("\x08")), ehT0Px3KOsy9(chr(230 - 182) + chr(0b10101 + 0o132) + chr(1938 - 1887) + chr(0b11101 + 0o26) + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(1225 - 1177) + '\x6f' + '\062' + '\x36' + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + '\067' + chr(0b110110), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\063' + chr(188 - 134) + chr(0b110000), 12655 - 12647), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x31' + chr(2553 - 2501) + chr(1761 - 1713), 8), ehT0Px3KOsy9('\060' + chr(0b1011100 + 0o23) + chr(0b100001 + 0o21) + chr(0b110110) + chr(0b10 + 0o57), 0b1000), ehT0Px3KOsy9(chr(0b1111 + 0o41) + chr(111) + chr(49) + '\x30' + chr(48), 0b1000), ehT0Px3KOsy9(chr(1091 - 1043) + chr(0b1010001 + 0o36) + chr(1161 - 1110) + chr(0b11001 + 0o33) + chr(48), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(1678 - 1628) + chr(54), 17596 - 17588), ehT0Px3KOsy9(chr(0b101001 + 0o7) + chr(0b1011110 + 0o21) + chr(494 - 443) + chr(0b1001 + 0o51) + '\x37', 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(504 - 454) + '\x31' + '\066', ord("\x08")), ehT0Px3KOsy9(chr(197 - 149) + chr(0b1101111) + chr(50) + '\066', 8), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b1100 + 0o47) + chr(49) + chr(716 - 664), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(2441 - 2330) + chr(0b110011) + chr(2259 - 2211) + '\x36', 2779 - 2771), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110001) + chr(0b110111) + '\061', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(49) + chr(0b110000) + '\067', 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(50) + chr(0b110111) + chr(49), 0o10), ehT0Px3KOsy9(chr(1263 - 1215) + chr(0b1100111 + 0o10) + chr(54) + chr(0b110000), 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(52) + chr(0b1101 + 0o51), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b100011 + 0o114) + chr(55) + chr(54), 8), ehT0Px3KOsy9('\060' + '\157' + '\x31' + chr(580 - 531) + chr(1077 - 1027), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\062' + chr(49) + chr(677 - 628), 0o10), ehT0Px3KOsy9(chr(129 - 81) + chr(0b1101111) + chr(0b110010) + chr(0b110011) + '\x36', 0o10), ehT0Px3KOsy9(chr(48) + chr(3756 - 3645) + '\062' + chr(1890 - 1842) + '\x30', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(12058 - 11947) + chr(0b111 + 0o54) + chr(48) + chr(48), 0b1000), ehT0Px3KOsy9('\060' + chr(8806 - 8695) + '\x31' + chr(1076 - 1023) + chr(0b1111 + 0o44), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(9909 - 9798) + chr(130 - 81) + '\064' + '\063', 0b1000), ehT0Px3KOsy9(chr(2216 - 2168) + chr(0b1101001 + 0o6) + chr(0b111 + 0o54) + chr(49) + chr(0b110101), ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9(chr(1908 - 1860) + chr(0b1101111) + '\065' + chr(0b110000), ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'J'), chr(100) + chr(0b111110 + 0o47) + chr(0b1001100 + 0o27) + '\x6f' + chr(0b1100100) + '\x65')(chr(13403 - 13286) + '\164' + chr(0b11 + 0o143) + chr(0b100100 + 0o11) + chr(56)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def SwW3yN2bHm0G(oVre8I6UXc3b, _Wv4RRy2aVmP, ENas6b3HzFya, LWkuqV72y7LV, IKTrMTySqz10):
del _Wv4RRy2aVmP
return (None, ENas6b3HzFya, LWkuqV72y7LV, IKTrMTySqz10)
|
tensorflow/tensor2tensor
|
tensor2tensor/layers/transformer_memory.py
|
RecentTokensMemory.pre_attention
|
def pre_attention(self, segment, query_antecedent, memory_antecedent, bias):
"""Called prior to self-attention, to incorporate memory items.
Args:
segment: an integer Tensor with shape [batch]
query_antecedent: a Tensor with shape [batch, length_q, channels]
memory_antecedent: must be None. Attention normally allows this to be a
Tensor with shape [batch, length_m, channels], but we currently only
support memory for decoder-side self-attention.
bias: bias Tensor (see attention_bias())
Returns:
(data, new_query_antecedent, new_memory_antecedent, new_bias)
"""
assert memory_antecedent is None, "We only support language modeling"
# In eval mode, batch size may be variable
memory_batch_size = tf.shape(self.previous_vals)[0]
current_batch_size = tf.shape(query_antecedent)[0]
amount_to_pad = memory_batch_size - current_batch_size
# If segment id is zero, don't attend back to the memory
previous_bias = self.previous_bias[:current_batch_size, :, :, :] + tf.cast(
tf.equal(segment[:, None, None, None], 0), tf.float32) * -1e9
sliced_previous_vals = self.previous_vals[:current_batch_size, :, :]
new_memory_antecedent = tf.concat(
[tf.stop_gradient(sliced_previous_vals), query_antecedent], 1)
new_bias = tf.concat([
tf.tile(tf.stop_gradient(previous_bias), [1, 1, self.chunk_length, 1]),
tf.tile(bias, [current_batch_size, 1, 1, 1]),
], -1)
remember_segment = tf.pad(segment, [[0, amount_to_pad]])
# TODO(kitaev): The code assumes that we always either increment the chunk
# number or reset it to zero. This assumption will not hold if we re-run the
# model for each token, e.g. for autoregressive greedy/beam/sampling decode.
remember_vals = tf.pad(query_antecedent,
[[0, amount_to_pad], [0, 0], [0, 0]])
# Query position is on axis -2 for bias: as long as a token can be attended
# to from at least one query position (i.e. it's not padding), memorize it.
remember_bias = tf.tile(
tf.reduce_max(bias, -2, keepdims=True), [memory_batch_size, 1, 1, 1])
# Assume that query_antecedent is always a full chunk (i.e. not truncated)
if self.chunk_length < self.tokens_to_cache:
remember_vals = tf.concat([self.previous_vals, remember_vals], 1)
remember_bias = tf.concat([
self.previous_bias - 1e9 * tf.cast(
tf.equal(
tf.pad(segment, [[0, amount_to_pad]])[:, None, None, None],
0), tf.float32),
remember_bias
], -1)
if self.chunk_length != self.tokens_to_cache:
remember_vals = remember_vals[:, -self.tokens_to_cache:, :]
remember_bias = remember_bias[:, :, :, -self.tokens_to_cache:]
token = (remember_segment, remember_vals, remember_bias)
return token, query_antecedent, new_memory_antecedent, new_bias
|
python
|
def pre_attention(self, segment, query_antecedent, memory_antecedent, bias):
"""Called prior to self-attention, to incorporate memory items.
Args:
segment: an integer Tensor with shape [batch]
query_antecedent: a Tensor with shape [batch, length_q, channels]
memory_antecedent: must be None. Attention normally allows this to be a
Tensor with shape [batch, length_m, channels], but we currently only
support memory for decoder-side self-attention.
bias: bias Tensor (see attention_bias())
Returns:
(data, new_query_antecedent, new_memory_antecedent, new_bias)
"""
assert memory_antecedent is None, "We only support language modeling"
# In eval mode, batch size may be variable
memory_batch_size = tf.shape(self.previous_vals)[0]
current_batch_size = tf.shape(query_antecedent)[0]
amount_to_pad = memory_batch_size - current_batch_size
# If segment id is zero, don't attend back to the memory
previous_bias = self.previous_bias[:current_batch_size, :, :, :] + tf.cast(
tf.equal(segment[:, None, None, None], 0), tf.float32) * -1e9
sliced_previous_vals = self.previous_vals[:current_batch_size, :, :]
new_memory_antecedent = tf.concat(
[tf.stop_gradient(sliced_previous_vals), query_antecedent], 1)
new_bias = tf.concat([
tf.tile(tf.stop_gradient(previous_bias), [1, 1, self.chunk_length, 1]),
tf.tile(bias, [current_batch_size, 1, 1, 1]),
], -1)
remember_segment = tf.pad(segment, [[0, amount_to_pad]])
# TODO(kitaev): The code assumes that we always either increment the chunk
# number or reset it to zero. This assumption will not hold if we re-run the
# model for each token, e.g. for autoregressive greedy/beam/sampling decode.
remember_vals = tf.pad(query_antecedent,
[[0, amount_to_pad], [0, 0], [0, 0]])
# Query position is on axis -2 for bias: as long as a token can be attended
# to from at least one query position (i.e. it's not padding), memorize it.
remember_bias = tf.tile(
tf.reduce_max(bias, -2, keepdims=True), [memory_batch_size, 1, 1, 1])
# Assume that query_antecedent is always a full chunk (i.e. not truncated)
if self.chunk_length < self.tokens_to_cache:
remember_vals = tf.concat([self.previous_vals, remember_vals], 1)
remember_bias = tf.concat([
self.previous_bias - 1e9 * tf.cast(
tf.equal(
tf.pad(segment, [[0, amount_to_pad]])[:, None, None, None],
0), tf.float32),
remember_bias
], -1)
if self.chunk_length != self.tokens_to_cache:
remember_vals = remember_vals[:, -self.tokens_to_cache:, :]
remember_bias = remember_bias[:, :, :, -self.tokens_to_cache:]
token = (remember_segment, remember_vals, remember_bias)
return token, query_antecedent, new_memory_antecedent, new_bias
|
[
"def",
"pre_attention",
"(",
"self",
",",
"segment",
",",
"query_antecedent",
",",
"memory_antecedent",
",",
"bias",
")",
":",
"assert",
"memory_antecedent",
"is",
"None",
",",
"\"We only support language modeling\"",
"# In eval mode, batch size may be variable",
"memory_batch_size",
"=",
"tf",
".",
"shape",
"(",
"self",
".",
"previous_vals",
")",
"[",
"0",
"]",
"current_batch_size",
"=",
"tf",
".",
"shape",
"(",
"query_antecedent",
")",
"[",
"0",
"]",
"amount_to_pad",
"=",
"memory_batch_size",
"-",
"current_batch_size",
"# If segment id is zero, don't attend back to the memory",
"previous_bias",
"=",
"self",
".",
"previous_bias",
"[",
":",
"current_batch_size",
",",
":",
",",
":",
",",
":",
"]",
"+",
"tf",
".",
"cast",
"(",
"tf",
".",
"equal",
"(",
"segment",
"[",
":",
",",
"None",
",",
"None",
",",
"None",
"]",
",",
"0",
")",
",",
"tf",
".",
"float32",
")",
"*",
"-",
"1e9",
"sliced_previous_vals",
"=",
"self",
".",
"previous_vals",
"[",
":",
"current_batch_size",
",",
":",
",",
":",
"]",
"new_memory_antecedent",
"=",
"tf",
".",
"concat",
"(",
"[",
"tf",
".",
"stop_gradient",
"(",
"sliced_previous_vals",
")",
",",
"query_antecedent",
"]",
",",
"1",
")",
"new_bias",
"=",
"tf",
".",
"concat",
"(",
"[",
"tf",
".",
"tile",
"(",
"tf",
".",
"stop_gradient",
"(",
"previous_bias",
")",
",",
"[",
"1",
",",
"1",
",",
"self",
".",
"chunk_length",
",",
"1",
"]",
")",
",",
"tf",
".",
"tile",
"(",
"bias",
",",
"[",
"current_batch_size",
",",
"1",
",",
"1",
",",
"1",
"]",
")",
",",
"]",
",",
"-",
"1",
")",
"remember_segment",
"=",
"tf",
".",
"pad",
"(",
"segment",
",",
"[",
"[",
"0",
",",
"amount_to_pad",
"]",
"]",
")",
"# TODO(kitaev): The code assumes that we always either increment the chunk",
"# number or reset it to zero. This assumption will not hold if we re-run the",
"# model for each token, e.g. for autoregressive greedy/beam/sampling decode.",
"remember_vals",
"=",
"tf",
".",
"pad",
"(",
"query_antecedent",
",",
"[",
"[",
"0",
",",
"amount_to_pad",
"]",
",",
"[",
"0",
",",
"0",
"]",
",",
"[",
"0",
",",
"0",
"]",
"]",
")",
"# Query position is on axis -2 for bias: as long as a token can be attended",
"# to from at least one query position (i.e. it's not padding), memorize it.",
"remember_bias",
"=",
"tf",
".",
"tile",
"(",
"tf",
".",
"reduce_max",
"(",
"bias",
",",
"-",
"2",
",",
"keepdims",
"=",
"True",
")",
",",
"[",
"memory_batch_size",
",",
"1",
",",
"1",
",",
"1",
"]",
")",
"# Assume that query_antecedent is always a full chunk (i.e. not truncated)",
"if",
"self",
".",
"chunk_length",
"<",
"self",
".",
"tokens_to_cache",
":",
"remember_vals",
"=",
"tf",
".",
"concat",
"(",
"[",
"self",
".",
"previous_vals",
",",
"remember_vals",
"]",
",",
"1",
")",
"remember_bias",
"=",
"tf",
".",
"concat",
"(",
"[",
"self",
".",
"previous_bias",
"-",
"1e9",
"*",
"tf",
".",
"cast",
"(",
"tf",
".",
"equal",
"(",
"tf",
".",
"pad",
"(",
"segment",
",",
"[",
"[",
"0",
",",
"amount_to_pad",
"]",
"]",
")",
"[",
":",
",",
"None",
",",
"None",
",",
"None",
"]",
",",
"0",
")",
",",
"tf",
".",
"float32",
")",
",",
"remember_bias",
"]",
",",
"-",
"1",
")",
"if",
"self",
".",
"chunk_length",
"!=",
"self",
".",
"tokens_to_cache",
":",
"remember_vals",
"=",
"remember_vals",
"[",
":",
",",
"-",
"self",
".",
"tokens_to_cache",
":",
",",
":",
"]",
"remember_bias",
"=",
"remember_bias",
"[",
":",
",",
":",
",",
":",
",",
"-",
"self",
".",
"tokens_to_cache",
":",
"]",
"token",
"=",
"(",
"remember_segment",
",",
"remember_vals",
",",
"remember_bias",
")",
"return",
"token",
",",
"query_antecedent",
",",
"new_memory_antecedent",
",",
"new_bias"
] |
Called prior to self-attention, to incorporate memory items.
Args:
segment: an integer Tensor with shape [batch]
query_antecedent: a Tensor with shape [batch, length_q, channels]
memory_antecedent: must be None. Attention normally allows this to be a
Tensor with shape [batch, length_m, channels], but we currently only
support memory for decoder-side self-attention.
bias: bias Tensor (see attention_bias())
Returns:
(data, new_query_antecedent, new_memory_antecedent, new_bias)
|
[
"Called",
"prior",
"to",
"self",
"-",
"attention",
"to",
"incorporate",
"memory",
"items",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/layers/transformer_memory.py#L110-L168
|
train
|
Called before self - attention to incorporate memory items.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYn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Nds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\063' + chr(0b110001) + '\067', 8128 - 8120), ehT0Px3KOsy9(chr(0b10 + 0o56) + chr(0b1101111) + '\x33' + '\060' + '\060', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(5733 - 5622) + '\x32' + chr(656 - 605) + chr(49), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(50) + chr(49), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110010) + '\x37' + '\064', 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(2591 - 2540) + '\067' + '\x31', 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(51) + '\x30' + chr(52), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(883 - 832) + '\062' + '\064', ord("\x08")), ehT0Px3KOsy9(chr(0b10111 + 0o31) + '\157' + '\x33' + chr(0b1001 + 0o51) + '\x37', ord("\x08")), ehT0Px3KOsy9(chr(0b100101 + 0o13) + chr(0b1100010 + 0o15) + chr(1875 - 1820) + chr(0b110110), 0b1000), ehT0Px3KOsy9(chr(1285 - 1237) + chr(10205 - 10094) + chr(0b110010 + 0o1) + chr(0b110100) + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b11010 + 0o30) + chr(0b11 + 0o64) + chr(1461 - 1411), ord("\x08")), ehT0Px3KOsy9(chr(1868 - 1820) + chr(0b1101111) + chr(1850 - 1800) + '\x30' + chr(0b111 + 0o52), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + '\066' + chr(0b101111 + 0o1), 0b1000), ehT0Px3KOsy9(chr(1723 - 1675) + chr(0b100010 + 0o115) + '\062' + chr(0b110000) + chr(50), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x31' + '\061' + chr(1869 - 1816), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(7735 - 7624) + '\063' + chr(0b110111) + chr(1915 - 1866), 8), ehT0Px3KOsy9(chr(0b10101 + 0o33) + '\157' + '\061' + '\066' + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(50) + chr(55) + '\065', 16761 - 16753), ehT0Px3KOsy9(chr(48) + chr(111) + chr(1203 - 1153) + '\x31' + '\x37', 0o10), ehT0Px3KOsy9(chr(2109 - 2061) + chr(0b1101111) + chr(0b110010) + chr(2438 - 2388) + chr(0b110 + 0o53), 0o10), ehT0Px3KOsy9('\060' + '\157' + '\062' + chr(0b110011 + 0o3) + '\x36', 46534 - 46526), ehT0Px3KOsy9(chr(87 - 39) + '\x6f' + chr(523 - 472) + chr(0b110110) + chr(2233 - 2180), 17162 - 17154), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110011), 3832 - 3824), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\063' + chr(49) + chr(0b100100 + 0o14), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110001) + chr(0b1 + 0o65), 62618 - 62610), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110001) + chr(1468 - 1420) + chr(0b10101 + 0o42), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1011000 + 0o27) + chr(0b110010) + chr(797 - 747) + '\x33', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(3434 - 3323) + '\063' + chr(52), 0b1000), ehT0Px3KOsy9(chr(0b101101 + 0o3) + '\157' + chr(0b100 + 0o57) + '\x35' + '\066', 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x33' + '\x31' + chr(0b110100), 0b1000), ehT0Px3KOsy9(chr(1227 - 1179) + chr(111) + '\061' + '\x31' + chr(51), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(50) + '\060' + '\x31', 8), ehT0Px3KOsy9(chr(1116 - 1068) + chr(0b1101111) + chr(50) + '\x36' + chr(54), 8), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b11011 + 0o27) + chr(0b110001) + chr(0b100100 + 0o15), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110001) + chr(54) + chr(0b101001 + 0o13), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(55) + '\x35', ord("\x08")), ehT0Px3KOsy9(chr(0b101000 + 0o10) + chr(0b110111 + 0o70) + '\062' + chr(54) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(0b11100 + 0o24) + chr(0b1101111) + '\x31' + '\067' + '\065', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x31' + chr(53) + '\x32', 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(1980 - 1932) + '\157' + chr(0b110101) + chr(0b1100 + 0o44), 39819 - 39811)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xe1'), chr(6126 - 6026) + chr(0b1100101) + chr(99) + '\x6f' + chr(100) + chr(0b1100101))(chr(6586 - 6469) + '\x74' + '\146' + chr(45) + '\x38') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def SwW3yN2bHm0G(oVre8I6UXc3b, _Wv4RRy2aVmP, ENas6b3HzFya, LWkuqV72y7LV, IKTrMTySqz10):
assert LWkuqV72y7LV is None, xafqLlk3kkUe(SXOLrMavuUCe(b'\x98\xa5\xb9~\xd2\x95\xbd\xf4\xa4K\x94\xca\xeeB\xf6m\x95\x14\xd3\xe8\xe4\xd7\x92f\xe8c(\xf7y\x82\xa5%\xe6'), chr(0b1100100) + chr(4356 - 4255) + '\143' + chr(111) + chr(7430 - 7330) + '\x65')('\165' + chr(116) + '\146' + chr(750 - 705) + chr(1375 - 1319))
K_L0FRH8Y7CJ = IDJ2eXGCBCDu.nauYfLglTpcb(oVre8I6UXc3b.previous_vals)[ehT0Px3KOsy9(chr(48) + chr(111) + chr(48), 0b1000)]
nhkDq0SZ8nAX = IDJ2eXGCBCDu.nauYfLglTpcb(ENas6b3HzFya)[ehT0Px3KOsy9(chr(790 - 742) + chr(111) + chr(0b100011 + 0o15), 8)]
lT64AIgd5eVB = K_L0FRH8Y7CJ - nhkDq0SZ8nAX
YOQ0coEoQPWg = oVre8I6UXc3b.previous_bias[:nhkDq0SZ8nAX, :, :, :] + IDJ2eXGCBCDu.cast(IDJ2eXGCBCDu.equal(_Wv4RRy2aVmP[:, None, None, None], ehT0Px3KOsy9(chr(2214 - 2166) + chr(0b1101111) + chr(48), 8)), IDJ2eXGCBCDu.float32) * -1000000000.0
sTqCTC9xIvBy = oVre8I6UXc3b.previous_vals[:nhkDq0SZ8nAX, :, :]
TiruAkHMgD0n = IDJ2eXGCBCDu.concat([IDJ2eXGCBCDu.stop_gradient(sTqCTC9xIvBy), ENas6b3HzFya], ehT0Px3KOsy9(chr(0b100 + 0o54) + chr(0b110111 + 0o70) + chr(49), 0b1000))
V31qO69Kbzqt = IDJ2eXGCBCDu.concat([IDJ2eXGCBCDu.tile(IDJ2eXGCBCDu.stop_gradient(YOQ0coEoQPWg), [ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\061', 8), ehT0Px3KOsy9(chr(48) + chr(0b1100110 + 0o11) + chr(0b110001), 8), oVre8I6UXc3b.chunk_length, ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110001), 8)]), IDJ2eXGCBCDu.tile(IKTrMTySqz10, [nhkDq0SZ8nAX, ehT0Px3KOsy9(chr(874 - 826) + chr(7211 - 7100) + '\061', 8), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(49), 8), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110001), 8)])], -ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x31', 8))
H06OeAxtsKVT = IDJ2eXGCBCDu.pad(_Wv4RRy2aVmP, [[ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(631 - 583), 8), lT64AIgd5eVB]])
Bt3u04rJVLxU = IDJ2eXGCBCDu.pad(ENas6b3HzFya, [[ehT0Px3KOsy9('\x30' + '\157' + chr(707 - 659), 8), lT64AIgd5eVB], [ehT0Px3KOsy9(chr(331 - 283) + chr(0b10111 + 0o130) + chr(0b110000), 8), ehT0Px3KOsy9('\060' + '\x6f' + chr(1839 - 1791), 8)], [ehT0Px3KOsy9(chr(0b11001 + 0o27) + chr(11290 - 11179) + chr(0b1101 + 0o43), 8), ehT0Px3KOsy9(chr(0b100111 + 0o11) + '\x6f' + chr(0b100010 + 0o16), 8)]])
c0bpN0vXdo6r = IDJ2eXGCBCDu.tile(IDJ2eXGCBCDu.reduce_max(IKTrMTySqz10, -ehT0Px3KOsy9(chr(1780 - 1732) + chr(0b1101111) + chr(50), 0b1000), keepdims=ehT0Px3KOsy9('\060' + '\157' + chr(49), 8)), [K_L0FRH8Y7CJ, ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x31', 8), ehT0Px3KOsy9(chr(0b101111 + 0o1) + chr(0b1101111) + chr(0b110001), 8), ehT0Px3KOsy9(chr(0b101001 + 0o7) + '\x6f' + '\061', 8)])
if xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xac\xa8\xec\x7f\xd7\xa6\xa8\xb1\xb9Y\x90\xd2'), '\x64' + chr(0b111 + 0o136) + chr(99) + chr(0b1101010 + 0o5) + '\x64' + chr(0b1001100 + 0o31))('\x75' + chr(0b1110100) + chr(0b1100110) + '\055' + '\070')) < xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xbb\xaf\xf2t\xd2\x8a\x9b\xa0\xb8a\x87\xdb\xe2X\xe7'), chr(0b1000110 + 0o36) + chr(101) + chr(0b100101 + 0o76) + '\157' + '\x64' + chr(0b1100101))('\165' + chr(7201 - 7085) + chr(0b1100110) + chr(0b10110 + 0o27) + chr(0b111000))):
Bt3u04rJVLxU = IDJ2eXGCBCDu.concat([oVre8I6UXc3b.previous_vals, Bt3u04rJVLxU], ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b10101 + 0o34), 8))
c0bpN0vXdo6r = IDJ2eXGCBCDu.concat([oVre8I6UXc3b.previous_bias - 1000000000.0 * IDJ2eXGCBCDu.cast(IDJ2eXGCBCDu.equal(IDJ2eXGCBCDu.pad(_Wv4RRy2aVmP, [[ehT0Px3KOsy9(chr(0b1011 + 0o45) + '\157' + chr(0b110000 + 0o0), 8), lT64AIgd5eVB]])[:, None, None, None], ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(2036 - 1988), 8)), IDJ2eXGCBCDu.float32), c0bpN0vXdo6r], -ehT0Px3KOsy9('\x30' + '\157' + '\061', 8))
if xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xac\xa8\xec\x7f\xd7\xa6\xa8\xb1\xb9Y\x90\xd2'), chr(0b110010 + 0o62) + '\x65' + chr(99) + chr(12141 - 12030) + chr(100) + chr(0b1100101))('\165' + '\x74' + '\146' + chr(0b101010 + 0o3) + chr(124 - 68))) != xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xbb\xaf\xf2t\xd2\x8a\x9b\xa0\xb8a\x87\xdb\xe2X\xe7'), '\x64' + chr(101) + '\x63' + chr(111) + '\144' + chr(0b1010100 + 0o21))(chr(0b1110101) + chr(0b1110100 + 0o0) + chr(0b11000 + 0o116) + chr(0b1010 + 0o43) + chr(2072 - 2016))):
Bt3u04rJVLxU = Bt3u04rJVLxU[:, -oVre8I6UXc3b.tokens_to_cache:, :]
c0bpN0vXdo6r = c0bpN0vXdo6r[:, :, :, -oVre8I6UXc3b.tokens_to_cache:]
mTy3fac_AqJ5 = (H06OeAxtsKVT, Bt3u04rJVLxU, c0bpN0vXdo6r)
return (mTy3fac_AqJ5, ENas6b3HzFya, TiruAkHMgD0n, V31qO69Kbzqt)
|
tensorflow/tensor2tensor
|
tensor2tensor/layers/transformer_memory.py
|
RecentTokensMemory.post_attention
|
def post_attention(self, token, x):
"""Called after self-attention. The memory can be updated here.
Args:
token: Data returned by pre_attention, which can be used to carry over
state related to the current memory operation.
x: a Tensor of data after self-attention and feed-forward
Returns:
a (possibly modified) version of the input x
"""
with tf.control_dependencies([
self.previous_segment.assign(token[0]),
self.previous_vals.assign(token[1]),
self.previous_bias.assign(token[2]),
]):
return tf.identity(x)
|
python
|
def post_attention(self, token, x):
"""Called after self-attention. The memory can be updated here.
Args:
token: Data returned by pre_attention, which can be used to carry over
state related to the current memory operation.
x: a Tensor of data after self-attention and feed-forward
Returns:
a (possibly modified) version of the input x
"""
with tf.control_dependencies([
self.previous_segment.assign(token[0]),
self.previous_vals.assign(token[1]),
self.previous_bias.assign(token[2]),
]):
return tf.identity(x)
|
[
"def",
"post_attention",
"(",
"self",
",",
"token",
",",
"x",
")",
":",
"with",
"tf",
".",
"control_dependencies",
"(",
"[",
"self",
".",
"previous_segment",
".",
"assign",
"(",
"token",
"[",
"0",
"]",
")",
",",
"self",
".",
"previous_vals",
".",
"assign",
"(",
"token",
"[",
"1",
"]",
")",
",",
"self",
".",
"previous_bias",
".",
"assign",
"(",
"token",
"[",
"2",
"]",
")",
",",
"]",
")",
":",
"return",
"tf",
".",
"identity",
"(",
"x",
")"
] |
Called after self-attention. The memory can be updated here.
Args:
token: Data returned by pre_attention, which can be used to carry over
state related to the current memory operation.
x: a Tensor of data after self-attention and feed-forward
Returns:
a (possibly modified) version of the input x
|
[
"Called",
"after",
"self",
"-",
"attention",
".",
"The",
"memory",
"can",
"be",
"updated",
"here",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/layers/transformer_memory.py#L170-L185
|
train
|
Called after self - attention.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw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DU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + chr(0b1100 + 0o143) + chr(49) + chr(0b101 + 0o54) + chr(2267 - 2215), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(51) + chr(1879 - 1828) + chr(0b101000 + 0o13), 0b1000), ehT0Px3KOsy9('\x30' + chr(3633 - 3522) + chr(50) + '\064' + chr(0b11 + 0o55), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(50) + chr(1013 - 962), 52143 - 52135), ehT0Px3KOsy9(chr(1657 - 1609) + '\157' + chr(689 - 640) + '\067' + chr(1181 - 1127), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(51) + chr(52) + chr(0b11 + 0o56), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110010) + chr(0b110000) + chr(130 - 78), 39128 - 39120), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x31' + chr(2537 - 2485) + chr(50), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + '\062' + '\061' + chr(54), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(2173 - 2123) + '\065' + chr(150 - 100), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101000 + 0o7) + chr(0b110001 + 0o1) + chr(53) + chr(0b110110), 0o10), ehT0Px3KOsy9(chr(0b10100 + 0o34) + chr(111) + '\x33' + '\x35' + '\x33', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1 + 0o156) + chr(49) + chr(0b110000) + chr(1760 - 1706), 0b1000), ehT0Px3KOsy9(chr(0b10000 + 0o40) + chr(3012 - 2901) + '\x36' + '\065', 0o10), ehT0Px3KOsy9(chr(0b1001 + 0o47) + '\x6f' + '\062' + chr(2324 - 2270) + chr(1279 - 1229), 7302 - 7294), ehT0Px3KOsy9('\060' + '\x6f' + chr(50) + chr(1082 - 1029) + chr(0b110 + 0o60), 8), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\062' + '\061' + chr(53), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(1018 - 968) + chr(55), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b11011 + 0o124) + chr(50) + chr(55) + '\x30', ord("\x08")), ehT0Px3KOsy9(chr(0b101 + 0o53) + chr(11001 - 10890) + chr(0b110100) + chr(54), ord("\x08")), ehT0Px3KOsy9(chr(0b11000 + 0o30) + '\157' + chr(0b110010) + chr(0b0 + 0o66) + '\062', 8), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110010) + chr(315 - 265) + '\x31', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\064' + chr(1738 - 1685), 0o10), ehT0Px3KOsy9('\x30' + chr(7890 - 7779) + chr(2297 - 2247) + '\x30' + '\x31', 0o10), ehT0Px3KOsy9(chr(937 - 889) + '\157' + '\x35' + chr(48), 0b1000), ehT0Px3KOsy9(chr(473 - 425) + chr(0b101011 + 0o104) + '\063' + chr(52) + chr(54), ord("\x08")), ehT0Px3KOsy9(chr(1860 - 1812) + chr(4466 - 4355) + chr(0b110001) + chr(49), 31465 - 31457), ehT0Px3KOsy9(chr(48) + chr(9388 - 9277) + chr(0b110010) + '\066' + '\x33', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\061' + chr(0b101 + 0o61), 31211 - 31203), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b100011 + 0o16) + '\064' + chr(0b110000), 47752 - 47744), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b10000 + 0o43) + chr(0b110111) + chr(0b10011 + 0o36), 0b1000), ehT0Px3KOsy9('\060' + chr(5941 - 5830) + '\x33' + '\064' + chr(0b110100), 0o10), ehT0Px3KOsy9('\060' + chr(0b100101 + 0o112) + '\x32' + '\x37' + chr(0b101110 + 0o3), 0b1000), ehT0Px3KOsy9(chr(1872 - 1824) + '\x6f' + chr(51) + chr(0b110000) + chr(0b110000), 0o10), ehT0Px3KOsy9(chr(0b101010 + 0o6) + chr(6843 - 6732) + '\061' + chr(0b110011) + '\x32', 0b1000), ehT0Px3KOsy9(chr(1445 - 1397) + chr(111) + '\062' + chr(0b11011 + 0o32) + '\060', 12431 - 12423), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x32' + chr(2029 - 1981) + chr(490 - 440), 4732 - 4724), ehT0Px3KOsy9('\060' + '\157' + chr(49) + chr(48) + '\060', 0o10), ehT0Px3KOsy9('\x30' + chr(0b1000101 + 0o52) + chr(0b110010) + chr(2016 - 1962) + chr(0b10101 + 0o34), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(49) + chr(0b1101 + 0o52) + chr(55), ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x35' + '\060', 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'b'), chr(0b1001 + 0o133) + '\145' + chr(99) + chr(9070 - 8959) + chr(0b1 + 0o143) + chr(8135 - 8034))(chr(117) + '\x74' + chr(0b1100110) + chr(0b1101 + 0o40) + chr(56)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def xu4zPfypsGAE(oVre8I6UXc3b, mTy3fac_AqJ5, OeWW0F1dBPRQ):
with xafqLlk3kkUe(IDJ2eXGCBCDu, xafqLlk3kkUe(SXOLrMavuUCe(b'/\xb4\xceg\x0c\x8e\xe8=\xea\xcf\xde\x8e(Q\xd7\xc0\xee~\xddU'), '\x64' + chr(1943 - 1842) + '\x63' + chr(111) + '\144' + '\x65')('\x75' + chr(0b1110100) + chr(9230 - 9128) + '\055' + '\070'))([xafqLlk3kkUe(oVre8I6UXc3b.previous_segment, xafqLlk3kkUe(SXOLrMavuUCe(b'-\xa8\xd3z\x19\x8f'), chr(100) + '\x65' + '\143' + chr(0b1100 + 0o143) + chr(0b111101 + 0o47) + '\145')('\165' + chr(0b1110100) + '\x66' + chr(0b101101) + chr(0b111000)))(mTy3fac_AqJ5[ehT0Px3KOsy9(chr(48) + '\157' + chr(337 - 289), 0o10)]), xafqLlk3kkUe(oVre8I6UXc3b.previous_vals, xafqLlk3kkUe(SXOLrMavuUCe(b'-\xa8\xd3z\x19\x8f'), '\144' + chr(5839 - 5738) + chr(2981 - 2882) + chr(111) + chr(0b101110 + 0o66) + chr(0b1100101))(chr(0b1110101) + chr(116) + chr(102) + chr(0b101101) + chr(1384 - 1328)))(mTy3fac_AqJ5[ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b101001 + 0o10), 0o10)]), xafqLlk3kkUe(oVre8I6UXc3b.previous_bias, xafqLlk3kkUe(SXOLrMavuUCe(b'-\xa8\xd3z\x19\x8f'), '\144' + chr(0b1100101) + chr(0b100000 + 0o103) + chr(111) + chr(8469 - 8369) + '\145')(chr(117) + chr(5698 - 5582) + '\x66' + '\x2d' + '\x38'))(mTy3fac_AqJ5[ehT0Px3KOsy9(chr(0b100110 + 0o12) + chr(4141 - 4030) + chr(0b110010), 0o10)])]):
return xafqLlk3kkUe(IDJ2eXGCBCDu, xafqLlk3kkUe(SXOLrMavuUCe(b':\x9d\xf5TK\x8c\xcf:\xed\xdc\xf7\xac'), chr(100) + chr(0b1100101) + chr(99) + chr(4855 - 4744) + chr(100) + chr(0b1100101))('\x75' + chr(0b1110100) + chr(0b11110 + 0o110) + chr(0b10100 + 0o31) + chr(0b111000)))(OeWW0F1dBPRQ)
|
tensorflow/tensor2tensor
|
tensor2tensor/layers/transformer_memory.py
|
TransformerMemory._norm
|
def _norm(self, x):
"""Compute the safe norm."""
return tf.sqrt(tf.reduce_sum(tf.square(x), keepdims=True, axis=-1) + 1e-7)
|
python
|
def _norm(self, x):
"""Compute the safe norm."""
return tf.sqrt(tf.reduce_sum(tf.square(x), keepdims=True, axis=-1) + 1e-7)
|
[
"def",
"_norm",
"(",
"self",
",",
"x",
")",
":",
"return",
"tf",
".",
"sqrt",
"(",
"tf",
".",
"reduce_sum",
"(",
"tf",
".",
"square",
"(",
"x",
")",
",",
"keepdims",
"=",
"True",
",",
"axis",
"=",
"-",
"1",
")",
"+",
"1e-7",
")"
] |
Compute the safe norm.
|
[
"Compute",
"the",
"safe",
"norm",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/layers/transformer_memory.py#L226-L228
|
train
|
Compute the safe norm.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAY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g0Vq,YlkZvXL8qwsX,MCqssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(50) + '\x31' + '\x31', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x37' + chr(2954 - 2899), 0b1000), ehT0Px3KOsy9(chr(48) + chr(3408 - 3297) + '\062' + chr(615 - 560) + '\x37', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(9487 - 9376) + chr(0b110000 + 0o1) + '\x33' + chr(0b10010 + 0o43), ord("\x08")), ehT0Px3KOsy9(chr(0b10111 + 0o31) + '\x6f' + '\063' + chr(0b110011) + chr(429 - 376), 0o10), ehT0Px3KOsy9('\060' + '\157' + '\062' + '\066' + chr(49), 39293 - 39285), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\061' + chr(1642 - 1593) + '\067', ord("\x08")), ehT0Px3KOsy9(chr(0b11001 + 0o27) + chr(0b1001101 + 0o42) + chr(0b1000 + 0o53) + chr(49) + '\061', 0b1000), ehT0Px3KOsy9(chr(0b101101 + 0o3) + chr(111) + '\x37' + '\065', 15258 - 15250), ehT0Px3KOsy9(chr(1387 - 1339) + chr(0b0 + 0o157) + chr(50) + chr(54) + '\x32', 0b1000), ehT0Px3KOsy9(chr(0b10010 + 0o36) + chr(0b11101 + 0o122) + '\x35' + '\x30', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110011) + chr(48) + chr(0b100100 + 0o17), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(54) + chr(328 - 274), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(1190 - 1079) + '\062' + chr(0b100111 + 0o15) + chr(0b110100), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + '\063' + '\x30' + chr(0b110001), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b101110 + 0o5) + '\065' + chr(769 - 716), 0o10), ehT0Px3KOsy9(chr(364 - 316) + chr(111) + chr(55) + chr(572 - 522), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\061' + '\061' + '\x31', 33460 - 33452), ehT0Px3KOsy9(chr(48) + chr(0b111100 + 0o63) + chr(0b110001) + chr(0b110111) + chr(54), ord("\x08")), ehT0Px3KOsy9(chr(0b10001 + 0o37) + chr(0b110111 + 0o70) + chr(2202 - 2153) + chr(0b110010) + '\x34', 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + '\061' + chr(0b11110 + 0o30) + '\x30', 0b1000), ehT0Px3KOsy9(chr(0b11101 + 0o23) + '\157' + '\x37' + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110010) + '\061', ord("\x08")), ehT0Px3KOsy9(chr(0b11110 + 0o22) + '\x6f' + '\x33' + '\066' + chr(179 - 127), ord("\x08")), ehT0Px3KOsy9(chr(0b1000 + 0o50) + '\x6f' + chr(49) + chr(54) + chr(0b110100), 0b1000), ehT0Px3KOsy9(chr(996 - 948) + '\x6f' + chr(99 - 49) + '\063' + chr(347 - 296), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(54) + chr(55), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b101011 + 0o6) + '\062' + chr(0b11001 + 0o34), ord("\x08")), ehT0Px3KOsy9('\060' + chr(5376 - 5265) + chr(686 - 635) + chr(0b110001) + chr(0b110001), 8), ehT0Px3KOsy9(chr(858 - 810) + chr(111) + chr(0b101010 + 0o11) + chr(971 - 922) + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(0b100010 + 0o16) + chr(0b1101111) + chr(0b10001 + 0o41) + chr(0b101101 + 0o4) + chr(1817 - 1764), 31437 - 31429), ehT0Px3KOsy9(chr(0b1110 + 0o42) + '\x6f' + '\061' + chr(0b10000 + 0o40) + '\062', ord("\x08")), ehT0Px3KOsy9(chr(401 - 353) + chr(1961 - 1850) + chr(1444 - 1393) + chr(0b110110) + chr(0b11110 + 0o25), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + '\x32' + chr(0b110110) + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(0b10110 + 0o32) + chr(0b1010100 + 0o33) + chr(0b110001), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(10704 - 10593) + '\062' + chr(54) + chr(49), 8), ehT0Px3KOsy9('\060' + '\157' + '\x31' + '\x32', 21833 - 21825), ehT0Px3KOsy9(chr(0b110000) + chr(5652 - 5541) + chr(0b100101 + 0o16) + chr(51) + chr(48), 52401 - 52393), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(51) + chr(0b100010 + 0o25) + '\066', 0o10), ehT0Px3KOsy9('\x30' + chr(0b1001000 + 0o47) + chr(1862 - 1812) + '\x31' + chr(2709 - 2656), 8)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + chr(111) + '\x35' + chr(48), 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xa7'), chr(0b10100 + 0o120) + '\x65' + '\143' + chr(0b1000100 + 0o53) + chr(1151 - 1051) + chr(101))(chr(6823 - 6706) + '\x74' + chr(0b1100110) + '\055' + chr(2380 - 2324)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def iGZR9wUtTSoR(oVre8I6UXc3b, OeWW0F1dBPRQ):
return xafqLlk3kkUe(IDJ2eXGCBCDu, xafqLlk3kkUe(SXOLrMavuUCe(b'\xfaN\xcd)'), '\x64' + chr(8318 - 8217) + chr(6675 - 6576) + chr(0b1100110 + 0o11) + chr(4841 - 4741) + chr(0b1100101))('\x75' + '\x74' + chr(0b110010 + 0o64) + '\x2d' + chr(0b101000 + 0o20)))(xafqLlk3kkUe(IDJ2eXGCBCDu, xafqLlk3kkUe(SXOLrMavuUCe(b'\xfbZ\xdb(\xbe\xd4\x10\xbaH\xdf'), chr(100) + chr(3323 - 3222) + '\x63' + '\157' + '\x64' + chr(0b1100101))(chr(2598 - 2481) + chr(0b1110100) + chr(0b101001 + 0o75) + '\055' + '\070'))(xafqLlk3kkUe(IDJ2eXGCBCDu, xafqLlk3kkUe(SXOLrMavuUCe(b'\xfaN\xca<\xaf\xd4'), chr(100) + chr(0b1011100 + 0o11) + '\143' + chr(111) + '\144' + chr(0b1100101))(chr(0b100111 + 0o116) + chr(0b1110100) + chr(0b1100110) + '\055' + chr(0b11100 + 0o34)))(OeWW0F1dBPRQ), keepdims=ehT0Px3KOsy9(chr(0b100011 + 0o15) + '\x6f' + '\x31', 8), axis=-ehT0Px3KOsy9(chr(0b101101 + 0o3) + '\157' + chr(0b1 + 0o60), 8)) + 1e-07)
|
tensorflow/tensor2tensor
|
tensor2tensor/layers/transformer_memory.py
|
TransformerMemory._address_content
|
def _address_content(self, x):
"""Address the memory based on content similarity.
Args:
x: a tensor in the shape of [batch_size, length, depth].
Returns:
the logits for each memory entry [batch_size, length, memory_size].
"""
mem_keys = tf.layers.dense(self.mem_vals, self.key_depth,
bias_initializer=tf.constant_initializer(1.0),
name="mem_key")
mem_query = tf.layers.dense(x, self.key_depth,
bias_initializer=tf.constant_initializer(1.0),
name="mem_query")
norm = tf.matmul(self._norm(mem_query), self._norm(mem_keys),
transpose_b=True)
dot_product = tf.matmul(mem_query, mem_keys, transpose_b=True)
cos_dist = tf.div(dot_product, norm + 1e-7, name="cos_dist")
access_logits = self.sharpen_factor * cos_dist
return access_logits
|
python
|
def _address_content(self, x):
"""Address the memory based on content similarity.
Args:
x: a tensor in the shape of [batch_size, length, depth].
Returns:
the logits for each memory entry [batch_size, length, memory_size].
"""
mem_keys = tf.layers.dense(self.mem_vals, self.key_depth,
bias_initializer=tf.constant_initializer(1.0),
name="mem_key")
mem_query = tf.layers.dense(x, self.key_depth,
bias_initializer=tf.constant_initializer(1.0),
name="mem_query")
norm = tf.matmul(self._norm(mem_query), self._norm(mem_keys),
transpose_b=True)
dot_product = tf.matmul(mem_query, mem_keys, transpose_b=True)
cos_dist = tf.div(dot_product, norm + 1e-7, name="cos_dist")
access_logits = self.sharpen_factor * cos_dist
return access_logits
|
[
"def",
"_address_content",
"(",
"self",
",",
"x",
")",
":",
"mem_keys",
"=",
"tf",
".",
"layers",
".",
"dense",
"(",
"self",
".",
"mem_vals",
",",
"self",
".",
"key_depth",
",",
"bias_initializer",
"=",
"tf",
".",
"constant_initializer",
"(",
"1.0",
")",
",",
"name",
"=",
"\"mem_key\"",
")",
"mem_query",
"=",
"tf",
".",
"layers",
".",
"dense",
"(",
"x",
",",
"self",
".",
"key_depth",
",",
"bias_initializer",
"=",
"tf",
".",
"constant_initializer",
"(",
"1.0",
")",
",",
"name",
"=",
"\"mem_query\"",
")",
"norm",
"=",
"tf",
".",
"matmul",
"(",
"self",
".",
"_norm",
"(",
"mem_query",
")",
",",
"self",
".",
"_norm",
"(",
"mem_keys",
")",
",",
"transpose_b",
"=",
"True",
")",
"dot_product",
"=",
"tf",
".",
"matmul",
"(",
"mem_query",
",",
"mem_keys",
",",
"transpose_b",
"=",
"True",
")",
"cos_dist",
"=",
"tf",
".",
"div",
"(",
"dot_product",
",",
"norm",
"+",
"1e-7",
",",
"name",
"=",
"\"cos_dist\"",
")",
"access_logits",
"=",
"self",
".",
"sharpen_factor",
"*",
"cos_dist",
"return",
"access_logits"
] |
Address the memory based on content similarity.
Args:
x: a tensor in the shape of [batch_size, length, depth].
Returns:
the logits for each memory entry [batch_size, length, memory_size].
|
[
"Address",
"the",
"memory",
"based",
"on",
"content",
"similarity",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/layers/transformer_memory.py#L230-L249
|
train
|
Address the memory based on content similarity.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3Qd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aC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\x30' + chr(0b1010111 + 0o30) + chr(2391 - 2342) + chr(0b110011) + chr(51), 0b1000), ehT0Px3KOsy9(chr(0b1110 + 0o42) + chr(0b1000010 + 0o55) + '\061' + chr(0b11001 + 0o30) + '\062', 11494 - 11486), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(1677 - 1626) + chr(0b110101) + chr(0b110011), 29730 - 29722), ehT0Px3KOsy9(chr(0b10000 + 0o40) + '\157' + '\063' + chr(0b110101), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b11100 + 0o25) + chr(55), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(51) + '\x32' + '\x31', 0b1000), ehT0Px3KOsy9(chr(48) + chr(1727 - 1616) + chr(52) + chr(0b11000 + 0o36), ord("\x08")), ehT0Px3KOsy9(chr(1822 - 1774) + chr(0b1101111) + '\x33' + chr(2417 - 2364) + chr(703 - 653), 46434 - 46426), ehT0Px3KOsy9('\x30' + chr(2023 - 1912) + chr(49) + '\x33' + '\067', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + '\x32' + chr(1984 - 1931) + '\065', 0b1000), ehT0Px3KOsy9(chr(0b11100 + 0o24) + chr(11962 - 11851) + chr(55) + chr(48), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + '\061' + '\x32' + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + '\x31' + chr(609 - 555) + chr(0b110000), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110011) + '\x31' + chr(755 - 704), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + '\062' + chr(964 - 914) + chr(1450 - 1401), 0b1000), ehT0Px3KOsy9('\060' + chr(9535 - 9424) + chr(0b1111 + 0o43) + chr(2167 - 2117) + chr(0b110000), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(9245 - 9134) + '\x32' + '\060' + chr(0b1001 + 0o55), 0o10), ehT0Px3KOsy9(chr(0b110000 + 0o0) + chr(0b11001 + 0o126) + '\x31' + chr(0b110001 + 0o3) + chr(2511 - 2459), 0o10), ehT0Px3KOsy9(chr(1842 - 1794) + '\x6f' + '\x32' + '\x35' + '\064', 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(50) + chr(0b110100) + '\061', 0o10), ehT0Px3KOsy9(chr(520 - 472) + chr(0b1000000 + 0o57) + chr(49) + chr(0b110000) + '\x31', 0o10), ehT0Px3KOsy9(chr(0b1011 + 0o45) + chr(9714 - 9603) + chr(0b101110 + 0o6) + chr(0b110000), 40167 - 40159), ehT0Px3KOsy9('\060' + chr(111) + chr(51) + chr(52) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b11101 + 0o122) + chr(49) + chr(1626 - 1573) + chr(0b101101 + 0o11), 59919 - 59911), ehT0Px3KOsy9(chr(0b100111 + 0o11) + chr(0b111110 + 0o61) + chr(0b110100) + chr(0b100100 + 0o17), 13060 - 13052), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b1101 + 0o46) + chr(48) + chr(0b1001 + 0o51), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + '\x31' + chr(0b110100) + '\x33', 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(0b100010 + 0o20) + '\x31' + chr(0b100011 + 0o16), 25863 - 25855), ehT0Px3KOsy9('\x30' + chr(111) + '\x33', 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(111 - 59) + '\x34', 0o10), ehT0Px3KOsy9(chr(0b11100 + 0o24) + '\157' + chr(50) + chr(827 - 773) + chr(0b1110 + 0o45), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(50) + '\x35' + chr(49), 19398 - 19390), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110110) + '\x35', 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + chr(2199 - 2148) + chr(0b100011 + 0o17) + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(54) + '\067', 0b1000), ehT0Px3KOsy9(chr(0b1101 + 0o43) + chr(1307 - 1196) + chr(49) + chr(0b10110 + 0o37), 55448 - 55440), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110110) + '\x33', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b11010 + 0o125) + chr(0b0 + 0o62) + '\x31' + '\066', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1000110 + 0o51) + chr(0b110001) + chr(49) + chr(0b10111 + 0o31), 41538 - 41530), ehT0Px3KOsy9(chr(0b1101 + 0o43) + '\157' + chr(765 - 714) + chr(0b110000), 21025 - 21017)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(543 - 495) + chr(10373 - 10262) + chr(2548 - 2495) + chr(0b11010 + 0o26), ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'u'), chr(0b10011 + 0o121) + chr(101) + '\x63' + chr(3371 - 3260) + '\144' + chr(0b1100101))('\x75' + chr(11485 - 11369) + '\x66' + chr(0b10001 + 0o34) + chr(56)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def ghxLhbnQ4yu2(oVre8I6UXc3b, OeWW0F1dBPRQ):
nrEKUpFZDQbe = IDJ2eXGCBCDu.layers.dense(oVre8I6UXc3b.mem_vals, oVre8I6UXc3b.key_depth, bias_initializer=IDJ2eXGCBCDu.constant_initializer(1.0), name=xafqLlk3kkUe(SXOLrMavuUCe(b'6/\x86Bd\xb4_'), chr(0b1100100) + chr(0b110100 + 0o61) + chr(99) + '\x6f' + chr(0b10011 + 0o121) + chr(4669 - 4568))(chr(0b1110101) + '\x74' + chr(6219 - 6117) + '\x2d' + chr(2864 - 2808)))
Dnx3oqwJXuyM = IDJ2eXGCBCDu.layers.dense(OeWW0F1dBPRQ, oVre8I6UXc3b.key_depth, bias_initializer=IDJ2eXGCBCDu.constant_initializer(1.0), name=xafqLlk3kkUe(SXOLrMavuUCe(b'6/\x86B~\xa4C\x98&'), '\x64' + chr(101) + chr(4409 - 4310) + chr(0b1101111) + chr(0b10 + 0o142) + chr(0b1100101))(chr(0b1011111 + 0o26) + chr(3924 - 3808) + chr(0b1100000 + 0o6) + '\x2d' + chr(2195 - 2139)))
eTOwOXrckQns = IDJ2eXGCBCDu.matmul(oVre8I6UXc3b._norm(Dnx3oqwJXuyM), oVre8I6UXc3b._norm(nrEKUpFZDQbe), transpose_b=ehT0Px3KOsy9(chr(48) + '\x6f' + '\061', 0b1000))
Sc2RN7LLzt2N = IDJ2eXGCBCDu.matmul(Dnx3oqwJXuyM, nrEKUpFZDQbe, transpose_b=ehT0Px3KOsy9('\x30' + '\x6f' + '\061', 8))
ibmyQQizotNA = IDJ2eXGCBCDu.div(Sc2RN7LLzt2N, eTOwOXrckQns + 1e-07, name=xafqLlk3kkUe(SXOLrMavuUCe(b'8%\x98Bk\xb8U\x9e'), '\144' + chr(0b100101 + 0o100) + chr(0b11111 + 0o104) + chr(236 - 125) + chr(0b1100100) + chr(101))(chr(0b1110101) + chr(0b1110100) + chr(0b10000 + 0o126) + '\x2d' + chr(2405 - 2349)))
_ga5tky55gzm = oVre8I6UXc3b.sharpen_factor * ibmyQQizotNA
return _ga5tky55gzm
|
tensorflow/tensor2tensor
|
tensor2tensor/layers/transformer_memory.py
|
TransformerMemory.read
|
def read(self, x):
"""Read from the memory.
An external component can use the results via a simple MLP,
e.g., fn(x W_x + retrieved_mem W_m).
Args:
x: a tensor in the shape of [batch_size, length, depth].
Returns:
access_logits: the logits for accessing the memory in shape of
[batch_size, length, memory_size].
retrieved_mem: the retrieved results in the shape of
[batch_size, length, val_depth].
"""
access_logits = self._address_content(x)
weights = tf.nn.softmax(access_logits)
retrieved_mem = tf.reduce_sum(
tf.multiply(tf.expand_dims(weights, 3),
tf.expand_dims(self.mem_vals, axis=1)), axis=2)
return access_logits, retrieved_mem
|
python
|
def read(self, x):
"""Read from the memory.
An external component can use the results via a simple MLP,
e.g., fn(x W_x + retrieved_mem W_m).
Args:
x: a tensor in the shape of [batch_size, length, depth].
Returns:
access_logits: the logits for accessing the memory in shape of
[batch_size, length, memory_size].
retrieved_mem: the retrieved results in the shape of
[batch_size, length, val_depth].
"""
access_logits = self._address_content(x)
weights = tf.nn.softmax(access_logits)
retrieved_mem = tf.reduce_sum(
tf.multiply(tf.expand_dims(weights, 3),
tf.expand_dims(self.mem_vals, axis=1)), axis=2)
return access_logits, retrieved_mem
|
[
"def",
"read",
"(",
"self",
",",
"x",
")",
":",
"access_logits",
"=",
"self",
".",
"_address_content",
"(",
"x",
")",
"weights",
"=",
"tf",
".",
"nn",
".",
"softmax",
"(",
"access_logits",
")",
"retrieved_mem",
"=",
"tf",
".",
"reduce_sum",
"(",
"tf",
".",
"multiply",
"(",
"tf",
".",
"expand_dims",
"(",
"weights",
",",
"3",
")",
",",
"tf",
".",
"expand_dims",
"(",
"self",
".",
"mem_vals",
",",
"axis",
"=",
"1",
")",
")",
",",
"axis",
"=",
"2",
")",
"return",
"access_logits",
",",
"retrieved_mem"
] |
Read from the memory.
An external component can use the results via a simple MLP,
e.g., fn(x W_x + retrieved_mem W_m).
Args:
x: a tensor in the shape of [batch_size, length, depth].
Returns:
access_logits: the logits for accessing the memory in shape of
[batch_size, length, memory_size].
retrieved_mem: the retrieved results in the shape of
[batch_size, length, val_depth].
|
[
"Read",
"from",
"the",
"memory",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/layers/transformer_memory.py#L251-L270
|
train
|
Read from the memory.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,Z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_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x31' + chr(0b1110 + 0o43), 43836 - 43828), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x34', 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + '\x32' + chr(54) + chr(1860 - 1811), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101 + 0o142) + chr(49) + chr(48) + '\x35', 24176 - 24168), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b0 + 0o66) + chr(0b110010), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b10011 + 0o37) + chr(55) + chr(0b110000), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(7274 - 7163) + chr(0b110110) + '\x31', 6018 - 6010), ehT0Px3KOsy9(chr(0b1101 + 0o43) + '\157' + chr(1568 - 1519) + chr(48) + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(1885 - 1837) + '\x6f' + chr(0b110001) + chr(0b1001 + 0o52) + chr(0b110 + 0o57), 0o10), ehT0Px3KOsy9('\x30' + chr(7482 - 7371) + chr(0b11 + 0o56) + '\x30' + '\x35', 8), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(51) + chr(0b11110 + 0o24) + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x31' + '\062' + chr(2175 - 2126), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + '\061' + chr(0b110111) + '\066', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1010110 + 0o31) + '\x36', 21881 - 21873), ehT0Px3KOsy9(chr(48) + chr(111) + chr(597 - 546) + chr(0b110101 + 0o1) + chr(0b110110), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x31' + chr(743 - 693) + '\x34', 0o10), ehT0Px3KOsy9(chr(1627 - 1579) + '\x6f' + '\x33' + chr(0b101 + 0o55) + '\x30', 0o10), ehT0Px3KOsy9('\x30' + chr(0b11101 + 0o122) + chr(50) + '\x30' + '\x36', 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110011), 0b1000), ehT0Px3KOsy9(chr(0b11110 + 0o22) + '\x6f' + chr(2225 - 2176) + chr(2081 - 2029) + chr(392 - 337), ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + chr(51) + '\x36' + '\x34', 46729 - 46721), ehT0Px3KOsy9(chr(0b101110 + 0o2) + chr(0b1101111) + '\063' + chr(50) + chr(2398 - 2349), 39122 - 39114), ehT0Px3KOsy9(chr(0b1010 + 0o46) + chr(0b1101111) + chr(0b110010) + chr(0b1100 + 0o50) + '\063', 2939 - 2931), ehT0Px3KOsy9(chr(2230 - 2182) + chr(0b1101111) + '\x36' + chr(50), 8), ehT0Px3KOsy9(chr(839 - 791) + chr(0b1010001 + 0o36) + chr(54) + chr(0b101100 + 0o13), 0b1000), ehT0Px3KOsy9(chr(1815 - 1767) + '\x6f' + chr(51) + '\061', ord("\x08")), ehT0Px3KOsy9(chr(1915 - 1867) + chr(0b1101111) + chr(0b11011 + 0o26) + '\065' + '\060', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1010101 + 0o32) + chr(49) + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x31' + '\x33' + chr(256 - 207), 31152 - 31144), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(54) + chr(0b110011), 9291 - 9283), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110100) + chr(0b110100), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101100 + 0o3) + chr(0b110010) + '\067' + chr(1239 - 1189), 0o10), ehT0Px3KOsy9(chr(0b1000 + 0o50) + chr(6539 - 6428) + '\x35' + chr(1743 - 1693), ord("\x08")), ehT0Px3KOsy9(chr(774 - 726) + chr(0b1101111) + chr(0b110110) + chr(0b11011 + 0o30), 8), ehT0Px3KOsy9(chr(48) + chr(111) + chr(50) + chr(0b110111 + 0o0) + '\061', 0b1000), ehT0Px3KOsy9('\060' + chr(0b1 + 0o156) + chr(0b100111 + 0o16) + chr(265 - 213), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(50) + '\067' + chr(55), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(1219 - 1169) + '\063' + '\064', 21168 - 21160), ehT0Px3KOsy9('\x30' + chr(0b100000 + 0o117) + '\x33' + chr(52) + chr(0b101101 + 0o10), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(1814 - 1703) + '\062' + '\065' + chr(53), 7570 - 7562)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + '\157' + '\065' + chr(0b10 + 0o56), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b"'"), '\x64' + '\x65' + chr(0b1001011 + 0o30) + chr(111) + '\144' + chr(8627 - 8526))('\165' + chr(0b1011 + 0o151) + chr(0b1100110) + '\x2d' + '\070') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def U6MiWrhuCi2Y(oVre8I6UXc3b, OeWW0F1dBPRQ):
_ga5tky55gzm = oVre8I6UXc3b._address_content(OeWW0F1dBPRQ)
ZurHTci57aXw = IDJ2eXGCBCDu.nn.softmax(_ga5tky55gzm)
ORV_g898uJ7T = IDJ2eXGCBCDu.reduce_sum(IDJ2eXGCBCDu.multiply(IDJ2eXGCBCDu.expand_dims(ZurHTci57aXw, ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(51), 8)), IDJ2eXGCBCDu.expand_dims(oVre8I6UXc3b.mem_vals, axis=ehT0Px3KOsy9(chr(1793 - 1745) + chr(0b1101111) + chr(0b11111 + 0o22), ord("\x08")))), axis=ehT0Px3KOsy9('\x30' + chr(3706 - 3595) + '\062', ord("\x08")))
return (_ga5tky55gzm, ORV_g898uJ7T)
|
tensorflow/tensor2tensor
|
tensor2tensor/layers/transformer_memory.py
|
TransformerMemory.write
|
def write(self, x, access_logits):
"""Write to the memory based on a combination of similarity and least used.
Based on arXiv:1607.00036v2 [cs.LG].
Args:
x: a tensor in the shape of [batch_size, length, depth].
access_logits: the logits for accessing the memory.
Returns:
the update op.
"""
gamma = tf.layers.dense(x, 1, activation=tf.sigmoid, name="gamma")
write_logits = access_logits - gamma * tf.expand_dims(self.mean_logits, 1)
candidate_value = tf.layers.dense(x, self.val_depth,
activation=tf.nn.relu,
name="candidate_value")
erase_gates = tf.layers.dense(x, self.memory_size,
activation=tf.nn.sigmoid,
name="erase")
write_weights = tf.nn.softmax(write_logits)
erase_weights = tf.expand_dims(1 - erase_gates * write_weights, 3)
erase = tf.multiply(erase_weights,
tf.expand_dims(self.mem_vals, 1))
addition = tf.multiply(
tf.expand_dims(write_weights, 3),
tf.expand_dims(candidate_value, 2))
update_value_op = self.mem_vals.assign(
tf.reduce_mean(erase + addition, axis=1))
with tf.control_dependencies([update_value_op]):
write_op = self.mean_logits.assign(
self.mean_logits * 0.1 + tf.reduce_mean(write_logits * 0.9, axis=1))
return write_op
|
python
|
def write(self, x, access_logits):
"""Write to the memory based on a combination of similarity and least used.
Based on arXiv:1607.00036v2 [cs.LG].
Args:
x: a tensor in the shape of [batch_size, length, depth].
access_logits: the logits for accessing the memory.
Returns:
the update op.
"""
gamma = tf.layers.dense(x, 1, activation=tf.sigmoid, name="gamma")
write_logits = access_logits - gamma * tf.expand_dims(self.mean_logits, 1)
candidate_value = tf.layers.dense(x, self.val_depth,
activation=tf.nn.relu,
name="candidate_value")
erase_gates = tf.layers.dense(x, self.memory_size,
activation=tf.nn.sigmoid,
name="erase")
write_weights = tf.nn.softmax(write_logits)
erase_weights = tf.expand_dims(1 - erase_gates * write_weights, 3)
erase = tf.multiply(erase_weights,
tf.expand_dims(self.mem_vals, 1))
addition = tf.multiply(
tf.expand_dims(write_weights, 3),
tf.expand_dims(candidate_value, 2))
update_value_op = self.mem_vals.assign(
tf.reduce_mean(erase + addition, axis=1))
with tf.control_dependencies([update_value_op]):
write_op = self.mean_logits.assign(
self.mean_logits * 0.1 + tf.reduce_mean(write_logits * 0.9, axis=1))
return write_op
|
[
"def",
"write",
"(",
"self",
",",
"x",
",",
"access_logits",
")",
":",
"gamma",
"=",
"tf",
".",
"layers",
".",
"dense",
"(",
"x",
",",
"1",
",",
"activation",
"=",
"tf",
".",
"sigmoid",
",",
"name",
"=",
"\"gamma\"",
")",
"write_logits",
"=",
"access_logits",
"-",
"gamma",
"*",
"tf",
".",
"expand_dims",
"(",
"self",
".",
"mean_logits",
",",
"1",
")",
"candidate_value",
"=",
"tf",
".",
"layers",
".",
"dense",
"(",
"x",
",",
"self",
".",
"val_depth",
",",
"activation",
"=",
"tf",
".",
"nn",
".",
"relu",
",",
"name",
"=",
"\"candidate_value\"",
")",
"erase_gates",
"=",
"tf",
".",
"layers",
".",
"dense",
"(",
"x",
",",
"self",
".",
"memory_size",
",",
"activation",
"=",
"tf",
".",
"nn",
".",
"sigmoid",
",",
"name",
"=",
"\"erase\"",
")",
"write_weights",
"=",
"tf",
".",
"nn",
".",
"softmax",
"(",
"write_logits",
")",
"erase_weights",
"=",
"tf",
".",
"expand_dims",
"(",
"1",
"-",
"erase_gates",
"*",
"write_weights",
",",
"3",
")",
"erase",
"=",
"tf",
".",
"multiply",
"(",
"erase_weights",
",",
"tf",
".",
"expand_dims",
"(",
"self",
".",
"mem_vals",
",",
"1",
")",
")",
"addition",
"=",
"tf",
".",
"multiply",
"(",
"tf",
".",
"expand_dims",
"(",
"write_weights",
",",
"3",
")",
",",
"tf",
".",
"expand_dims",
"(",
"candidate_value",
",",
"2",
")",
")",
"update_value_op",
"=",
"self",
".",
"mem_vals",
".",
"assign",
"(",
"tf",
".",
"reduce_mean",
"(",
"erase",
"+",
"addition",
",",
"axis",
"=",
"1",
")",
")",
"with",
"tf",
".",
"control_dependencies",
"(",
"[",
"update_value_op",
"]",
")",
":",
"write_op",
"=",
"self",
".",
"mean_logits",
".",
"assign",
"(",
"self",
".",
"mean_logits",
"*",
"0.1",
"+",
"tf",
".",
"reduce_mean",
"(",
"write_logits",
"*",
"0.9",
",",
"axis",
"=",
"1",
")",
")",
"return",
"write_op"
] |
Write to the memory based on a combination of similarity and least used.
Based on arXiv:1607.00036v2 [cs.LG].
Args:
x: a tensor in the shape of [batch_size, length, depth].
access_logits: the logits for accessing the memory.
Returns:
the update op.
|
[
"Write",
"to",
"the",
"memory",
"based",
"on",
"a",
"combination",
"of",
"similarity",
"and",
"least",
"used",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/layers/transformer_memory.py#L272-L303
|
train
|
Writes to the memory based on a combination of similarity and least used.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,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bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\060' + '\157' + chr(903 - 852) + chr(54) + chr(0b1010 + 0o47), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110011) + chr(0b110001) + chr(470 - 422), 46514 - 46506), ehT0Px3KOsy9(chr(0b10110 + 0o32) + chr(0b1101111) + chr(2995 - 2940) + chr(1494 - 1439), ord("\x08")), ehT0Px3KOsy9(chr(0b1100 + 0o44) + chr(0b110010 + 0o75) + '\062' + chr(0b110101) + chr(1411 - 1357), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(355 - 306) + chr(48) + chr(50), 0o10), ehT0Px3KOsy9(chr(1176 - 1128) + chr(726 - 615) + chr(56 - 7) + '\x35' + chr(0b110000), ord("\x08")), ehT0Px3KOsy9(chr(0b100000 + 0o20) + chr(0b1101111) + chr(0b110110) + chr(55), 58019 - 58011), ehT0Px3KOsy9(chr(0b110 + 0o52) + chr(111) + chr(49) + chr(2181 - 2130) + chr(0b110010), 29802 - 29794), ehT0Px3KOsy9(chr(0b110000) + chr(0b1010010 + 0o35) + chr(965 - 914) + chr(1223 - 1168) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b101100 + 0o11) + chr(55), 0b1000), ehT0Px3KOsy9(chr(0b10111 + 0o31) + chr(0b100011 + 0o114) + chr(0b100001 + 0o22) + chr(0b110111), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(50) + chr(52) + chr(0b11100 + 0o26), 57074 - 57066), ehT0Px3KOsy9('\060' + '\x6f' + chr(2362 - 2312) + '\061' + chr(48), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(1770 - 1659) + '\x34' + chr(0b11000 + 0o30), 51182 - 51174), ehT0Px3KOsy9(chr(271 - 223) + '\x6f' + '\x31' + '\x33' + chr(0b10100 + 0o34), 0o10), ehT0Px3KOsy9(chr(1369 - 1321) + '\157' + chr(49) + chr(55) + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + '\062' + chr(0b110000) + '\x34', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\061' + '\x31', 35579 - 35571), ehT0Px3KOsy9('\x30' + '\x6f' + chr(50), ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + '\x31', 59815 - 59807), ehT0Px3KOsy9('\x30' + chr(0b1011101 + 0o22) + '\x36' + chr(1935 - 1883), 0o10), ehT0Px3KOsy9(chr(145 - 97) + '\157' + '\064', 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(1843 - 1794) + chr(0b110001) + chr(55), 38472 - 38464), ehT0Px3KOsy9('\x30' + chr(8002 - 7891) + '\x32' + '\065' + chr(50), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + chr(0b110101) + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(0b11110 + 0o22) + chr(701 - 590) + '\061' + chr(51) + chr(0b110101), 10498 - 10490), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110001) + chr(0b110010) + '\062', 0o10), ehT0Px3KOsy9(chr(1308 - 1260) + '\x6f' + chr(0b100011 + 0o16) + chr(52) + '\x34', ord("\x08")), ehT0Px3KOsy9('\060' + chr(11259 - 11148) + chr(0b110010) + chr(0b10010 + 0o41), ord("\x08")), ehT0Px3KOsy9(chr(0b101011 + 0o5) + '\x6f' + '\x31' + '\x36' + chr(51), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(55), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1011010 + 0o25) + chr(0b110001 + 0o0) + '\060', ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + chr(522 - 472) + '\x31' + chr(1572 - 1523), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x32' + chr(81 - 32) + chr(656 - 602), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x31' + '\062' + chr(234 - 182), ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + '\x32' + '\x32' + chr(48), 41153 - 41145), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x31' + chr(725 - 674) + '\064', 21557 - 21549), ehT0Px3KOsy9(chr(48) + chr(0b101 + 0o152) + chr(49) + chr(0b110111) + '\062', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b100111 + 0o110) + chr(50) + chr(149 - 95) + chr(0b0 + 0o65), ord("\x08")), ehT0Px3KOsy9(chr(285 - 237) + chr(0b1101111) + chr(49) + '\062' + chr(0b110001), ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + chr(10079 - 9968) + chr(53) + chr(0b0 + 0o60), 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xdf'), chr(0b1100100) + chr(101) + chr(99) + '\x6f' + '\144' + chr(7661 - 7560))('\x75' + '\x74' + chr(0b11011 + 0o113) + chr(0b10111 + 0o26) + chr(0b110010 + 0o6)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def QywlqEoQilJa(oVre8I6UXc3b, OeWW0F1dBPRQ, _ga5tky55gzm):
nfeH4ZtvQXsW = IDJ2eXGCBCDu.layers.dense(OeWW0F1dBPRQ, ehT0Px3KOsy9(chr(0b100111 + 0o11) + chr(0b1101111) + '\061', 8), activation=IDJ2eXGCBCDu.sigmoid, name=xafqLlk3kkUe(SXOLrMavuUCe(b'\x96\xa9R\xc3#'), chr(0b1100100) + chr(0b110001 + 0o64) + chr(0b1100011) + chr(0b1101111) + chr(0b1100100) + '\145')('\165' + chr(0b1010110 + 0o36) + chr(0b1100110) + chr(1976 - 1931) + '\x38'))
EwjIuYrFbsnt = _ga5tky55gzm - nfeH4ZtvQXsW * IDJ2eXGCBCDu.expand_dims(oVre8I6UXc3b.mean_logits, ehT0Px3KOsy9(chr(0b1110 + 0o42) + '\157' + '\x31', 8))
EQLlfPmZwtgS = IDJ2eXGCBCDu.layers.dense(OeWW0F1dBPRQ, oVre8I6UXc3b.val_depth, activation=IDJ2eXGCBCDu.nn.relu, name=xafqLlk3kkUe(SXOLrMavuUCe(b'\x92\xa9Q\xca+\x0cV.\x99pi\xc3\xe4U='), chr(100) + '\145' + chr(99) + chr(0b1101111) + '\x64' + chr(0b1100101))('\165' + chr(0b1110100) + chr(102) + chr(0b101101) + chr(56)))
oAUlILTPZ6Q4 = IDJ2eXGCBCDu.layers.dense(OeWW0F1dBPRQ, oVre8I6UXc3b.memory_size, activation=IDJ2eXGCBCDu.nn.sigmoid, name=xafqLlk3kkUe(SXOLrMavuUCe(b"\x94\xba^\xdd'"), '\x64' + chr(205 - 104) + chr(0b1100011) + chr(5651 - 5540) + chr(0b1100100) + '\145')('\x75' + chr(116) + chr(0b1011011 + 0o13) + chr(1404 - 1359) + chr(0b111000)))
ck8VczKbXzPF = IDJ2eXGCBCDu.nn.softmax(EwjIuYrFbsnt)
Dd44cPVaZYON = IDJ2eXGCBCDu.expand_dims(ehT0Px3KOsy9('\060' + '\x6f' + '\061', 8) - oAUlILTPZ6Q4 * ck8VczKbXzPF, ehT0Px3KOsy9('\060' + '\157' + chr(2289 - 2238), 0o10))
xFvBgLS4Jiv9 = IDJ2eXGCBCDu.multiply(Dd44cPVaZYON, IDJ2eXGCBCDu.expand_dims(oVre8I6UXc3b.mem_vals, ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b1110 + 0o43), 8)))
FqwTGld_HluJ = IDJ2eXGCBCDu.multiply(IDJ2eXGCBCDu.expand_dims(ck8VczKbXzPF, ehT0Px3KOsy9(chr(0b110000) + chr(0b11001 + 0o126) + chr(0b110011), 8)), IDJ2eXGCBCDu.expand_dims(EQLlfPmZwtgS, ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b11 + 0o57), 8)))
v8n2im2lCe1T = oVre8I6UXc3b.mem_vals.assign(IDJ2eXGCBCDu.reduce_mean(xFvBgLS4Jiv9 + FqwTGld_HluJ, axis=ehT0Px3KOsy9('\x30' + '\x6f' + chr(49), 8)))
with xafqLlk3kkUe(IDJ2eXGCBCDu, xafqLlk3kkUe(SXOLrMavuUCe(b'\x92\xa7Q\xda0\x07[\x05\x98Jo\xc7\xe6D=\x13\xe7`gr'), chr(0b1100100) + '\145' + chr(99) + chr(3118 - 3007) + chr(9135 - 9035) + chr(0b1100101))(chr(117) + '\164' + chr(0b1100110) + '\055' + chr(0b111000 + 0o0)))([v8n2im2lCe1T]):
oZkCDigtmMOJ = oVre8I6UXc3b.mean_logits.assign(oVre8I6UXc3b.mean_logits * 0.1 + IDJ2eXGCBCDu.reduce_mean(EwjIuYrFbsnt * 0.9, axis=ehT0Px3KOsy9(chr(0b101110 + 0o2) + '\x6f' + chr(2251 - 2202), 8)))
return oZkCDigtmMOJ
|
tensorflow/tensor2tensor
|
tensor2tensor/layers/transformer_memory.py
|
TransformerMemory.reset
|
def reset(self, entries_to_reset):
"""Reset the entries in the memory.
Args:
entries_to_reset: a 1D tensor.
Returns:
the reset op.
"""
num_updates = tf.size(entries_to_reset)
update_vals = tf.scatter_update(
self.mem_vals, entries_to_reset,
tf.tile(tf.expand_dims(
tf.fill([self.memory_size, self.val_depth], .0), 0),
[num_updates, 1, 1]))
update_logits = tf.scatter_update(
self.mean_logits, entries_to_reset,
tf.tile(tf.expand_dims(
tf.fill([self.memory_size], .0), 0),
[num_updates, 1]))
reset_op = tf.group([update_vals, update_logits])
return reset_op
|
python
|
def reset(self, entries_to_reset):
"""Reset the entries in the memory.
Args:
entries_to_reset: a 1D tensor.
Returns:
the reset op.
"""
num_updates = tf.size(entries_to_reset)
update_vals = tf.scatter_update(
self.mem_vals, entries_to_reset,
tf.tile(tf.expand_dims(
tf.fill([self.memory_size, self.val_depth], .0), 0),
[num_updates, 1, 1]))
update_logits = tf.scatter_update(
self.mean_logits, entries_to_reset,
tf.tile(tf.expand_dims(
tf.fill([self.memory_size], .0), 0),
[num_updates, 1]))
reset_op = tf.group([update_vals, update_logits])
return reset_op
|
[
"def",
"reset",
"(",
"self",
",",
"entries_to_reset",
")",
":",
"num_updates",
"=",
"tf",
".",
"size",
"(",
"entries_to_reset",
")",
"update_vals",
"=",
"tf",
".",
"scatter_update",
"(",
"self",
".",
"mem_vals",
",",
"entries_to_reset",
",",
"tf",
".",
"tile",
"(",
"tf",
".",
"expand_dims",
"(",
"tf",
".",
"fill",
"(",
"[",
"self",
".",
"memory_size",
",",
"self",
".",
"val_depth",
"]",
",",
".0",
")",
",",
"0",
")",
",",
"[",
"num_updates",
",",
"1",
",",
"1",
"]",
")",
")",
"update_logits",
"=",
"tf",
".",
"scatter_update",
"(",
"self",
".",
"mean_logits",
",",
"entries_to_reset",
",",
"tf",
".",
"tile",
"(",
"tf",
".",
"expand_dims",
"(",
"tf",
".",
"fill",
"(",
"[",
"self",
".",
"memory_size",
"]",
",",
".0",
")",
",",
"0",
")",
",",
"[",
"num_updates",
",",
"1",
"]",
")",
")",
"reset_op",
"=",
"tf",
".",
"group",
"(",
"[",
"update_vals",
",",
"update_logits",
"]",
")",
"return",
"reset_op"
] |
Reset the entries in the memory.
Args:
entries_to_reset: a 1D tensor.
Returns:
the reset op.
|
[
"Reset",
"the",
"entries",
"in",
"the",
"memory",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/layers/transformer_memory.py#L317-L337
|
train
|
Reset the entries in the memory.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYic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TYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b11100 + 0o26) + '\065' + '\063', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110101) + chr(2000 - 1951), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(344 - 295) + '\x34' + '\x31', 0o10), ehT0Px3KOsy9('\060' + '\157' + '\062' + chr(0b110000) + chr(55), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b11011 + 0o27) + '\064' + chr(55), 0b1000), ehT0Px3KOsy9(chr(1004 - 956) + chr(0b1101111) + chr(374 - 325) + chr(0b110010) + chr(0b110011), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(1775 - 1726) + chr(0b110100) + '\060', ord("\x08")), ehT0Px3KOsy9(chr(0b101001 + 0o7) + chr(1870 - 1759) + '\063' + chr(0b110001), ord("\x08")), ehT0Px3KOsy9(chr(0b101111 + 0o1) + '\157' + chr(410 - 360) + '\x31' + chr(0b100100 + 0o21), 0o10), ehT0Px3KOsy9('\060' + chr(0b111010 + 0o65) + '\063' + chr(52) + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(51) + chr(0b0 + 0o67) + chr(0b11001 + 0o27), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x35' + chr(623 - 575), 0o10), ehT0Px3KOsy9(chr(647 - 599) + '\x6f' + chr(49) + chr(0b10010 + 0o41) + chr(0b110101), ord("\x08")), ehT0Px3KOsy9(chr(2276 - 2228) + chr(0b110010 + 0o75) + chr(0b1100 + 0o45) + chr(50) + '\061', 33227 - 33219), ehT0Px3KOsy9(chr(48) + chr(8138 - 8027) + chr(0b110011) + '\061' + chr(0b110110), 11622 - 11614), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b10000 + 0o42) + chr(0b1001 + 0o50) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(7265 - 7154) + chr(0b110010) + chr(51) + '\x35', 38266 - 38258), ehT0Px3KOsy9(chr(48) + chr(111) + chr(2468 - 2418) + '\061', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(49) + chr(0b10010 + 0o44) + chr(51), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x37' + chr(0b110100), 64425 - 64417), ehT0Px3KOsy9(chr(0b11100 + 0o24) + chr(111) + '\063' + chr(53) + chr(0b11110 + 0o22), 0b1000), ehT0Px3KOsy9(chr(0b1000 + 0o50) + '\157' + '\061' + '\065', 0b1000), ehT0Px3KOsy9(chr(1961 - 1913) + '\x6f' + '\063' + chr(1768 - 1719) + '\x37', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\061' + '\061' + chr(48), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + '\x32' + chr(55), 19612 - 19604), ehT0Px3KOsy9('\x30' + chr(9402 - 9291) + chr(54) + chr(0b110011), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\061' + chr(1622 - 1571), ord("\x08")), ehT0Px3KOsy9(chr(451 - 403) + chr(0b111100 + 0o63) + chr(2475 - 2425) + chr(0b100101 + 0o20) + '\067', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b11100 + 0o123) + '\062' + chr(0b101000 + 0o10) + '\060', 0o10), ehT0Px3KOsy9('\060' + chr(10215 - 10104) + '\x32' + chr(0b11 + 0o57) + '\060', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(55) + '\x31', 31105 - 31097), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110011) + chr(0b10001 + 0o42) + '\064', 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(51) + '\x30' + '\x30', 44007 - 43999), ehT0Px3KOsy9(chr(1713 - 1665) + '\x6f' + chr(51) + '\066' + '\061', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(2046 - 1997) + '\x33' + '\067', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110010) + chr(0b110000) + chr(0b110100), 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(0b100101 + 0o14) + chr(0b11 + 0o64) + '\064', ord("\x08")), ehT0Px3KOsy9(chr(449 - 401) + '\x6f' + '\x33' + '\x31' + chr(0b1101 + 0o47), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101110 + 0o1) + '\x31' + chr(0b101100 + 0o5) + chr(1584 - 1532), 6081 - 6073), ehT0Px3KOsy9(chr(2050 - 2002) + chr(5833 - 5722) + chr(0b110001) + chr(0b11010 + 0o30) + chr(2018 - 1969), 8)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + chr(9072 - 8961) + chr(0b10100 + 0o41) + chr(0b10111 + 0o31), 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x85'), chr(100) + chr(101) + chr(0b1011010 + 0o11) + chr(0b101010 + 0o105) + chr(9020 - 8920) + chr(101))('\165' + chr(116) + chr(10090 - 9988) + chr(900 - 855) + chr(56)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def G0V856pwkJmZ(oVre8I6UXc3b, DXaVm2EMhHl5):
sdQi17YNEmuX = IDJ2eXGCBCDu.NLcc3BCJnQka(DXaVm2EMhHl5)
WQbikW0Aucc8 = IDJ2eXGCBCDu.scatter_update(oVre8I6UXc3b.mem_vals, DXaVm2EMhHl5, IDJ2eXGCBCDu.tile(IDJ2eXGCBCDu.expand_dims(IDJ2eXGCBCDu.fill([oVre8I6UXc3b.memory_size, oVre8I6UXc3b.val_depth], 0.0), ehT0Px3KOsy9(chr(404 - 356) + '\157' + chr(0b0 + 0o60), 61257 - 61249)), [sdQi17YNEmuX, ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(1440 - 1391), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + '\061', 8)]))
pvJa0cnQpibr = IDJ2eXGCBCDu.scatter_update(oVre8I6UXc3b.mean_logits, DXaVm2EMhHl5, IDJ2eXGCBCDu.tile(IDJ2eXGCBCDu.expand_dims(IDJ2eXGCBCDu.fill([oVre8I6UXc3b.memory_size], 0.0), ehT0Px3KOsy9(chr(2029 - 1981) + chr(0b1011100 + 0o23) + '\x30', 8)), [sdQi17YNEmuX, ehT0Px3KOsy9(chr(1264 - 1216) + chr(0b1101111) + chr(49), 8)]))
YiiYlveapBFq = IDJ2eXGCBCDu.N9UnmYvaW1pO([WQbikW0Aucc8, pvJa0cnQpibr])
return YiiYlveapBFq
|
tensorflow/tensor2tensor
|
tensor2tensor/layers/transformer_memory.py
|
TransformerMemory.pre_attention
|
def pre_attention(self, segment_number, query_antecedent,
memory_antecedent, bias):
"""Called prior to self-attention, to incorporate memory items.
Args:
segment_number: an integer Tensor with shape [batch]
query_antecedent: a Tensor with shape [batch, length_q, channels]
memory_antecedent: must be None. Attention normally allows this to be a
Tensor with shape [batch, length_m, channels], but we currently only
support memory for decoder-side self-attention.
bias: bias Tensor (see attention_bias())
Returns:
(data, new_query_antecedent, new_memory_antecedent, new_bias)
"""
with tf.variable_scope(self.name + "/pre_attention", reuse=tf.AUTO_REUSE):
assert memory_antecedent is None, "We only support language modeling"
with tf.control_dependencies([
tf.assert_greater_equal(self.batch_size, tf.size(segment_number))]):
difference = self.batch_size - tf.size(segment_number)
segment_number = tf.pad(segment_number, [[0, difference]])
reset_op = self.reset(tf.reshape(tf.where(
tf.less(segment_number, self.segment_number)), [-1]))
memory_results = {}
with tf.control_dependencies([reset_op]):
with tf.control_dependencies([
self.update_segment_number(segment_number)]):
x = tf.pad(query_antecedent, [
[0, difference], [0, 0], [0, 0]])
access_logits, retrieved_mem = self.read(x)
memory_results["x"] = x
memory_results["access_logits"] = access_logits
memory_results["retrieved_mem"] = retrieved_mem
return memory_results, query_antecedent, memory_antecedent, bias
|
python
|
def pre_attention(self, segment_number, query_antecedent,
memory_antecedent, bias):
"""Called prior to self-attention, to incorporate memory items.
Args:
segment_number: an integer Tensor with shape [batch]
query_antecedent: a Tensor with shape [batch, length_q, channels]
memory_antecedent: must be None. Attention normally allows this to be a
Tensor with shape [batch, length_m, channels], but we currently only
support memory for decoder-side self-attention.
bias: bias Tensor (see attention_bias())
Returns:
(data, new_query_antecedent, new_memory_antecedent, new_bias)
"""
with tf.variable_scope(self.name + "/pre_attention", reuse=tf.AUTO_REUSE):
assert memory_antecedent is None, "We only support language modeling"
with tf.control_dependencies([
tf.assert_greater_equal(self.batch_size, tf.size(segment_number))]):
difference = self.batch_size - tf.size(segment_number)
segment_number = tf.pad(segment_number, [[0, difference]])
reset_op = self.reset(tf.reshape(tf.where(
tf.less(segment_number, self.segment_number)), [-1]))
memory_results = {}
with tf.control_dependencies([reset_op]):
with tf.control_dependencies([
self.update_segment_number(segment_number)]):
x = tf.pad(query_antecedent, [
[0, difference], [0, 0], [0, 0]])
access_logits, retrieved_mem = self.read(x)
memory_results["x"] = x
memory_results["access_logits"] = access_logits
memory_results["retrieved_mem"] = retrieved_mem
return memory_results, query_antecedent, memory_antecedent, bias
|
[
"def",
"pre_attention",
"(",
"self",
",",
"segment_number",
",",
"query_antecedent",
",",
"memory_antecedent",
",",
"bias",
")",
":",
"with",
"tf",
".",
"variable_scope",
"(",
"self",
".",
"name",
"+",
"\"/pre_attention\"",
",",
"reuse",
"=",
"tf",
".",
"AUTO_REUSE",
")",
":",
"assert",
"memory_antecedent",
"is",
"None",
",",
"\"We only support language modeling\"",
"with",
"tf",
".",
"control_dependencies",
"(",
"[",
"tf",
".",
"assert_greater_equal",
"(",
"self",
".",
"batch_size",
",",
"tf",
".",
"size",
"(",
"segment_number",
")",
")",
"]",
")",
":",
"difference",
"=",
"self",
".",
"batch_size",
"-",
"tf",
".",
"size",
"(",
"segment_number",
")",
"segment_number",
"=",
"tf",
".",
"pad",
"(",
"segment_number",
",",
"[",
"[",
"0",
",",
"difference",
"]",
"]",
")",
"reset_op",
"=",
"self",
".",
"reset",
"(",
"tf",
".",
"reshape",
"(",
"tf",
".",
"where",
"(",
"tf",
".",
"less",
"(",
"segment_number",
",",
"self",
".",
"segment_number",
")",
")",
",",
"[",
"-",
"1",
"]",
")",
")",
"memory_results",
"=",
"{",
"}",
"with",
"tf",
".",
"control_dependencies",
"(",
"[",
"reset_op",
"]",
")",
":",
"with",
"tf",
".",
"control_dependencies",
"(",
"[",
"self",
".",
"update_segment_number",
"(",
"segment_number",
")",
"]",
")",
":",
"x",
"=",
"tf",
".",
"pad",
"(",
"query_antecedent",
",",
"[",
"[",
"0",
",",
"difference",
"]",
",",
"[",
"0",
",",
"0",
"]",
",",
"[",
"0",
",",
"0",
"]",
"]",
")",
"access_logits",
",",
"retrieved_mem",
"=",
"self",
".",
"read",
"(",
"x",
")",
"memory_results",
"[",
"\"x\"",
"]",
"=",
"x",
"memory_results",
"[",
"\"access_logits\"",
"]",
"=",
"access_logits",
"memory_results",
"[",
"\"retrieved_mem\"",
"]",
"=",
"retrieved_mem",
"return",
"memory_results",
",",
"query_antecedent",
",",
"memory_antecedent",
",",
"bias"
] |
Called prior to self-attention, to incorporate memory items.
Args:
segment_number: an integer Tensor with shape [batch]
query_antecedent: a Tensor with shape [batch, length_q, channels]
memory_antecedent: must be None. Attention normally allows this to be a
Tensor with shape [batch, length_m, channels], but we currently only
support memory for decoder-side self-attention.
bias: bias Tensor (see attention_bias())
Returns:
(data, new_query_antecedent, new_memory_antecedent, new_bias)
|
[
"Called",
"prior",
"to",
"self",
"-",
"attention",
"to",
"incorporate",
"memory",
"items",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/layers/transformer_memory.py#L339-L371
|
train
|
Called prior to self - attention to incorporate memory items.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTr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ZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\x30' + '\157' + '\062' + chr(0b100101 + 0o22) + '\x37', 0o10), ehT0Px3KOsy9('\x30' + chr(8555 - 8444) + chr(49) + '\x35', 42977 - 42969), ehT0Px3KOsy9(chr(0b101 + 0o53) + chr(111) + '\063' + '\x30' + chr(0b10011 + 0o35), 0o10), ehT0Px3KOsy9(chr(0b11101 + 0o23) + chr(0b1101111) + '\x32' + chr(0b101000 + 0o17), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x32' + chr(0b11000 + 0o32) + '\x33', 31970 - 31962), ehT0Px3KOsy9(chr(1257 - 1209) + '\x6f' + chr(50) + chr(0b11010 + 0o30) + chr(186 - 131), ord("\x08")), ehT0Px3KOsy9(chr(2124 - 2076) + chr(2838 - 2727) + '\x32' + '\060' + chr(0b11100 + 0o32), 40280 - 40272), ehT0Px3KOsy9(chr(0b100111 + 0o11) + chr(3736 - 3625) + chr(55) + chr(0b100000 + 0o20), 0o10), ehT0Px3KOsy9(chr(500 - 452) + '\x6f' + chr(0b110011) + chr(0b110110) + chr(0b11001 + 0o33), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b100101 + 0o14) + chr(0b11111 + 0o24) + '\x30', 63546 - 63538), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110001) + chr(0b11111 + 0o23) + chr(0b110101), 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(593 - 543) + '\064' + chr(54), 0o10), ehT0Px3KOsy9(chr(118 - 70) + '\x6f' + chr(0b110011) + '\x32' + '\066', 0o10), ehT0Px3KOsy9(chr(1914 - 1866) + chr(111) + chr(0b110010) + chr(50), ord("\x08")), ehT0Px3KOsy9(chr(1001 - 953) + chr(111) + chr(87 - 37) + chr(0b110001 + 0o0) + chr(163 - 114), 50843 - 50835), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b1010 + 0o47) + chr(53) + '\x32', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(7930 - 7819) + chr(0b110001) + chr(53) + chr(0b110000), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b10110 + 0o131) + chr(0b110010) + '\060', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(51) + chr(0b100000 + 0o21) + '\x37', 65458 - 65450), ehT0Px3KOsy9('\x30' + '\x6f' + '\063' + chr(50), 61064 - 61056), ehT0Px3KOsy9('\060' + '\x6f' + '\x32' + '\061' + '\061', 8), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(51) + chr(0b110110) + chr(48), 6670 - 6662), ehT0Px3KOsy9('\060' + chr(0b1011010 + 0o25) + '\063' + chr(0b110011) + chr(0b10111 + 0o35), 27234 - 27226), ehT0Px3KOsy9(chr(48) + chr(0b0 + 0o157) + '\063' + chr(0b110111) + chr(0b110000), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x32' + '\x30' + chr(2215 - 2161), 8), ehT0Px3KOsy9('\x30' + '\x6f' + '\063' + '\x37' + '\x35', 0b1000), ehT0Px3KOsy9(chr(820 - 772) + chr(111) + chr(0b10110 + 0o34) + chr(0b110000) + '\067', 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b11111 + 0o22) + chr(1710 - 1657) + chr(0b101110 + 0o2), 8), ehT0Px3KOsy9(chr(316 - 268) + chr(3938 - 3827) + chr(51) + chr(298 - 245) + '\061', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(1428 - 1378) + chr(0b110111) + chr(0b110100), 0b1000), ehT0Px3KOsy9('\060' + '\157' + '\061' + chr(0b100101 + 0o13), 3567 - 3559), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\062' + chr(48) + chr(0b110000), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(51) + chr(49) + '\x37', 8), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\063' + chr(466 - 415) + '\066', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x32' + chr(50) + chr(0b110001), 4989 - 4981), ehT0Px3KOsy9(chr(0b110000) + chr(8656 - 8545) + chr(0b110 + 0o54) + '\064' + chr(726 - 675), 20708 - 20700), ehT0Px3KOsy9(chr(0b10010 + 0o36) + '\x6f' + chr(0b10010 + 0o37) + chr(0b10001 + 0o46) + chr(189 - 140), ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110011) + chr(0b110010) + chr(611 - 558), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(2165 - 2114) + '\066' + chr(0b110101), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110010) + '\x37', 8)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110101) + chr(48), 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x91'), '\x64' + chr(4671 - 4570) + chr(1828 - 1729) + chr(0b1101111) + chr(0b100010 + 0o102) + '\x65')('\165' + chr(116) + '\x66' + chr(0b101101) + chr(56)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def SwW3yN2bHm0G(oVre8I6UXc3b, qGW0reEAb813, ENas6b3HzFya, LWkuqV72y7LV, IKTrMTySqz10):
with xafqLlk3kkUe(IDJ2eXGCBCDu, xafqLlk3kkUe(SXOLrMavuUCe(b'\xc9l\xb2~\xf2\xf5\xea]\xab+6\xc9\xa6w'), chr(100) + '\x65' + '\143' + '\157' + chr(6860 - 6760) + '\145')('\165' + chr(0b11001 + 0o133) + chr(102) + chr(0b10101 + 0o30) + '\070'))(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xfeD\xb6]\xc1\xed\xca\\\xb0>2\xe0'), chr(5672 - 5572) + chr(6362 - 6261) + chr(0b1100011 + 0o0) + chr(8567 - 8456) + chr(2133 - 2033) + chr(101))(chr(117) + chr(0b1110100) + chr(102) + '\x2d' + chr(2828 - 2772))) + xafqLlk3kkUe(SXOLrMavuUCe(b'\x90}\xb2r\xcc\xf6\xf2L\x916!\xcf\xb9|'), '\x64' + chr(0b1010 + 0o133) + chr(6400 - 6301) + chr(0b1101111) + '\x64' + chr(0b100000 + 0o105))(chr(0b1011111 + 0o26) + chr(3716 - 3600) + chr(102) + chr(0b101101 + 0o0) + '\x38'), reuse=xafqLlk3kkUe(IDJ2eXGCBCDu, xafqLlk3kkUe(SXOLrMavuUCe(b'\xfeX\x94X\xcc\xc5\xc3m\xa7\x1d'), '\x64' + chr(101) + '\x63' + chr(3358 - 3247) + '\144' + chr(0b110010 + 0o63))(chr(0b1110101) + chr(8100 - 7984) + chr(0b1100110) + chr(0b10100 + 0o31) + chr(2824 - 2768)))):
assert LWkuqV72y7LV is None, xafqLlk3kkUe(SXOLrMavuUCe(b'\xe8h\xe0x\xfd\xfb\xff\x18\x87-%\xd6\xb9`\xfdJ\x04q\xa1}\xfc\x91\xbb\x9d\xa6\x90\xe8\x0c\x8c\xd0a\xee\xa8'), chr(0b1100001 + 0o3) + '\x65' + chr(2802 - 2703) + chr(0b1101111) + chr(0b111110 + 0o46) + '\145')(chr(2708 - 2591) + chr(116) + chr(0b11 + 0o143) + '\055' + chr(0b100010 + 0o26))
with xafqLlk3kkUe(IDJ2eXGCBCDu, xafqLlk3kkUe(SXOLrMavuUCe(b'\xdcb\xaec\xe1\xf8\xeag\x90=%\xc3\xb8v\xec\x04\x0by\xaai'), '\144' + chr(101) + chr(99) + chr(111) + chr(9890 - 9790) + '\x65')(chr(12223 - 12106) + chr(116) + chr(0b11101 + 0o111) + chr(0b1100 + 0o41) + '\x38'))([xafqLlk3kkUe(IDJ2eXGCBCDu, xafqLlk3kkUe(SXOLrMavuUCe(b'\xde~\xb3r\xe1\xe3\xd9_\x86=4\xd2\xb3`\xd6\x0f\x19e\xaev'), chr(7369 - 7269) + '\145' + chr(0b1100011) + '\157' + chr(9457 - 9357) + chr(101))(chr(0b1110101) + '\164' + chr(102) + chr(711 - 666) + chr(0b1110 + 0o52)))(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xd6u\xf9s\xc9\xee\xe3y\x99\r-\xff'), '\x64' + '\145' + chr(0b10100 + 0o117) + chr(111) + chr(100) + chr(0b110100 + 0o61))(chr(0b111011 + 0o72) + '\164' + chr(0b10100 + 0o122) + chr(1053 - 1008) + '\070')), xafqLlk3kkUe(IDJ2eXGCBCDu, xafqLlk3kkUe(SXOLrMavuUCe(b'\xf1A\xa3t\xa0\xd5\xc5r\x9a\t>\xc7'), chr(100) + chr(0b1001000 + 0o35) + chr(0b1100011) + chr(0b11011 + 0o124) + chr(0b1011101 + 0o7) + '\145')('\165' + chr(116) + '\146' + chr(45) + chr(0b111000)))(qGW0reEAb813))]):
a2iKO1j3n86d = oVre8I6UXc3b.ix9dZyeAmUxY - IDJ2eXGCBCDu.NLcc3BCJnQka(qGW0reEAb813)
qGW0reEAb813 = IDJ2eXGCBCDu.pad(qGW0reEAb813, [[ehT0Px3KOsy9('\060' + '\x6f' + chr(48), 0o10), a2iKO1j3n86d]])
YiiYlveapBFq = oVre8I6UXc3b.reset(IDJ2eXGCBCDu.reshape(IDJ2eXGCBCDu.dRFAC59yQBm_(IDJ2eXGCBCDu.less(qGW0reEAb813, oVre8I6UXc3b.segment_number)), [-ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\061', 36975 - 36967)]))
vl9UpnOcRezs = {}
with xafqLlk3kkUe(IDJ2eXGCBCDu, xafqLlk3kkUe(SXOLrMavuUCe(b'\xdcb\xaec\xe1\xf8\xeag\x90=%\xc3\xb8v\xec\x04\x0by\xaai'), '\x64' + chr(2639 - 2538) + chr(3167 - 3068) + '\157' + '\x64' + '\145')(chr(117) + chr(116) + chr(0b1100110) + chr(45) + '\070'))([YiiYlveapBFq]):
with xafqLlk3kkUe(IDJ2eXGCBCDu, xafqLlk3kkUe(SXOLrMavuUCe(b'\xdcb\xaec\xe1\xf8\xeag\x90=%\xc3\xb8v\xec\x04\x0by\xaai'), '\144' + '\145' + '\143' + chr(0b1101111) + chr(8232 - 8132) + '\x65')(chr(12726 - 12609) + '\164' + chr(5373 - 5271) + '\055' + chr(0b111000)))([xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xca}\xa4v\xe7\xf2\xd9K\x91?8\xc3\xb8f\xd6\x04\x1d}\xad\x7f\xfb'), chr(0b1100100) + chr(2928 - 2827) + chr(99) + '\x6f' + chr(100) + chr(0b11010 + 0o113))('\165' + chr(792 - 676) + chr(0b1100110) + chr(0b101101) + chr(778 - 722)))(qGW0reEAb813)]):
OeWW0F1dBPRQ = IDJ2eXGCBCDu.pad(ENas6b3HzFya, [[ehT0Px3KOsy9('\060' + '\157' + '\x30', 8), a2iKO1j3n86d], [ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(48), 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b1010110 + 0o31) + chr(0b110000), 8)], [ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x30', 8), ehT0Px3KOsy9(chr(1230 - 1182) + chr(4261 - 4150) + chr(48), 8)]])
(_ga5tky55gzm, ORV_g898uJ7T) = oVre8I6UXc3b.U6MiWrhuCi2Y(OeWW0F1dBPRQ)
vl9UpnOcRezs[xafqLlk3kkUe(SXOLrMavuUCe(b'\xc7'), chr(100) + chr(3138 - 3037) + chr(0b100000 + 0o103) + '\157' + chr(100) + '\145')(chr(0b111 + 0o156) + chr(0b1110100) + '\146' + chr(0b101101) + chr(0b1001 + 0o57))] = OeWW0F1dBPRQ
vl9UpnOcRezs[xafqLlk3kkUe(SXOLrMavuUCe(b'\xden\xa3r\xe0\xe4\xd9T\x9b?<\xd2\xa5'), '\144' + '\145' + chr(3753 - 3654) + '\x6f' + '\x64' + '\145')(chr(1899 - 1782) + chr(6237 - 6121) + chr(0b110011 + 0o63) + chr(1942 - 1897) + chr(0b10011 + 0o45))] = _ga5tky55gzm
vl9UpnOcRezs[xafqLlk3kkUe(SXOLrMavuUCe(b'\xcdh\xb4e\xfa\xf2\xf0]\x90\x078\xc3\xbb'), '\144' + chr(0b1100101) + '\143' + chr(0b1101111) + '\x64' + chr(101))(chr(0b1110101) + '\x74' + chr(0b1000 + 0o136) + chr(0b11 + 0o52) + '\x38')] = ORV_g898uJ7T
return (vl9UpnOcRezs, ENas6b3HzFya, LWkuqV72y7LV, IKTrMTySqz10)
|
tensorflow/tensor2tensor
|
tensor2tensor/layers/transformer_memory.py
|
TransformerMemory.post_attention
|
def post_attention(self, token, x):
"""Called after self-attention. The memory can be updated here.
Args:
token: Data returned by pre_attention, which can be used to carry over
state related to the current memory operation.
x: a Tensor of data after self-attention and feed-forward
Returns:
a (possibly modified) version of the input x
"""
with tf.variable_scope(self.name + "/post_attention", reuse=tf.AUTO_REUSE):
depth = common_layers.shape_list(x)[-1]
actual_batch_size = common_layers.shape_list(x)[0]
memory_output = tf.gather(token["retrieved_mem"],
tf.range(actual_batch_size))
output = tf.add(tf.layers.dense(x, depth, use_bias=False),
tf.layers.dense(memory_output, depth))
with tf.control_dependencies([output]):
with tf.control_dependencies([
self.write(token["x"], token["access_logits"])]):
return tf.identity(output)
|
python
|
def post_attention(self, token, x):
"""Called after self-attention. The memory can be updated here.
Args:
token: Data returned by pre_attention, which can be used to carry over
state related to the current memory operation.
x: a Tensor of data after self-attention and feed-forward
Returns:
a (possibly modified) version of the input x
"""
with tf.variable_scope(self.name + "/post_attention", reuse=tf.AUTO_REUSE):
depth = common_layers.shape_list(x)[-1]
actual_batch_size = common_layers.shape_list(x)[0]
memory_output = tf.gather(token["retrieved_mem"],
tf.range(actual_batch_size))
output = tf.add(tf.layers.dense(x, depth, use_bias=False),
tf.layers.dense(memory_output, depth))
with tf.control_dependencies([output]):
with tf.control_dependencies([
self.write(token["x"], token["access_logits"])]):
return tf.identity(output)
|
[
"def",
"post_attention",
"(",
"self",
",",
"token",
",",
"x",
")",
":",
"with",
"tf",
".",
"variable_scope",
"(",
"self",
".",
"name",
"+",
"\"/post_attention\"",
",",
"reuse",
"=",
"tf",
".",
"AUTO_REUSE",
")",
":",
"depth",
"=",
"common_layers",
".",
"shape_list",
"(",
"x",
")",
"[",
"-",
"1",
"]",
"actual_batch_size",
"=",
"common_layers",
".",
"shape_list",
"(",
"x",
")",
"[",
"0",
"]",
"memory_output",
"=",
"tf",
".",
"gather",
"(",
"token",
"[",
"\"retrieved_mem\"",
"]",
",",
"tf",
".",
"range",
"(",
"actual_batch_size",
")",
")",
"output",
"=",
"tf",
".",
"add",
"(",
"tf",
".",
"layers",
".",
"dense",
"(",
"x",
",",
"depth",
",",
"use_bias",
"=",
"False",
")",
",",
"tf",
".",
"layers",
".",
"dense",
"(",
"memory_output",
",",
"depth",
")",
")",
"with",
"tf",
".",
"control_dependencies",
"(",
"[",
"output",
"]",
")",
":",
"with",
"tf",
".",
"control_dependencies",
"(",
"[",
"self",
".",
"write",
"(",
"token",
"[",
"\"x\"",
"]",
",",
"token",
"[",
"\"access_logits\"",
"]",
")",
"]",
")",
":",
"return",
"tf",
".",
"identity",
"(",
"output",
")"
] |
Called after self-attention. The memory can be updated here.
Args:
token: Data returned by pre_attention, which can be used to carry over
state related to the current memory operation.
x: a Tensor of data after self-attention and feed-forward
Returns:
a (possibly modified) version of the input x
|
[
"Called",
"after",
"self",
"-",
"attention",
".",
"The",
"memory",
"can",
"be",
"updated",
"here",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/layers/transformer_memory.py#L373-L393
|
train
|
Called after self - attention.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDASQ0Qkq,NL8dtWOpbcjF,_bikzMuRfbJG,sznFqDbNBHlx,ZsDPvpP4xdo3,cW7yQuyEnJ6E,KOHQGQ8qLDWm,NE1Yam2HHroQ,ygAzbDzrvRMh,SBRjvOU1ufVC,hOkXjmluK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M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(1313 - 1265) + chr(6538 - 6427) + chr(0b110011) + chr(54) + chr(0b110111), 44038 - 44030), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110001) + '\x37' + chr(0b100110 + 0o13), 59542 - 59534), ehT0Px3KOsy9(chr(0b11110 + 0o22) + chr(5801 - 5690) + chr(0b110011) + '\x37' + chr(51), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(1014 - 964) + chr(51) + '\067', 32859 - 32851), ehT0Px3KOsy9('\x30' + chr(1769 - 1658) + chr(0b101000 + 0o12) + '\x34' + '\x32', 0b1000), ehT0Px3KOsy9(chr(839 - 791) + chr(0b11011 + 0o124) + chr(0b10101 + 0o34) + chr(0b110101) + chr(955 - 904), 0o10), ehT0Px3KOsy9(chr(0b10110 + 0o32) + chr(0b1101111) + chr(49) + chr(0b100000 + 0o21) + chr(0b110011 + 0o2), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b100 + 0o56) + chr(598 - 549) + '\x31', 0o10), ehT0Px3KOsy9('\x30' + chr(111) + '\067' + chr(1071 - 1022), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(50) + '\x37' + chr(842 - 788), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + '\062' + chr(49) + chr(50), 0o10), ehT0Px3KOsy9(chr(2124 - 2076) + chr(111) + chr(0b10111 + 0o35) + chr(48), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\062' + '\x30' + chr(0b100111 + 0o12), 52661 - 52653), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101011 + 0o4) + chr(0b110011) + '\062' + chr(0b110110), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110001) + chr(905 - 852) + '\x34', 51547 - 51539), ehT0Px3KOsy9(chr(2160 - 2112) + '\x6f' + chr(0b110110) + chr(0b110011), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + '\x33' + chr(2684 - 2631) + '\061', 51818 - 51810), ehT0Px3KOsy9(chr(1123 - 1075) + chr(4450 - 4339) + chr(0b110010) + chr(0b110111) + '\x37', ord("\x08")), ehT0Px3KOsy9(chr(0b100000 + 0o20) + chr(9749 - 9638) + '\063' + chr(52) + '\x32', 64540 - 64532), ehT0Px3KOsy9(chr(0b10001 + 0o37) + chr(0b10000 + 0o137) + chr(55) + chr(0b100 + 0o56), 3592 - 3584), ehT0Px3KOsy9(chr(48) + chr(3017 - 2906) + '\x30', 0o10), ehT0Px3KOsy9(chr(0b11100 + 0o24) + '\157' + '\x32' + chr(0b11111 + 0o22) + chr(0b110110), 22992 - 22984), ehT0Px3KOsy9(chr(48) + '\157' + '\062' + chr(0b110110) + '\x36', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(10569 - 10458) + '\x32' + chr(2318 - 2265) + chr(0b110011), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(8102 - 7991) + chr(0b110011) + chr(0b10110 + 0o41) + chr(0b0 + 0o63), 8), ehT0Px3KOsy9(chr(408 - 360) + '\157' + chr(0b110110) + chr(49), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b110010 + 0o75) + chr(0b110011) + chr(0b110011) + '\060', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\066' + chr(175 - 124), 8), ehT0Px3KOsy9(chr(0b100101 + 0o13) + chr(0b1100000 + 0o17) + chr(50) + chr(0b11100 + 0o24) + chr(51), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b11100 + 0o25) + '\064' + '\065', 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110011) + chr(0b110011) + '\x30', 8), ehT0Px3KOsy9(chr(48) + '\x6f' + '\063' + chr(48) + chr(0b110101), 43494 - 43486), ehT0Px3KOsy9(chr(0b110000) + chr(0b1100101 + 0o12) + chr(0b110010) + '\062' + chr(2249 - 2200), 0b1000), ehT0Px3KOsy9(chr(92 - 44) + '\x6f' + chr(0b101010 + 0o7) + '\x32' + '\x30', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b11111 + 0o120) + '\x37', 52290 - 52282), ehT0Px3KOsy9(chr(0b111 + 0o51) + chr(111) + chr(50) + chr(53) + '\064', 54593 - 54585), ehT0Px3KOsy9(chr(0b10 + 0o56) + chr(0b1011010 + 0o25) + '\062' + '\066' + '\062', 42008 - 42000), ehT0Px3KOsy9(chr(498 - 450) + chr(0b1100101 + 0o12) + chr(51) + chr(2357 - 2307) + chr(564 - 514), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110110), 0o10), ehT0Px3KOsy9(chr(0b11001 + 0o27) + chr(5033 - 4922) + '\x31' + chr(0b110001) + chr(0b110011), 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(53) + '\060', ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xd9'), chr(0b111110 + 0o46) + chr(0b1100101) + chr(0b1100011) + chr(1535 - 1424) + '\x64' + chr(0b11 + 0o142))('\165' + chr(116) + chr(0b1100110) + chr(0b101101) + chr(0b111000)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def xu4zPfypsGAE(oVre8I6UXc3b, mTy3fac_AqJ5, OeWW0F1dBPRQ):
with xafqLlk3kkUe(IDJ2eXGCBCDu, xafqLlk3kkUe(SXOLrMavuUCe(b'\x81\x18\x89\xf6\xc3\t!\xecf\xcd\xe9O\xf1\xb3'), chr(100) + chr(101) + '\x63' + '\157' + chr(0b11001 + 0o113) + chr(0b1100101))(chr(4359 - 4242) + chr(0b1000010 + 0o62) + '\146' + chr(45) + chr(0b111000)))(xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb60\x8d\xd5\xf0\x11\x01\xed}\xd8\xedf'), chr(0b110100 + 0o60) + chr(0b1011 + 0o132) + chr(0b1100011) + chr(0b10 + 0o155) + chr(0b1100100) + '\x65')(chr(117) + chr(0b110111 + 0o75) + '\146' + chr(1681 - 1636) + chr(1048 - 992))) + xafqLlk3kkUe(SXOLrMavuUCe(b'\xd8\t\x94\xec\xd64,\xfdM\xdb\xe4T\xe8\xb9\x02'), '\144' + chr(101) + '\143' + chr(356 - 245) + '\144' + chr(101))(chr(5897 - 5780) + '\x74' + chr(0b1110 + 0o130) + chr(45) + '\x38'), reuse=xafqLlk3kkUe(IDJ2eXGCBCDu, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb6,\xaf\xd0\xfd9\x08\xdcj\xfb'), chr(0b1100100) + chr(0b1100101) + chr(0b1100010 + 0o1) + chr(111) + chr(0b11111 + 0o105) + '\x65')(chr(0b1011110 + 0o27) + '\164' + chr(0b1100110) + chr(1330 - 1285) + chr(0b111000)))):
UEys4_lSwsID = jSKPaHwSAfVv.shape_list(OeWW0F1dBPRQ)[-ehT0Px3KOsy9(chr(0b10000 + 0o40) + chr(7182 - 7071) + '\x31', 0b1000)]
Ywmzq4xn82XD = jSKPaHwSAfVv.shape_list(OeWW0F1dBPRQ)[ehT0Px3KOsy9(chr(2194 - 2146) + '\x6f' + chr(610 - 562), 8)]
kL6Pc3jc7fj8 = IDJ2eXGCBCDu.gather(mTy3fac_AqJ5[xafqLlk3kkUe(SXOLrMavuUCe(b'\x85\x1c\x8f\xed\xcb\x0e;\xec]\xe1\xe7E\xec'), chr(215 - 115) + chr(7545 - 7444) + '\143' + '\x6f' + chr(762 - 662) + chr(0b1100101))(chr(0b1110101) + '\x74' + '\x66' + chr(0b101101) + chr(0b11111 + 0o31))], IDJ2eXGCBCDu.range(Ywmzq4xn82XD))
e1jVqMSBZ01Y = IDJ2eXGCBCDu.add(IDJ2eXGCBCDu.layers.dense(OeWW0F1dBPRQ, UEys4_lSwsID, use_bias=ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x30', 8)), IDJ2eXGCBCDu.layers.dense(kL6Pc3jc7fj8, UEys4_lSwsID))
with xafqLlk3kkUe(IDJ2eXGCBCDu, xafqLlk3kkUe(SXOLrMavuUCe(b'\x94\x16\x95\xeb\xd0\x04!\xd6]\xdb\xfaE\xef\xb2\t]\x8a\xd6\x87I'), chr(1378 - 1278) + chr(0b1100101) + chr(8345 - 8246) + '\157' + chr(0b1100100) + '\x65')(chr(0b1110101) + '\x74' + chr(102) + '\x2d' + '\x38'))([e1jVqMSBZ01Y]):
with xafqLlk3kkUe(IDJ2eXGCBCDu, xafqLlk3kkUe(SXOLrMavuUCe(b'\x94\x16\x95\xeb\xd0\x04!\xd6]\xdb\xfaE\xef\xb2\t]\x8a\xd6\x87I'), '\144' + chr(0b1100101) + '\x63' + chr(111) + chr(100) + '\145')(chr(723 - 606) + chr(116) + chr(0b11011 + 0o113) + '\055' + chr(0b111000)))([xafqLlk3kkUe(oVre8I6UXc3b, xafqLlk3kkUe(SXOLrMavuUCe(b'\x80\x0b\x92\xeb\xc7'), '\144' + '\145' + '\x63' + '\x6f' + chr(0b1100100) + '\145')(chr(0b1110101) + '\x74' + '\x66' + chr(0b110 + 0o47) + chr(0b101000 + 0o20)))(mTy3fac_AqJ5[xafqLlk3kkUe(SXOLrMavuUCe(b'\x8f'), '\x64' + chr(9268 - 9167) + chr(0b1010011 + 0o20) + chr(0b1000011 + 0o54) + '\144' + chr(0b1100101))('\x75' + '\x74' + chr(0b1100110) + chr(45) + '\x38')], mTy3fac_AqJ5[xafqLlk3kkUe(SXOLrMavuUCe(b'\x96\x1a\x98\xfa\xd1\x18\x12\xe5V\xd9\xe3T\xf2'), chr(100) + chr(101) + '\143' + chr(0b1101101 + 0o2) + chr(0b110101 + 0o57) + '\x65')('\x75' + chr(116) + '\146' + chr(45) + chr(2992 - 2936))])]):
return xafqLlk3kkUe(IDJ2eXGCBCDu, xafqLlk3kkUe(SXOLrMavuUCe(b'\x81?\xae\xd8\x97\x06\x06\xd1Z\xc8\xd3g'), '\x64' + chr(0b111111 + 0o46) + chr(0b1100011) + chr(0b1010011 + 0o34) + '\144' + chr(101))(chr(117) + chr(1728 - 1612) + '\146' + chr(45) + chr(0b1011 + 0o55)))(e1jVqMSBZ01Y)
|
tensorflow/tensor2tensor
|
tensor2tensor/rl/ppo_learner.py
|
_define_train
|
def _define_train(
train_env,
ppo_hparams,
eval_env_fn=None,
sampling_temp=1.0,
**collect_kwargs
):
"""Define the training setup."""
memory, collect_summary, train_initialization = (
_define_collect(
train_env,
ppo_hparams,
"ppo_train",
eval_phase=False,
sampling_temp=sampling_temp,
**collect_kwargs))
ppo_summary = ppo.define_ppo_epoch(
memory, ppo_hparams, train_env.action_space, train_env.batch_size)
train_summary = tf.summary.merge([collect_summary, ppo_summary])
if ppo_hparams.eval_every_epochs:
# TODO(koz4k): Do we need this at all?
assert eval_env_fn is not None
eval_env = eval_env_fn(in_graph=True)
(_, eval_collect_summary, eval_initialization) = (
_define_collect(
eval_env,
ppo_hparams,
"ppo_eval",
eval_phase=True,
sampling_temp=0.0,
**collect_kwargs))
return (train_summary, eval_collect_summary, (train_initialization,
eval_initialization))
else:
return (train_summary, None, (train_initialization,))
|
python
|
def _define_train(
train_env,
ppo_hparams,
eval_env_fn=None,
sampling_temp=1.0,
**collect_kwargs
):
"""Define the training setup."""
memory, collect_summary, train_initialization = (
_define_collect(
train_env,
ppo_hparams,
"ppo_train",
eval_phase=False,
sampling_temp=sampling_temp,
**collect_kwargs))
ppo_summary = ppo.define_ppo_epoch(
memory, ppo_hparams, train_env.action_space, train_env.batch_size)
train_summary = tf.summary.merge([collect_summary, ppo_summary])
if ppo_hparams.eval_every_epochs:
# TODO(koz4k): Do we need this at all?
assert eval_env_fn is not None
eval_env = eval_env_fn(in_graph=True)
(_, eval_collect_summary, eval_initialization) = (
_define_collect(
eval_env,
ppo_hparams,
"ppo_eval",
eval_phase=True,
sampling_temp=0.0,
**collect_kwargs))
return (train_summary, eval_collect_summary, (train_initialization,
eval_initialization))
else:
return (train_summary, None, (train_initialization,))
|
[
"def",
"_define_train",
"(",
"train_env",
",",
"ppo_hparams",
",",
"eval_env_fn",
"=",
"None",
",",
"sampling_temp",
"=",
"1.0",
",",
"*",
"*",
"collect_kwargs",
")",
":",
"memory",
",",
"collect_summary",
",",
"train_initialization",
"=",
"(",
"_define_collect",
"(",
"train_env",
",",
"ppo_hparams",
",",
"\"ppo_train\"",
",",
"eval_phase",
"=",
"False",
",",
"sampling_temp",
"=",
"sampling_temp",
",",
"*",
"*",
"collect_kwargs",
")",
")",
"ppo_summary",
"=",
"ppo",
".",
"define_ppo_epoch",
"(",
"memory",
",",
"ppo_hparams",
",",
"train_env",
".",
"action_space",
",",
"train_env",
".",
"batch_size",
")",
"train_summary",
"=",
"tf",
".",
"summary",
".",
"merge",
"(",
"[",
"collect_summary",
",",
"ppo_summary",
"]",
")",
"if",
"ppo_hparams",
".",
"eval_every_epochs",
":",
"# TODO(koz4k): Do we need this at all?",
"assert",
"eval_env_fn",
"is",
"not",
"None",
"eval_env",
"=",
"eval_env_fn",
"(",
"in_graph",
"=",
"True",
")",
"(",
"_",
",",
"eval_collect_summary",
",",
"eval_initialization",
")",
"=",
"(",
"_define_collect",
"(",
"eval_env",
",",
"ppo_hparams",
",",
"\"ppo_eval\"",
",",
"eval_phase",
"=",
"True",
",",
"sampling_temp",
"=",
"0.0",
",",
"*",
"*",
"collect_kwargs",
")",
")",
"return",
"(",
"train_summary",
",",
"eval_collect_summary",
",",
"(",
"train_initialization",
",",
"eval_initialization",
")",
")",
"else",
":",
"return",
"(",
"train_summary",
",",
"None",
",",
"(",
"train_initialization",
",",
")",
")"
] |
Define the training setup.
|
[
"Define",
"the",
"training",
"setup",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tens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0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b100110 + 0o12) + chr(7077 - 6966) + chr(63 - 12) + '\065' + '\061', 0b1000), ehT0Px3KOsy9(chr(0b1010 + 0o46) + '\x6f' + '\x33' + chr(392 - 343) + '\x31', ord("\x08")), ehT0Px3KOsy9('\060' + chr(8307 - 8196) + '\x33' + '\061' + chr(0b101011 + 0o10), 11684 - 11676), ehT0Px3KOsy9(chr(0b0 + 0o60) + chr(1186 - 1075) + chr(1106 - 1057) + '\066', 57175 - 57167), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b11100 + 0o27) + '\060' + '\x37', 0o10), ehT0Px3KOsy9('\060' + chr(2295 - 2184) + chr(2316 - 2263) + '\062', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\063' + chr(0b0 + 0o61) + '\x33', 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110001) + '\x35' + chr(1419 - 1370), 0b1000), ehT0Px3KOsy9(chr(2072 - 2024) + chr(5238 - 5127) + chr(0b110010) + chr(0b110011) + chr(2346 - 2292), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b11100 + 0o27) + chr(1985 - 1934) + chr(2064 - 2010), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b11101 + 0o122) + '\062' + '\060' + '\061', 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + '\061' + chr(0b11001 + 0o34) + chr(0b1011 + 0o52), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b11011 + 0o27) + chr(0b110101) + chr(0b110100), 53524 - 53516), ehT0Px3KOsy9(chr(0b110000) + chr(6750 - 6639) + chr(49) + '\x32' + chr(50), 16147 - 16139), ehT0Px3KOsy9(chr(0b10001 + 0o37) + '\x6f' + '\x35' + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(84 - 36) + '\x6f' + '\063' + '\067' + chr(52), 37561 - 37553), ehT0Px3KOsy9('\060' + '\x6f' + '\x31' + chr(50) + chr(1109 - 1056), 0b1000), ehT0Px3KOsy9('\x30' + chr(8019 - 7908) + '\x33', 0b1000), ehT0Px3KOsy9('\x30' + chr(9086 - 8975) + chr(0b100101 + 0o14) + chr(0b110111) + '\065', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b101100 + 0o6) + chr(0b100010 + 0o21) + chr(1205 - 1153), 14442 - 14434), ehT0Px3KOsy9(chr(2100 - 2052) + '\x6f' + '\064' + '\x31', 0b1000), ehT0Px3KOsy9('\x30' + chr(5326 - 5215) + chr(0b11000 + 0o32) + chr(52) + chr(50), 38081 - 38073), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110010) + chr(49) + chr(1969 - 1915), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(1099 - 1048) + chr(0b11010 + 0o32) + chr(0b100001 + 0o21), ord("\x08")), ehT0Px3KOsy9(chr(0b101011 + 0o5) + chr(111) + '\x31', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(324 - 213) + chr(51) + chr(0b101101 + 0o7) + '\x36', 57528 - 57520), ehT0Px3KOsy9('\x30' + chr(111) + chr(51) + chr(0b110010) + chr(701 - 651), 38287 - 38279), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(2122 - 2073) + chr(2109 - 2056) + '\x30', 1535 - 1527), ehT0Px3KOsy9(chr(48) + '\157' + '\x32' + chr(0b110111) + chr(1940 - 1891), 60013 - 60005), ehT0Px3KOsy9('\x30' + chr(111) + '\063' + chr(885 - 835) + chr(0b110001), 16056 - 16048), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b10100 + 0o36) + chr(53) + '\063', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(1126 - 1075) + chr(0b101010 + 0o12) + '\x32', 8), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\063' + '\x30', 63056 - 63048), ehT0Px3KOsy9(chr(1182 - 1134) + chr(0b1101111) + '\x32' + chr(1080 - 1025) + chr(2424 - 2372), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + '\x36' + '\063', 0b1000), ehT0Px3KOsy9(chr(0b1100 + 0o44) + chr(7250 - 7139) + '\062' + chr(0b110010) + '\x37', 0b1000), ehT0Px3KOsy9(chr(0b100010 + 0o16) + '\x6f' + chr(0b10100 + 0o37) + chr(1148 - 1094) + chr(49), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(5591 - 5480) + chr(0b110111) + chr(0b110110), 56202 - 56194), ehT0Px3KOsy9('\060' + chr(9073 - 8962) + '\x31' + chr(2803 - 2748) + '\064', 0b1000), ehT0Px3KOsy9(chr(563 - 515) + chr(111) + '\061' + chr(53) + '\x33', 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(643 - 595) + chr(11067 - 10956) + chr(0b10 + 0o63) + chr(48), 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xc7'), chr(0b10 + 0o142) + '\x65' + chr(8108 - 8009) + '\x6f' + chr(0b1100100) + chr(101))(chr(0b1110101) + chr(0b1011101 + 0o27) + chr(0b1100110) + '\x2d' + chr(56)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def AtnSGIADX26R(M1Bu76tdkXOZ, BnONC1WXyHAo, mEPUNDsH90eE=None, Ep30xVZP6Jij=1.0, **QXN5vcnT8nT9):
(KcR7WgfLppqF, u_xv32h8BITM, Cgygng4Z7Pxw) = YlhivnUUnZWX(M1Bu76tdkXOZ, BnONC1WXyHAo, xafqLlk3kkUe(SXOLrMavuUCe(b'\x99\xb9\xa4Q\xb3X\xaa\x00\xf0'), '\144' + chr(0b1100101 + 0o0) + '\143' + chr(0b1101111) + chr(9405 - 9305) + chr(0b1100 + 0o131))(chr(117) + chr(116) + '\146' + chr(614 - 569) + chr(2182 - 2126)), eval_phase=ehT0Px3KOsy9(chr(48) + chr(111) + '\x30', ord("\x08")), sampling_temp=Ep30xVZP6Jij, **QXN5vcnT8nT9)
i19Yb1w59i79 = i4a5yzjkTpUg.define_ppo_epoch(KcR7WgfLppqF, BnONC1WXyHAo, M1Bu76tdkXOZ.action_space, M1Bu76tdkXOZ.ix9dZyeAmUxY)
R8kQqQIfR4HN = IDJ2eXGCBCDu.summary.mP5l0dPhBkus([u_xv32h8BITM, i19Yb1w59i79])
if xafqLlk3kkUe(BnONC1WXyHAo, xafqLlk3kkUe(SXOLrMavuUCe(b'\xa7\xf1\x89x\xafh\xf3^\xff\x88\xea)'), '\x64' + '\x65' + '\x63' + chr(3618 - 3507) + '\x64' + '\145')('\x75' + chr(0b11011 + 0o131) + chr(0b1100110) + chr(45) + chr(3117 - 3061))):
assert mEPUNDsH90eE is not None
dM9WAx7S56cW = mEPUNDsH90eE(in_graph=ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b100110 + 0o13), 8))
(VNGQdHSFPrso, Xv9c5Lf5vRS3, Vpgt8CkKIGAl) = YlhivnUUnZWX(dM9WAx7S56cW, BnONC1WXyHAo, xafqLlk3kkUe(SXOLrMavuUCe(b'\x99\xb9\xa4Q\xa2\\\xaa\x05'), chr(0b1101 + 0o127) + '\x65' + '\143' + chr(0b101100 + 0o103) + chr(3815 - 3715) + '\x65')(chr(0b100 + 0o161) + '\164' + '\146' + chr(0b10110 + 0o27) + '\x38'), eval_phase=ehT0Px3KOsy9('\060' + chr(8162 - 8051) + chr(49), 8), sampling_temp=0.0, **QXN5vcnT8nT9)
return (R8kQqQIfR4HN, Xv9c5Lf5vRS3, (Cgygng4Z7Pxw, Vpgt8CkKIGAl))
else:
return (R8kQqQIfR4HN, None, (Cgygng4Z7Pxw,))
|
tensorflow/tensor2tensor
|
tensor2tensor/rl/ppo_learner.py
|
_run_train
|
def _run_train(ppo_hparams,
event_dir,
model_dir,
restarter,
train_summary_op,
eval_summary_op,
initializers,
report_fn=None,
model_save_fn=None):
"""Train."""
summary_writer = tf.summary.FileWriter(
event_dir, graph=tf.get_default_graph(), flush_secs=60)
model_saver = tf.train.Saver(
tf.global_variables(ppo_hparams.policy_network + "/.*") +
tf.global_variables("training/" + ppo_hparams.policy_network + "/.*") +
# tf.global_variables("clean_scope.*") + # Needed for sharing params.
tf.global_variables("global_step") +
tf.global_variables("losses_avg.*") +
tf.global_variables("train_stats.*")
)
global_step = tf.train.get_or_create_global_step()
with tf.control_dependencies([tf.assign_add(global_step, 1)]):
train_summary_op = tf.identity(train_summary_op)
with tf.Session() as sess:
sess.run(tf.global_variables_initializer())
for initializer in initializers:
initializer(sess)
trainer_lib.restore_checkpoint(model_dir, model_saver, sess)
num_target_iterations = restarter.target_local_step
num_completed_iterations = num_target_iterations - restarter.steps_to_go
with restarter.training_loop():
for epoch_index in range(num_completed_iterations, num_target_iterations):
summary = sess.run(train_summary_op)
if summary_writer:
summary_writer.add_summary(summary, epoch_index)
if (ppo_hparams.eval_every_epochs and
epoch_index % ppo_hparams.eval_every_epochs == 0):
eval_summary = sess.run(eval_summary_op)
if summary_writer:
summary_writer.add_summary(eval_summary, epoch_index)
if report_fn:
summary_proto = tf.Summary()
summary_proto.ParseFromString(eval_summary)
for elem in summary_proto.value:
if "mean_score" in elem.tag:
report_fn(elem.simple_value, epoch_index)
break
if (model_saver and ppo_hparams.save_models_every_epochs and
(epoch_index % ppo_hparams.save_models_every_epochs == 0 or
(epoch_index + 1) == num_target_iterations)):
ckpt_path = os.path.join(
model_dir,
"model.ckpt-{}".format(tf.train.global_step(sess, global_step))
)
model_saver.save(sess, ckpt_path)
if model_save_fn:
model_save_fn(model_dir)
|
python
|
def _run_train(ppo_hparams,
event_dir,
model_dir,
restarter,
train_summary_op,
eval_summary_op,
initializers,
report_fn=None,
model_save_fn=None):
"""Train."""
summary_writer = tf.summary.FileWriter(
event_dir, graph=tf.get_default_graph(), flush_secs=60)
model_saver = tf.train.Saver(
tf.global_variables(ppo_hparams.policy_network + "/.*") +
tf.global_variables("training/" + ppo_hparams.policy_network + "/.*") +
# tf.global_variables("clean_scope.*") + # Needed for sharing params.
tf.global_variables("global_step") +
tf.global_variables("losses_avg.*") +
tf.global_variables("train_stats.*")
)
global_step = tf.train.get_or_create_global_step()
with tf.control_dependencies([tf.assign_add(global_step, 1)]):
train_summary_op = tf.identity(train_summary_op)
with tf.Session() as sess:
sess.run(tf.global_variables_initializer())
for initializer in initializers:
initializer(sess)
trainer_lib.restore_checkpoint(model_dir, model_saver, sess)
num_target_iterations = restarter.target_local_step
num_completed_iterations = num_target_iterations - restarter.steps_to_go
with restarter.training_loop():
for epoch_index in range(num_completed_iterations, num_target_iterations):
summary = sess.run(train_summary_op)
if summary_writer:
summary_writer.add_summary(summary, epoch_index)
if (ppo_hparams.eval_every_epochs and
epoch_index % ppo_hparams.eval_every_epochs == 0):
eval_summary = sess.run(eval_summary_op)
if summary_writer:
summary_writer.add_summary(eval_summary, epoch_index)
if report_fn:
summary_proto = tf.Summary()
summary_proto.ParseFromString(eval_summary)
for elem in summary_proto.value:
if "mean_score" in elem.tag:
report_fn(elem.simple_value, epoch_index)
break
if (model_saver and ppo_hparams.save_models_every_epochs and
(epoch_index % ppo_hparams.save_models_every_epochs == 0 or
(epoch_index + 1) == num_target_iterations)):
ckpt_path = os.path.join(
model_dir,
"model.ckpt-{}".format(tf.train.global_step(sess, global_step))
)
model_saver.save(sess, ckpt_path)
if model_save_fn:
model_save_fn(model_dir)
|
[
"def",
"_run_train",
"(",
"ppo_hparams",
",",
"event_dir",
",",
"model_dir",
",",
"restarter",
",",
"train_summary_op",
",",
"eval_summary_op",
",",
"initializers",
",",
"report_fn",
"=",
"None",
",",
"model_save_fn",
"=",
"None",
")",
":",
"summary_writer",
"=",
"tf",
".",
"summary",
".",
"FileWriter",
"(",
"event_dir",
",",
"graph",
"=",
"tf",
".",
"get_default_graph",
"(",
")",
",",
"flush_secs",
"=",
"60",
")",
"model_saver",
"=",
"tf",
".",
"train",
".",
"Saver",
"(",
"tf",
".",
"global_variables",
"(",
"ppo_hparams",
".",
"policy_network",
"+",
"\"/.*\"",
")",
"+",
"tf",
".",
"global_variables",
"(",
"\"training/\"",
"+",
"ppo_hparams",
".",
"policy_network",
"+",
"\"/.*\"",
")",
"+",
"# tf.global_variables(\"clean_scope.*\") + # Needed for sharing params.",
"tf",
".",
"global_variables",
"(",
"\"global_step\"",
")",
"+",
"tf",
".",
"global_variables",
"(",
"\"losses_avg.*\"",
")",
"+",
"tf",
".",
"global_variables",
"(",
"\"train_stats.*\"",
")",
")",
"global_step",
"=",
"tf",
".",
"train",
".",
"get_or_create_global_step",
"(",
")",
"with",
"tf",
".",
"control_dependencies",
"(",
"[",
"tf",
".",
"assign_add",
"(",
"global_step",
",",
"1",
")",
"]",
")",
":",
"train_summary_op",
"=",
"tf",
".",
"identity",
"(",
"train_summary_op",
")",
"with",
"tf",
".",
"Session",
"(",
")",
"as",
"sess",
":",
"sess",
".",
"run",
"(",
"tf",
".",
"global_variables_initializer",
"(",
")",
")",
"for",
"initializer",
"in",
"initializers",
":",
"initializer",
"(",
"sess",
")",
"trainer_lib",
".",
"restore_checkpoint",
"(",
"model_dir",
",",
"model_saver",
",",
"sess",
")",
"num_target_iterations",
"=",
"restarter",
".",
"target_local_step",
"num_completed_iterations",
"=",
"num_target_iterations",
"-",
"restarter",
".",
"steps_to_go",
"with",
"restarter",
".",
"training_loop",
"(",
")",
":",
"for",
"epoch_index",
"in",
"range",
"(",
"num_completed_iterations",
",",
"num_target_iterations",
")",
":",
"summary",
"=",
"sess",
".",
"run",
"(",
"train_summary_op",
")",
"if",
"summary_writer",
":",
"summary_writer",
".",
"add_summary",
"(",
"summary",
",",
"epoch_index",
")",
"if",
"(",
"ppo_hparams",
".",
"eval_every_epochs",
"and",
"epoch_index",
"%",
"ppo_hparams",
".",
"eval_every_epochs",
"==",
"0",
")",
":",
"eval_summary",
"=",
"sess",
".",
"run",
"(",
"eval_summary_op",
")",
"if",
"summary_writer",
":",
"summary_writer",
".",
"add_summary",
"(",
"eval_summary",
",",
"epoch_index",
")",
"if",
"report_fn",
":",
"summary_proto",
"=",
"tf",
".",
"Summary",
"(",
")",
"summary_proto",
".",
"ParseFromString",
"(",
"eval_summary",
")",
"for",
"elem",
"in",
"summary_proto",
".",
"value",
":",
"if",
"\"mean_score\"",
"in",
"elem",
".",
"tag",
":",
"report_fn",
"(",
"elem",
".",
"simple_value",
",",
"epoch_index",
")",
"break",
"if",
"(",
"model_saver",
"and",
"ppo_hparams",
".",
"save_models_every_epochs",
"and",
"(",
"epoch_index",
"%",
"ppo_hparams",
".",
"save_models_every_epochs",
"==",
"0",
"or",
"(",
"epoch_index",
"+",
"1",
")",
"==",
"num_target_iterations",
")",
")",
":",
"ckpt_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"model_dir",
",",
"\"model.ckpt-{}\"",
".",
"format",
"(",
"tf",
".",
"train",
".",
"global_step",
"(",
"sess",
",",
"global_step",
")",
")",
")",
"model_saver",
".",
"save",
"(",
"sess",
",",
"ckpt_path",
")",
"if",
"model_save_fn",
":",
"model_save_fn",
"(",
"model_dir",
")"
] |
Train.
|
[
"Train",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/rl/ppo_learner.py#L189-L251
|
train
|
Train.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T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X,MCqssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(91 - 42) + '\065' + chr(49), 48526 - 48518), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b101001 + 0o15) + chr(2012 - 1957), 0b1000), ehT0Px3KOsy9(chr(0b110000 + 0o0) + '\x6f' + '\062' + '\x37' + '\x31', 36221 - 36213), ehT0Px3KOsy9(chr(491 - 443) + chr(0b1010 + 0o145) + chr(51) + chr(0b101000 + 0o17) + '\x36', 44464 - 44456), ehT0Px3KOsy9('\x30' + chr(0b100001 + 0o116) + '\x31' + chr(0b111 + 0o54) + chr(0b110111), 0b1000), ehT0Px3KOsy9('\060' + chr(0b100011 + 0o114) + chr(51) + chr(0b110000) + chr(51), 0o10), ehT0Px3KOsy9(chr(0b101000 + 0o10) + chr(111) + chr(2204 - 2155) + '\x34' + chr(0b11110 + 0o23), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + '\x31' + chr(0b110000 + 0o6) + chr(0b110010), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110101) + chr(0b10010 + 0o36), 27206 - 27198), ehT0Px3KOsy9('\060' + chr(2720 - 2609) + chr(484 - 435) + chr(1703 - 1655) + chr(0b110110), 0b1000), ehT0Px3KOsy9(chr(0b100011 + 0o15) + chr(0b1101000 + 0o7) + '\063' + '\x34', 4257 - 4249), ehT0Px3KOsy9('\x30' + '\x6f' + chr(429 - 376) + chr(0b110000), 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b1010111 + 0o30) + '\062' + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(0b1010 + 0o46) + '\x6f' + '\061' + '\x35', 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + '\061' + chr(0b110100) + chr(0b101011 + 0o6), 8), ehT0Px3KOsy9(chr(1348 - 1300) + '\157' + chr(0b110101) + chr(1441 - 1386), 0o10), ehT0Px3KOsy9(chr(261 - 213) + chr(0b1101111) + chr(0b110010) + chr(1570 - 1519) + '\x32', 0o10), ehT0Px3KOsy9('\060' + '\157' + '\061' + chr(0b110110) + chr(0b110001 + 0o5), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + '\064' + chr(1412 - 1363), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110001) + chr(1561 - 1511) + '\x37', ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(51) + chr(0b110001) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9(chr(0b100010 + 0o16) + chr(0b100101 + 0o112) + chr(0b11101 + 0o25) + '\x30' + chr(494 - 440), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110011) + chr(0b1000 + 0o52) + '\062', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b101111 + 0o100) + chr(0b10101 + 0o35) + chr(0b110 + 0o57), 37973 - 37965), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x33' + chr(0b101010 + 0o10) + chr(55), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(51) + chr(1228 - 1174) + chr(0b110010), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b111 + 0o53) + '\060' + '\x32', 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(49) + '\x35' + chr(0b110101), 0o10), ehT0Px3KOsy9('\x30' + chr(8886 - 8775) + chr(0b110010) + '\x36' + chr(0b101 + 0o53), 62583 - 62575), ehT0Px3KOsy9(chr(0b11111 + 0o21) + '\157' + '\x31' + '\x32' + '\060', 16027 - 16019), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110011) + chr(0b110001) + chr(49), ord("\x08")), ehT0Px3KOsy9(chr(1308 - 1260) + chr(0b1101111) + chr(52) + chr(2393 - 2341), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110111) + chr(53), ord("\x08")), ehT0Px3KOsy9(chr(0b100111 + 0o11) + chr(0b1101111) + chr(0b110001) + chr(1361 - 1308) + chr(0b100010 + 0o23), 8), ehT0Px3KOsy9(chr(1962 - 1914) + '\157' + '\x33' + chr(0b110011) + chr(1032 - 981), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\067' + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(0b10110 + 0o32) + chr(0b1101111) + chr(0b100101 + 0o14) + '\061' + chr(0b110010), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(11416 - 11305) + chr(122 - 72) + chr(0b1010 + 0o51), 0o10), ehT0Px3KOsy9(chr(505 - 457) + '\x6f' + '\x31' + '\x32' + chr(1969 - 1920), 0o10), ehT0Px3KOsy9(chr(48) + chr(8153 - 8042) + chr(51) + chr(0b110110) + chr(0b110111), 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + chr(0b1101111) + '\065' + chr(48), 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'G'), chr(2299 - 2199) + chr(0b111011 + 0o52) + chr(99) + '\157' + '\x64' + '\145')(chr(0b1101001 + 0o14) + chr(0b1110100) + chr(0b1 + 0o145) + '\x2d' + '\070') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def Iigcb6Tem2cV(BnONC1WXyHAo, _qkMyi7xY23I, kwWCbiWUCezq, vQBi6leoJfJ0, HbRL8ynMAf7O, Lhu1I9mjidN_, jZBKAEEWFBZB, FRqNoLmvqdQl=None, RM9Oav02ub6G=None):
S5uPA4n8ItHK = IDJ2eXGCBCDu.summary.FileWriter(_qkMyi7xY23I, graph=IDJ2eXGCBCDu.r65BlV_ohviI(), flush_secs=ehT0Px3KOsy9(chr(0b110000) + chr(0b11110 + 0o121) + chr(2493 - 2438) + '\x34', ord("\x08")))
Cly6JZ1oEvPk = IDJ2eXGCBCDu.train.Saver(IDJ2eXGCBCDu.global_variables(BnONC1WXyHAo.c2VHuW1Ajc2l + xafqLlk3kkUe(SXOLrMavuUCe(b'F\x19\x93'), '\144' + chr(3032 - 2931) + '\143' + chr(466 - 355) + chr(6507 - 6407) + '\x65')('\165' + chr(0b1110100) + chr(0b1100110) + chr(0b1010 + 0o43) + chr(56))) + IDJ2eXGCBCDu.global_variables(xafqLlk3kkUe(SXOLrMavuUCe(b'\x1dE\xd8\x971\xaa\x0f\x15\x07'), chr(100) + chr(0b1010 + 0o133) + chr(7229 - 7130) + chr(111) + chr(258 - 158) + '\x65')(chr(0b101000 + 0o115) + '\164' + '\146' + chr(0b101101) + '\070') + BnONC1WXyHAo.c2VHuW1Ajc2l + xafqLlk3kkUe(SXOLrMavuUCe(b'F\x19\x93'), chr(6859 - 6759) + '\145' + '\143' + chr(0b11010 + 0o125) + '\144' + '\145')(chr(0b1100000 + 0o25) + '\164' + chr(6508 - 6406) + chr(1445 - 1400) + chr(0b110111 + 0o1))) + IDJ2eXGCBCDu.global_variables(xafqLlk3kkUe(SXOLrMavuUCe(b'\x0e[\xd6\x9c>\xaf>\x01\\#l'), chr(0b1011110 + 0o6) + chr(101) + chr(2071 - 1972) + chr(111) + chr(3736 - 3636) + chr(0b1010101 + 0o20))('\165' + chr(0b1110100) + '\x66' + chr(45) + chr(0b111000))) + IDJ2eXGCBCDu.global_variables(xafqLlk3kkUe(SXOLrMavuUCe(b'\x05X\xca\x8d:\xb0>\x13^!2\x02'), chr(0b10110 + 0o116) + '\145' + '\143' + chr(0b1101111) + chr(100) + chr(0b1100101))(chr(0b1110101) + chr(0b1110011 + 0o1) + chr(9619 - 9517) + chr(45) + chr(0b101110 + 0o12))) + IDJ2eXGCBCDu.global_variables(xafqLlk3kkUe(SXOLrMavuUCe(b'\x1dE\xd8\x971\x9c\x12\x06I2o\x06>'), chr(0b1010001 + 0o23) + chr(0b111011 + 0o52) + chr(0b111010 + 0o51) + '\x6f' + chr(0b111100 + 0o50) + '\145')('\x75' + chr(0b0 + 0o164) + chr(102) + chr(45) + '\070')))
tnqEWmPx71Oj = IDJ2eXGCBCDu.train.get_or_create_global_step()
with xafqLlk3kkUe(IDJ2eXGCBCDu, xafqLlk3kkUe(SXOLrMavuUCe(b'\nX\xd7\x8a-\xac\r-L#lMzi\x04A\xf9\x1fD$'), chr(100) + chr(101) + '\143' + '\x6f' + chr(8637 - 8537) + chr(0b1100101))('\x75' + chr(0b10101 + 0o137) + chr(0b111000 + 0o56) + chr(0b101101) + '\070'))([xafqLlk3kkUe(IDJ2eXGCBCDu, xafqLlk3kkUe(SXOLrMavuUCe(b'\x08D\xca\x978\xad>\x13L"'), chr(3887 - 3787) + '\145' + chr(99) + '\157' + chr(0b1000 + 0o134) + chr(0b1100101))(chr(13666 - 13549) + chr(0b1110100) + chr(102) + '\x2d' + '\070'))(tnqEWmPx71Oj, ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\061', ord("\x08")))]):
HbRL8ynMAf7O = IDJ2eXGCBCDu.vFUG5mKXcvYG(HbRL8ynMAf7O)
with xafqLlk3kkUe(IDJ2eXGCBCDu, xafqLlk3kkUe(SXOLrMavuUCe(b':R\xca\x8d6\xac\x0f'), '\144' + '\145' + '\143' + chr(0b111010 + 0o65) + chr(100) + chr(0b1100101))(chr(117) + chr(116) + chr(0b1100110) + chr(0b111 + 0o46) + chr(56)))() as HVWCHjSQ2I35:
xafqLlk3kkUe(HVWCHjSQ2I35, xafqLlk3kkUe(SXOLrMavuUCe(b'\x1aP\xcd\xcb\x1d\x96WCJ1F\x1a'), '\144' + chr(0b1100101) + chr(7025 - 6926) + chr(0b1101111) + chr(0b1100100) + chr(0b1100101))('\165' + chr(0b1010001 + 0o43) + chr(102) + '\x2d' + chr(3017 - 2961)))(xafqLlk3kkUe(IDJ2eXGCBCDu, xafqLlk3kkUe(SXOLrMavuUCe(b'\x0e[\xd6\x9c>\xaf>\x04I4uIva\x04\\\xc5\x1fO>\xb8\xef\xb3y\xbe\x88\xe7\x1f'), chr(0b1001001 + 0o33) + chr(10155 - 10054) + '\x63' + chr(0b1101111) + '\144' + '\145')(chr(0b1000000 + 0o65) + chr(116) + '\x66' + chr(0b10 + 0o53) + chr(0b110001 + 0o7)))())
for kwfuYzkY5C57 in jZBKAEEWFBZB:
kwfuYzkY5C57(HVWCHjSQ2I35)
xafqLlk3kkUe(KvtIAVGi33Ty, xafqLlk3kkUe(SXOLrMavuUCe(b'\x1bR\xca\x8a0\xb1\x04-K.yK\x7f}\x0eF\xf4\x02'), '\144' + chr(10165 - 10064) + chr(0b11101 + 0o106) + '\157' + chr(0b1100100) + chr(0b1010000 + 0o25))(chr(11038 - 10921) + '\164' + '\146' + chr(0b100111 + 0o6) + '\070'))(kwWCbiWUCezq, Cly6JZ1oEvPk, HVWCHjSQ2I35)
an_Q7QegFdX2 = vQBi6leoJfJ0.target_local_step
pu83SXsYnPZa = an_Q7QegFdX2 - vQBi6leoJfJ0.steps_to_go
with xafqLlk3kkUe(vQBi6leoJfJ0, xafqLlk3kkUe(SXOLrMavuUCe(b'\x1dE\xd8\x971\xaa\x0f\x15w*sGd'), chr(0b1000110 + 0o36) + chr(0b1100101) + chr(0b1011100 + 0o7) + chr(111) + '\x64' + '\x65')('\165' + chr(0b101110 + 0o106) + '\146' + '\055' + chr(56)))():
for JBKT2vJV6p6O in vQr8gNKaIaWE(pu83SXsYnPZa, an_Q7QegFdX2):
oLgyQ45ORWXM = HVWCHjSQ2I35.sgt5BU61bwZ2(HbRL8ynMAf7O)
if S5uPA4n8ItHK:
xafqLlk3kkUe(S5uPA4n8ItHK, xafqLlk3kkUe(SXOLrMavuUCe(b'\x08S\xdd\xa1,\xb6\x0c\x1fI4e'), chr(1733 - 1633) + '\145' + '\x63' + chr(111) + chr(0b1100100) + chr(101))('\165' + chr(0b1001 + 0o153) + '\146' + '\x2d' + '\070'))(oLgyQ45ORWXM, JBKT2vJV6p6O)
if xafqLlk3kkUe(BnONC1WXyHAo, xafqLlk3kkUe(SXOLrMavuUCe(b"'\x0f\xfb\x887\x81YEI\x10wl"), '\144' + chr(8148 - 8047) + chr(9014 - 8915) + chr(7049 - 6938) + chr(100) + chr(0b1100101))('\165' + chr(13083 - 12967) + chr(8233 - 8131) + '\055' + chr(2873 - 2817))) and JBKT2vJV6p6O % xafqLlk3kkUe(BnONC1WXyHAo, xafqLlk3kkUe(SXOLrMavuUCe(b"'\x0f\xfb\x887\x81YEI\x10wl"), chr(9624 - 9524) + chr(0b111 + 0o136) + chr(0b1100011) + chr(0b1101111) + chr(0b1100100) + chr(2721 - 2620))(chr(117) + chr(0b1110100) + chr(0b1001111 + 0o27) + chr(45) + chr(1776 - 1720))) == ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(48), 0o10):
wvWUmvJ18X5a = HVWCHjSQ2I35.sgt5BU61bwZ2(Lhu1I9mjidN_)
if S5uPA4n8ItHK:
xafqLlk3kkUe(S5uPA4n8ItHK, xafqLlk3kkUe(SXOLrMavuUCe(b'\x08S\xdd\xa1,\xb6\x0c\x1fI4e'), chr(0b1100100) + chr(9547 - 9446) + '\143' + '\157' + chr(0b1100100) + '\145')(chr(117) + chr(4006 - 3890) + chr(102) + chr(0b100011 + 0o12) + chr(0b101100 + 0o14)))(wvWUmvJ18X5a, JBKT2vJV6p6O)
if FRqNoLmvqdQl:
ufRbACLmOZLl = IDJ2eXGCBCDu.Summary()
xafqLlk3kkUe(ufRbACLmOZLl, xafqLlk3kkUe(SXOLrMavuUCe(b'9V\xcb\x8d:\x85\x13\x1dE\x15hZ}c\x06'), chr(100) + '\x65' + '\143' + chr(111) + chr(0b1100100) + chr(7003 - 6902))(chr(7617 - 7500) + chr(5462 - 5346) + chr(0b1100110) + '\x2d' + chr(56)))(wvWUmvJ18X5a)
for uOlx0jSIY8kc in xafqLlk3kkUe(ufRbACLmOZLl, xafqLlk3kkUe(SXOLrMavuUCe(b'8Z\xd4\x99\x08\x96#C\x1b\x10_b'), '\x64' + chr(0b110001 + 0o64) + '\143' + chr(0b1101111) + chr(100) + '\145')(chr(0b1110100 + 0o1) + chr(0b1100111 + 0o15) + chr(102) + chr(0b101101) + '\x38')):
if xafqLlk3kkUe(SXOLrMavuUCe(b'\x04R\xd8\x90\x00\xb0\x02\x1dZ#'), chr(100) + chr(101) + chr(99) + chr(0b1101111) + chr(0b1100100) + chr(0b1100101))(chr(117) + chr(116) + '\x66' + '\055' + '\x38') in xafqLlk3kkUe(uOlx0jSIY8kc, xafqLlk3kkUe(SXOLrMavuUCe(b'\x1dV\xde'), chr(0b101 + 0o137) + chr(0b1100101) + chr(0b1100 + 0o127) + '\157' + '\x64' + chr(0b1010110 + 0o17))('\x75' + chr(116) + '\146' + chr(45) + chr(1097 - 1041))):
FRqNoLmvqdQl(xafqLlk3kkUe(uOlx0jSIY8kc, xafqLlk3kkUe(SXOLrMavuUCe(b'\x1a^\xd4\x8e3\xa6>\x04I*iM'), '\144' + chr(0b1000010 + 0o43) + '\x63' + '\x6f' + '\144' + chr(101))(chr(0b1110101) + '\164' + '\x66' + chr(45) + chr(1475 - 1419))), JBKT2vJV6p6O)
break
if Cly6JZ1oEvPk and xafqLlk3kkUe(BnONC1WXyHAo, xafqLlk3kkUe(SXOLrMavuUCe(b'\x1ee\xcb\x88\x1c\xa4\x16A\x1eqEZ'), chr(100) + chr(0b1010010 + 0o23) + '\143' + chr(0b1101111) + chr(8267 - 8167) + chr(8781 - 8680))(chr(2154 - 2037) + '\x74' + '\x66' + chr(1909 - 1864) + chr(0b111000))) and (JBKT2vJV6p6O % xafqLlk3kkUe(BnONC1WXyHAo, xafqLlk3kkUe(SXOLrMavuUCe(b'\x1ee\xcb\x88\x1c\xa4\x16A\x1eqEZ'), '\144' + '\x65' + chr(99) + chr(111) + chr(0b1100100) + '\x65')(chr(117) + chr(0b1101 + 0o147) + chr(0b1100110) + '\x2d' + '\070')) == ehT0Px3KOsy9(chr(0b110000) + chr(4413 - 4302) + chr(0b101 + 0o53), 8) or JBKT2vJV6p6O + ehT0Px3KOsy9(chr(0b11010 + 0o26) + chr(5002 - 4891) + chr(49), 8) == an_Q7QegFdX2):
GWFmOaEx1yQ8 = oqhJDdMJfuwx.path.join(kwWCbiWUCezq, xafqLlk3kkUe(SXOLrMavuUCe(b'\x04X\xdd\x9b3\xed\x02\x19X21Si'), chr(0b1100100) + '\145' + chr(0b10001 + 0o122) + chr(12053 - 11942) + chr(0b1001000 + 0o34) + chr(101))(chr(0b1011 + 0o152) + chr(4515 - 4399) + chr(102) + '\x2d' + chr(56)).V4roHaS3Ppej(IDJ2eXGCBCDu.train.global_step(HVWCHjSQ2I35, tnqEWmPx71Oj)))
xafqLlk3kkUe(Cly6JZ1oEvPk, xafqLlk3kkUe(SXOLrMavuUCe(b'\x1aV\xcf\x9b'), '\x64' + chr(0b100101 + 0o100) + '\143' + chr(111) + chr(100) + '\x65')(chr(11954 - 11837) + '\164' + '\146' + chr(0b101101) + chr(0b11100 + 0o34)))(HVWCHjSQ2I35, GWFmOaEx1yQ8)
if RM9Oav02ub6G:
RM9Oav02ub6G(kwWCbiWUCezq)
|
tensorflow/tensor2tensor
|
tensor2tensor/rl/ppo_learner.py
|
_rollout_metadata
|
def _rollout_metadata(batch_env):
"""Metadata for rollouts."""
batch_env_shape = batch_env.observ.get_shape().as_list()
batch_size = [batch_env_shape[0]]
shapes_types_names = [
# TODO(piotrmilos): possibly retrieve the observation type for batch_env
(batch_size + batch_env_shape[1:], batch_env.observ_dtype, "observation"),
(batch_size, tf.float32, "reward"),
(batch_size, tf.bool, "done"),
(batch_size + list(batch_env.action_shape), batch_env.action_dtype,
"action"),
(batch_size, tf.float32, "pdf"),
(batch_size, tf.float32, "value_function"),
]
return shapes_types_names
|
python
|
def _rollout_metadata(batch_env):
"""Metadata for rollouts."""
batch_env_shape = batch_env.observ.get_shape().as_list()
batch_size = [batch_env_shape[0]]
shapes_types_names = [
# TODO(piotrmilos): possibly retrieve the observation type for batch_env
(batch_size + batch_env_shape[1:], batch_env.observ_dtype, "observation"),
(batch_size, tf.float32, "reward"),
(batch_size, tf.bool, "done"),
(batch_size + list(batch_env.action_shape), batch_env.action_dtype,
"action"),
(batch_size, tf.float32, "pdf"),
(batch_size, tf.float32, "value_function"),
]
return shapes_types_names
|
[
"def",
"_rollout_metadata",
"(",
"batch_env",
")",
":",
"batch_env_shape",
"=",
"batch_env",
".",
"observ",
".",
"get_shape",
"(",
")",
".",
"as_list",
"(",
")",
"batch_size",
"=",
"[",
"batch_env_shape",
"[",
"0",
"]",
"]",
"shapes_types_names",
"=",
"[",
"# TODO(piotrmilos): possibly retrieve the observation type for batch_env",
"(",
"batch_size",
"+",
"batch_env_shape",
"[",
"1",
":",
"]",
",",
"batch_env",
".",
"observ_dtype",
",",
"\"observation\"",
")",
",",
"(",
"batch_size",
",",
"tf",
".",
"float32",
",",
"\"reward\"",
")",
",",
"(",
"batch_size",
",",
"tf",
".",
"bool",
",",
"\"done\"",
")",
",",
"(",
"batch_size",
"+",
"list",
"(",
"batch_env",
".",
"action_shape",
")",
",",
"batch_env",
".",
"action_dtype",
",",
"\"action\"",
")",
",",
"(",
"batch_size",
",",
"tf",
".",
"float32",
",",
"\"pdf\"",
")",
",",
"(",
"batch_size",
",",
"tf",
".",
"float32",
",",
"\"value_function\"",
")",
",",
"]",
"return",
"shapes_types_names"
] |
Metadata for rollouts.
|
[
"Metadata",
"for",
"rollouts",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/rl/ppo_learner.py#L254-L268
|
train
|
Metadata for rollouts.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_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tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(876 - 821) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110011) + '\066' + chr(2449 - 2398), 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(0b110010) + chr(0b100011 + 0o22), 0b1000), ehT0Px3KOsy9(chr(0b101010 + 0o6) + '\157' + chr(0b110111) + '\x32', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x32' + chr(0b100 + 0o62) + '\067', 25535 - 25527), ehT0Px3KOsy9(chr(48) + chr(0b100011 + 0o114) + chr(0b11010 + 0o31) + chr(0b110101) + chr(0b110111), 0o10), ehT0Px3KOsy9('\060' + chr(6169 - 6058) + chr(0b101001 + 0o11) + chr(446 - 397), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b1000 + 0o52) + '\x35' + chr(2013 - 1959), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110001) + '\x36' + '\x31', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(904 - 793) + chr(50) + chr(0b110000) + chr(2034 - 1985), 0b1000), ehT0Px3KOsy9(chr(0b101001 + 0o7) + chr(0b111011 + 0o64) + '\x32' + '\067', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\063' + '\x30', 4449 - 4441), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\062' + chr(53) + chr(0b110110), 8), ehT0Px3KOsy9(chr(48) + chr(111) + chr(50) + chr(54) + '\063', 0o10), ehT0Px3KOsy9(chr(283 - 235) + '\157' + '\064' + '\065', 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x31' + chr(139 - 86) + chr(51), 0b1000), ehT0Px3KOsy9(chr(2285 - 2237) + chr(0b1101111) + chr(0b100000 + 0o23) + chr(507 - 458) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(49) + chr(1666 - 1611) + '\064', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x31' + chr(51) + chr(0b101 + 0o60), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + chr(174 - 124) + chr(55) + chr(1446 - 1394), 11120 - 11112), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(2088 - 2039) + chr(2004 - 1956) + chr(0b10011 + 0o41), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(49) + '\x30' + chr(49), 0b1000), ehT0Px3KOsy9('\060' + chr(167 - 56) + chr(0b110001) + '\062' + chr(0b110101), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b10 + 0o57) + '\064' + '\x32', 29734 - 29726), ehT0Px3KOsy9(chr(0b111 + 0o51) + chr(111) + chr(0b110010) + '\x33' + '\067', 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(51) + '\x34' + chr(0b110001), 0o10), ehT0Px3KOsy9(chr(0b10000 + 0o40) + chr(0b1101111) + chr(0b110010) + chr(2764 - 2710) + chr(0b1010 + 0o51), 8), ehT0Px3KOsy9('\060' + '\x6f' + chr(49) + chr(0b100111 + 0o20) + chr(0b110110), 0b1000), ehT0Px3KOsy9(chr(1198 - 1150) + chr(0b1101111) + chr(50) + '\x30' + chr(2587 - 2534), 63801 - 63793), ehT0Px3KOsy9(chr(0b11111 + 0o21) + chr(6069 - 5958) + chr(49) + chr(49) + '\066', 0b1000), ehT0Px3KOsy9(chr(1967 - 1919) + chr(3409 - 3298) + chr(0b11001 + 0o30) + chr(992 - 938) + '\063', 48336 - 48328), ehT0Px3KOsy9(chr(113 - 65) + chr(8845 - 8734) + '\x31' + '\062', 0b1000), ehT0Px3KOsy9(chr(0b1100 + 0o44) + chr(0b101101 + 0o102) + chr(0b1110 + 0o44) + chr(1373 - 1322) + '\067', 8), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(49) + '\064' + chr(0b110101), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + chr(51) + chr(49) + chr(971 - 918), 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110010) + '\061' + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(0b1 + 0o57) + chr(0b1101111) + chr(0b11011 + 0o27) + chr(0b1 + 0o65) + chr(0b110111), 8), ehT0Px3KOsy9('\x30' + '\157' + '\x32' + chr(532 - 478) + chr(121 - 71), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + '\x32' + chr(0b101001 + 0o12) + '\x36', 41958 - 41950), ehT0Px3KOsy9('\060' + chr(111) + chr(51) + '\x32' + '\061', ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9(chr(712 - 664) + chr(0b11100 + 0o123) + chr(0b101101 + 0o10) + '\060', 0b1000)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\x11'), chr(0b1100100) + '\x65' + '\x63' + chr(111) + chr(100) + chr(0b1100101))('\165' + chr(116) + chr(0b111110 + 0o50) + chr(0b101101) + chr(2255 - 2199)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def UtB6eiIQOPar(XbEJqqD0tOyU):
nFerKKHQyHM3 = XbEJqqD0tOyU.observ.get_shape().as_list()
ix9dZyeAmUxY = [nFerKKHQyHM3[ehT0Px3KOsy9(chr(0b110000) + chr(0b1011010 + 0o25) + chr(0b0 + 0o60), 2696 - 2688)]]
zHeE9RZq4FSJ = [(ix9dZyeAmUxY + nFerKKHQyHM3[ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x31', 0o10):], XbEJqqD0tOyU.observ_dtype, xafqLlk3kkUe(SXOLrMavuUCe(b'P\x91f_\xc5\x99p\xda\x18\xeey'), chr(0b100011 + 0o101) + chr(101) + chr(9201 - 9102) + chr(0b110111 + 0o70) + '\144' + '\x65')(chr(0b110010 + 0o103) + chr(116) + '\x66' + chr(0b101101) + '\x38')), (ix9dZyeAmUxY, IDJ2eXGCBCDu.float32, xafqLlk3kkUe(SXOLrMavuUCe(b'M\x96b[\xc5\x8b'), '\144' + '\145' + '\143' + '\x6f' + chr(100) + chr(5430 - 5329))(chr(0b1000000 + 0o65) + chr(0b111010 + 0o72) + '\146' + chr(0b110 + 0o47) + chr(0b111000))), (ix9dZyeAmUxY, IDJ2eXGCBCDu.bool, xafqLlk3kkUe(SXOLrMavuUCe(b'[\x9c{_'), chr(100) + chr(101) + chr(0b1100011) + chr(0b1101111) + '\x64' + chr(0b1101 + 0o130))(chr(0b101010 + 0o113) + '\164' + chr(0b1000111 + 0o37) + chr(45) + '\x38')), (ix9dZyeAmUxY + YyaZ4tpXu4lf(XbEJqqD0tOyU.action_shape), XbEJqqD0tOyU.action_dtype, xafqLlk3kkUe(SXOLrMavuUCe(b'^\x90aS\xd8\x81'), chr(100) + chr(101) + chr(0b100011 + 0o100) + '\157' + chr(1419 - 1319) + '\145')('\x75' + '\164' + chr(0b1100110) + chr(181 - 136) + chr(478 - 422))), (ix9dZyeAmUxY, IDJ2eXGCBCDu.float32, xafqLlk3kkUe(SXOLrMavuUCe(b'O\x97s'), chr(3200 - 3100) + '\145' + chr(99) + chr(2423 - 2312) + chr(100) + chr(6572 - 6471))(chr(0b10 + 0o163) + '\x74' + '\146' + chr(45) + chr(0b1 + 0o67))), (ix9dZyeAmUxY, IDJ2eXGCBCDu.float32, xafqLlk3kkUe(SXOLrMavuUCe(b'I\x92yO\xd2\xb0w\xdb\x1f\xe2cq\xc1\xdd'), '\x64' + chr(4515 - 4414) + chr(0b1100011) + chr(0b100111 + 0o110) + chr(0b1100100) + '\145')(chr(117) + '\164' + '\x66' + chr(0b101101) + '\070'))]
return zHeE9RZq4FSJ
|
tensorflow/tensor2tensor
|
tensor2tensor/rl/ppo_learner.py
|
_define_collect
|
def _define_collect(batch_env, ppo_hparams, scope, frame_stack_size, eval_phase,
sampling_temp, force_beginning_resets):
"""Collect trajectories.
Args:
batch_env: Batch environment.
ppo_hparams: PPO hparams, defined in tensor2tensor.models.research.rl.
scope: var scope.
frame_stack_size: Number of last observations to feed into the policy.
eval_phase: TODO(koz4k): Write docstring.
sampling_temp: Sampling temperature for the policy.
force_beginning_resets: Whether to reset at the beginning of each episode.
Returns:
Returns memory (observations, rewards, dones, actions,
pdfs, values_functions)
containing a rollout of environment from nested wrapped structure.
"""
epoch_length = ppo_hparams.epoch_length
to_initialize = []
with tf.variable_scope(scope, reuse=tf.AUTO_REUSE):
num_agents = batch_env.batch_size
to_initialize.append(batch_env)
wrappers = [(StackWrapper, {
"history": frame_stack_size
}), (_MemoryWrapper, {})]
rollout_metadata = None
speculum = None
for w in wrappers:
tf.logging.info("Applying wrapper %s(%s) to env %s." % (str(
w[0]), str(w[1]), str(batch_env)))
batch_env = w[0](batch_env, **w[1])
to_initialize.append(batch_env)
rollout_metadata = _rollout_metadata(batch_env)
speculum = batch_env.speculum
def initialization_lambda(sess):
for batch_env in to_initialize:
batch_env.initialize(sess)
memory = [
tf.get_variable( # pylint: disable=g-complex-comprehension
"collect_memory_%d_%s" % (epoch_length, name),
shape=[epoch_length] + shape,
dtype=dtype,
initializer=tf.zeros_initializer(),
trainable=False) for (shape, dtype, name) in rollout_metadata
]
cumulative_rewards = tf.get_variable(
"cumulative_rewards", len(batch_env), trainable=False)
eval_phase_t = tf.convert_to_tensor(eval_phase)
should_reset_var = tf.Variable(True, trainable=False)
zeros_tensor = tf.zeros(len(batch_env))
force_beginning_resets = tf.convert_to_tensor(force_beginning_resets)
def reset_ops_group():
return tf.group(
batch_env.reset(tf.range(len(batch_env))),
tf.assign(cumulative_rewards, zeros_tensor))
reset_op = tf.cond(
tf.logical_or(should_reset_var.read_value(), force_beginning_resets),
reset_ops_group, tf.no_op)
with tf.control_dependencies([reset_op]):
reset_once_op = tf.assign(should_reset_var, False)
with tf.control_dependencies([reset_once_op]):
def step(index, scores_sum, scores_num):
"""Single step."""
index %= epoch_length # Only needed in eval runs.
# Note - the only way to ensure making a copy of tensor is to run simple
# operation. We are waiting for tf.copy:
# https://github.com/tensorflow/tensorflow/issues/11186
obs_copy = batch_env.observ + 0
def env_step(arg1, arg2, arg3): # pylint: disable=unused-argument
"""Step of the environment."""
(logits, value_function) = get_policy(
obs_copy, ppo_hparams, batch_env.action_space
)
action = common_layers.sample_with_temperature(logits, sampling_temp)
action = tf.cast(action, tf.int32)
action = tf.reshape(action, shape=(num_agents,))
reward, done = batch_env.simulate(action)
pdf = tfp.distributions.Categorical(logits=logits).prob(action)
pdf = tf.reshape(pdf, shape=(num_agents,))
value_function = tf.reshape(value_function, shape=(num_agents,))
done = tf.reshape(done, shape=(num_agents,))
with tf.control_dependencies([reward, done]):
return tf.identity(pdf), tf.identity(value_function), \
tf.identity(done)
# TODO(piotrmilos): while_body is executed at most once,
# thus should be replaced with tf.cond
pdf, value_function, top_level_done = tf.while_loop(
lambda _1, _2, _3: tf.equal(speculum.size(), 0),
env_step,
[
tf.constant(0.0, shape=(num_agents,)),
tf.constant(0.0, shape=(num_agents,)),
tf.constant(False, shape=(num_agents,))
],
parallel_iterations=1,
back_prop=False,
)
with tf.control_dependencies([pdf, value_function]):
obs, reward, done, action = speculum.dequeue()
to_save = [obs, reward, done, action, pdf, value_function]
save_ops = [
tf.scatter_update(memory_slot, index, value)
for memory_slot, value in zip(memory, to_save)
]
cumulate_rewards_op = cumulative_rewards.assign_add(reward)
agent_indices_to_reset = tf.where(top_level_done)[:, 0]
with tf.control_dependencies([cumulate_rewards_op]):
# TODO(piotrmilos): possibly we need cumulative_rewards.read_value()
scores_sum_delta = tf.reduce_sum(
tf.gather(cumulative_rewards.read_value(), agent_indices_to_reset))
scores_num_delta = tf.count_nonzero(done, dtype=tf.int32)
with tf.control_dependencies(save_ops +
[scores_sum_delta, scores_num_delta]):
reset_env_op = batch_env.reset(agent_indices_to_reset)
reset_cumulative_rewards_op = tf.scatter_update(
cumulative_rewards, agent_indices_to_reset,
tf.gather(zeros_tensor, agent_indices_to_reset))
with tf.control_dependencies([reset_env_op, reset_cumulative_rewards_op]):
return [
index + 1, scores_sum + scores_sum_delta,
scores_num + scores_num_delta
]
def stop_condition(i, _, resets):
return tf.cond(eval_phase_t, lambda: resets < num_agents,
lambda: i < epoch_length)
init = [tf.constant(0), tf.constant(0.0), tf.constant(0)]
index, scores_sum, scores_num = tf.while_loop(
stop_condition, step, init, parallel_iterations=1, back_prop=False)
# We handle force_beginning_resets differently. We assume that all envs are
# reseted at the end of episod (though it happens at the beginning of the
# next one
scores_num = tf.cond(force_beginning_resets,
lambda: scores_num + len(batch_env), lambda: scores_num)
with tf.control_dependencies([scores_sum]):
scores_sum = tf.cond(
force_beginning_resets,
lambda: scores_sum + tf.reduce_sum(cumulative_rewards.read_value()),
lambda: scores_sum)
mean_score = tf.cond(
tf.greater(scores_num, 0),
lambda: scores_sum / tf.cast(scores_num, tf.float32), lambda: 0.)
printing = tf.Print(0, [mean_score, scores_sum, scores_num], "mean_score: ")
with tf.control_dependencies([index, printing]):
memory = [mem.read_value() for mem in memory]
# When generating real data together with PPO training we must use single
# agent. For PPO to work we reshape the history, as if it was generated
# by real_ppo_effective_num_agents.
if ppo_hparams.effective_num_agents is not None and not eval_phase:
new_memory = []
effective_num_agents = ppo_hparams.effective_num_agents
assert epoch_length % ppo_hparams.effective_num_agents == 0, (
"The rollout of ppo_hparams.epoch_length will be distributed amongst"
"effective_num_agents of agents")
new_epoch_length = int(epoch_length / effective_num_agents)
for mem, info in zip(memory, rollout_metadata):
shape, _, name = info
new_shape = [effective_num_agents, new_epoch_length] + shape[1:]
perm = list(range(len(shape) + 1))
perm[0] = 1
perm[1] = 0
mem = tf.transpose(mem, perm=perm)
mem = tf.reshape(mem, shape=new_shape)
mem = tf.transpose(
mem,
perm=perm,
name="collect_memory_%d_%s" % (new_epoch_length, name))
new_memory.append(mem)
memory = new_memory
with tf.variable_scope(scope, reuse=tf.AUTO_REUSE):
mean_score_summary = tf.cond(
tf.greater(scores_num, 0),
lambda: tf.summary.scalar("mean_score_this_iter", mean_score), str)
summaries = tf.summary.merge([
mean_score_summary,
tf.summary.scalar("episodes_finished_this_iter", scores_num)
])
return memory, summaries, initialization_lambda
|
python
|
def _define_collect(batch_env, ppo_hparams, scope, frame_stack_size, eval_phase,
sampling_temp, force_beginning_resets):
"""Collect trajectories.
Args:
batch_env: Batch environment.
ppo_hparams: PPO hparams, defined in tensor2tensor.models.research.rl.
scope: var scope.
frame_stack_size: Number of last observations to feed into the policy.
eval_phase: TODO(koz4k): Write docstring.
sampling_temp: Sampling temperature for the policy.
force_beginning_resets: Whether to reset at the beginning of each episode.
Returns:
Returns memory (observations, rewards, dones, actions,
pdfs, values_functions)
containing a rollout of environment from nested wrapped structure.
"""
epoch_length = ppo_hparams.epoch_length
to_initialize = []
with tf.variable_scope(scope, reuse=tf.AUTO_REUSE):
num_agents = batch_env.batch_size
to_initialize.append(batch_env)
wrappers = [(StackWrapper, {
"history": frame_stack_size
}), (_MemoryWrapper, {})]
rollout_metadata = None
speculum = None
for w in wrappers:
tf.logging.info("Applying wrapper %s(%s) to env %s." % (str(
w[0]), str(w[1]), str(batch_env)))
batch_env = w[0](batch_env, **w[1])
to_initialize.append(batch_env)
rollout_metadata = _rollout_metadata(batch_env)
speculum = batch_env.speculum
def initialization_lambda(sess):
for batch_env in to_initialize:
batch_env.initialize(sess)
memory = [
tf.get_variable( # pylint: disable=g-complex-comprehension
"collect_memory_%d_%s" % (epoch_length, name),
shape=[epoch_length] + shape,
dtype=dtype,
initializer=tf.zeros_initializer(),
trainable=False) for (shape, dtype, name) in rollout_metadata
]
cumulative_rewards = tf.get_variable(
"cumulative_rewards", len(batch_env), trainable=False)
eval_phase_t = tf.convert_to_tensor(eval_phase)
should_reset_var = tf.Variable(True, trainable=False)
zeros_tensor = tf.zeros(len(batch_env))
force_beginning_resets = tf.convert_to_tensor(force_beginning_resets)
def reset_ops_group():
return tf.group(
batch_env.reset(tf.range(len(batch_env))),
tf.assign(cumulative_rewards, zeros_tensor))
reset_op = tf.cond(
tf.logical_or(should_reset_var.read_value(), force_beginning_resets),
reset_ops_group, tf.no_op)
with tf.control_dependencies([reset_op]):
reset_once_op = tf.assign(should_reset_var, False)
with tf.control_dependencies([reset_once_op]):
def step(index, scores_sum, scores_num):
"""Single step."""
index %= epoch_length # Only needed in eval runs.
# Note - the only way to ensure making a copy of tensor is to run simple
# operation. We are waiting for tf.copy:
# https://github.com/tensorflow/tensorflow/issues/11186
obs_copy = batch_env.observ + 0
def env_step(arg1, arg2, arg3): # pylint: disable=unused-argument
"""Step of the environment."""
(logits, value_function) = get_policy(
obs_copy, ppo_hparams, batch_env.action_space
)
action = common_layers.sample_with_temperature(logits, sampling_temp)
action = tf.cast(action, tf.int32)
action = tf.reshape(action, shape=(num_agents,))
reward, done = batch_env.simulate(action)
pdf = tfp.distributions.Categorical(logits=logits).prob(action)
pdf = tf.reshape(pdf, shape=(num_agents,))
value_function = tf.reshape(value_function, shape=(num_agents,))
done = tf.reshape(done, shape=(num_agents,))
with tf.control_dependencies([reward, done]):
return tf.identity(pdf), tf.identity(value_function), \
tf.identity(done)
# TODO(piotrmilos): while_body is executed at most once,
# thus should be replaced with tf.cond
pdf, value_function, top_level_done = tf.while_loop(
lambda _1, _2, _3: tf.equal(speculum.size(), 0),
env_step,
[
tf.constant(0.0, shape=(num_agents,)),
tf.constant(0.0, shape=(num_agents,)),
tf.constant(False, shape=(num_agents,))
],
parallel_iterations=1,
back_prop=False,
)
with tf.control_dependencies([pdf, value_function]):
obs, reward, done, action = speculum.dequeue()
to_save = [obs, reward, done, action, pdf, value_function]
save_ops = [
tf.scatter_update(memory_slot, index, value)
for memory_slot, value in zip(memory, to_save)
]
cumulate_rewards_op = cumulative_rewards.assign_add(reward)
agent_indices_to_reset = tf.where(top_level_done)[:, 0]
with tf.control_dependencies([cumulate_rewards_op]):
# TODO(piotrmilos): possibly we need cumulative_rewards.read_value()
scores_sum_delta = tf.reduce_sum(
tf.gather(cumulative_rewards.read_value(), agent_indices_to_reset))
scores_num_delta = tf.count_nonzero(done, dtype=tf.int32)
with tf.control_dependencies(save_ops +
[scores_sum_delta, scores_num_delta]):
reset_env_op = batch_env.reset(agent_indices_to_reset)
reset_cumulative_rewards_op = tf.scatter_update(
cumulative_rewards, agent_indices_to_reset,
tf.gather(zeros_tensor, agent_indices_to_reset))
with tf.control_dependencies([reset_env_op, reset_cumulative_rewards_op]):
return [
index + 1, scores_sum + scores_sum_delta,
scores_num + scores_num_delta
]
def stop_condition(i, _, resets):
return tf.cond(eval_phase_t, lambda: resets < num_agents,
lambda: i < epoch_length)
init = [tf.constant(0), tf.constant(0.0), tf.constant(0)]
index, scores_sum, scores_num = tf.while_loop(
stop_condition, step, init, parallel_iterations=1, back_prop=False)
# We handle force_beginning_resets differently. We assume that all envs are
# reseted at the end of episod (though it happens at the beginning of the
# next one
scores_num = tf.cond(force_beginning_resets,
lambda: scores_num + len(batch_env), lambda: scores_num)
with tf.control_dependencies([scores_sum]):
scores_sum = tf.cond(
force_beginning_resets,
lambda: scores_sum + tf.reduce_sum(cumulative_rewards.read_value()),
lambda: scores_sum)
mean_score = tf.cond(
tf.greater(scores_num, 0),
lambda: scores_sum / tf.cast(scores_num, tf.float32), lambda: 0.)
printing = tf.Print(0, [mean_score, scores_sum, scores_num], "mean_score: ")
with tf.control_dependencies([index, printing]):
memory = [mem.read_value() for mem in memory]
# When generating real data together with PPO training we must use single
# agent. For PPO to work we reshape the history, as if it was generated
# by real_ppo_effective_num_agents.
if ppo_hparams.effective_num_agents is not None and not eval_phase:
new_memory = []
effective_num_agents = ppo_hparams.effective_num_agents
assert epoch_length % ppo_hparams.effective_num_agents == 0, (
"The rollout of ppo_hparams.epoch_length will be distributed amongst"
"effective_num_agents of agents")
new_epoch_length = int(epoch_length / effective_num_agents)
for mem, info in zip(memory, rollout_metadata):
shape, _, name = info
new_shape = [effective_num_agents, new_epoch_length] + shape[1:]
perm = list(range(len(shape) + 1))
perm[0] = 1
perm[1] = 0
mem = tf.transpose(mem, perm=perm)
mem = tf.reshape(mem, shape=new_shape)
mem = tf.transpose(
mem,
perm=perm,
name="collect_memory_%d_%s" % (new_epoch_length, name))
new_memory.append(mem)
memory = new_memory
with tf.variable_scope(scope, reuse=tf.AUTO_REUSE):
mean_score_summary = tf.cond(
tf.greater(scores_num, 0),
lambda: tf.summary.scalar("mean_score_this_iter", mean_score), str)
summaries = tf.summary.merge([
mean_score_summary,
tf.summary.scalar("episodes_finished_this_iter", scores_num)
])
return memory, summaries, initialization_lambda
|
[
"def",
"_define_collect",
"(",
"batch_env",
",",
"ppo_hparams",
",",
"scope",
",",
"frame_stack_size",
",",
"eval_phase",
",",
"sampling_temp",
",",
"force_beginning_resets",
")",
":",
"epoch_length",
"=",
"ppo_hparams",
".",
"epoch_length",
"to_initialize",
"=",
"[",
"]",
"with",
"tf",
".",
"variable_scope",
"(",
"scope",
",",
"reuse",
"=",
"tf",
".",
"AUTO_REUSE",
")",
":",
"num_agents",
"=",
"batch_env",
".",
"batch_size",
"to_initialize",
".",
"append",
"(",
"batch_env",
")",
"wrappers",
"=",
"[",
"(",
"StackWrapper",
",",
"{",
"\"history\"",
":",
"frame_stack_size",
"}",
")",
",",
"(",
"_MemoryWrapper",
",",
"{",
"}",
")",
"]",
"rollout_metadata",
"=",
"None",
"speculum",
"=",
"None",
"for",
"w",
"in",
"wrappers",
":",
"tf",
".",
"logging",
".",
"info",
"(",
"\"Applying wrapper %s(%s) to env %s.\"",
"%",
"(",
"str",
"(",
"w",
"[",
"0",
"]",
")",
",",
"str",
"(",
"w",
"[",
"1",
"]",
")",
",",
"str",
"(",
"batch_env",
")",
")",
")",
"batch_env",
"=",
"w",
"[",
"0",
"]",
"(",
"batch_env",
",",
"*",
"*",
"w",
"[",
"1",
"]",
")",
"to_initialize",
".",
"append",
"(",
"batch_env",
")",
"rollout_metadata",
"=",
"_rollout_metadata",
"(",
"batch_env",
")",
"speculum",
"=",
"batch_env",
".",
"speculum",
"def",
"initialization_lambda",
"(",
"sess",
")",
":",
"for",
"batch_env",
"in",
"to_initialize",
":",
"batch_env",
".",
"initialize",
"(",
"sess",
")",
"memory",
"=",
"[",
"tf",
".",
"get_variable",
"(",
"# pylint: disable=g-complex-comprehension",
"\"collect_memory_%d_%s\"",
"%",
"(",
"epoch_length",
",",
"name",
")",
",",
"shape",
"=",
"[",
"epoch_length",
"]",
"+",
"shape",
",",
"dtype",
"=",
"dtype",
",",
"initializer",
"=",
"tf",
".",
"zeros_initializer",
"(",
")",
",",
"trainable",
"=",
"False",
")",
"for",
"(",
"shape",
",",
"dtype",
",",
"name",
")",
"in",
"rollout_metadata",
"]",
"cumulative_rewards",
"=",
"tf",
".",
"get_variable",
"(",
"\"cumulative_rewards\"",
",",
"len",
"(",
"batch_env",
")",
",",
"trainable",
"=",
"False",
")",
"eval_phase_t",
"=",
"tf",
".",
"convert_to_tensor",
"(",
"eval_phase",
")",
"should_reset_var",
"=",
"tf",
".",
"Variable",
"(",
"True",
",",
"trainable",
"=",
"False",
")",
"zeros_tensor",
"=",
"tf",
".",
"zeros",
"(",
"len",
"(",
"batch_env",
")",
")",
"force_beginning_resets",
"=",
"tf",
".",
"convert_to_tensor",
"(",
"force_beginning_resets",
")",
"def",
"reset_ops_group",
"(",
")",
":",
"return",
"tf",
".",
"group",
"(",
"batch_env",
".",
"reset",
"(",
"tf",
".",
"range",
"(",
"len",
"(",
"batch_env",
")",
")",
")",
",",
"tf",
".",
"assign",
"(",
"cumulative_rewards",
",",
"zeros_tensor",
")",
")",
"reset_op",
"=",
"tf",
".",
"cond",
"(",
"tf",
".",
"logical_or",
"(",
"should_reset_var",
".",
"read_value",
"(",
")",
",",
"force_beginning_resets",
")",
",",
"reset_ops_group",
",",
"tf",
".",
"no_op",
")",
"with",
"tf",
".",
"control_dependencies",
"(",
"[",
"reset_op",
"]",
")",
":",
"reset_once_op",
"=",
"tf",
".",
"assign",
"(",
"should_reset_var",
",",
"False",
")",
"with",
"tf",
".",
"control_dependencies",
"(",
"[",
"reset_once_op",
"]",
")",
":",
"def",
"step",
"(",
"index",
",",
"scores_sum",
",",
"scores_num",
")",
":",
"\"\"\"Single step.\"\"\"",
"index",
"%=",
"epoch_length",
"# Only needed in eval runs.",
"# Note - the only way to ensure making a copy of tensor is to run simple",
"# operation. We are waiting for tf.copy:",
"# https://github.com/tensorflow/tensorflow/issues/11186",
"obs_copy",
"=",
"batch_env",
".",
"observ",
"+",
"0",
"def",
"env_step",
"(",
"arg1",
",",
"arg2",
",",
"arg3",
")",
":",
"# pylint: disable=unused-argument",
"\"\"\"Step of the environment.\"\"\"",
"(",
"logits",
",",
"value_function",
")",
"=",
"get_policy",
"(",
"obs_copy",
",",
"ppo_hparams",
",",
"batch_env",
".",
"action_space",
")",
"action",
"=",
"common_layers",
".",
"sample_with_temperature",
"(",
"logits",
",",
"sampling_temp",
")",
"action",
"=",
"tf",
".",
"cast",
"(",
"action",
",",
"tf",
".",
"int32",
")",
"action",
"=",
"tf",
".",
"reshape",
"(",
"action",
",",
"shape",
"=",
"(",
"num_agents",
",",
")",
")",
"reward",
",",
"done",
"=",
"batch_env",
".",
"simulate",
"(",
"action",
")",
"pdf",
"=",
"tfp",
".",
"distributions",
".",
"Categorical",
"(",
"logits",
"=",
"logits",
")",
".",
"prob",
"(",
"action",
")",
"pdf",
"=",
"tf",
".",
"reshape",
"(",
"pdf",
",",
"shape",
"=",
"(",
"num_agents",
",",
")",
")",
"value_function",
"=",
"tf",
".",
"reshape",
"(",
"value_function",
",",
"shape",
"=",
"(",
"num_agents",
",",
")",
")",
"done",
"=",
"tf",
".",
"reshape",
"(",
"done",
",",
"shape",
"=",
"(",
"num_agents",
",",
")",
")",
"with",
"tf",
".",
"control_dependencies",
"(",
"[",
"reward",
",",
"done",
"]",
")",
":",
"return",
"tf",
".",
"identity",
"(",
"pdf",
")",
",",
"tf",
".",
"identity",
"(",
"value_function",
")",
",",
"tf",
".",
"identity",
"(",
"done",
")",
"# TODO(piotrmilos): while_body is executed at most once,",
"# thus should be replaced with tf.cond",
"pdf",
",",
"value_function",
",",
"top_level_done",
"=",
"tf",
".",
"while_loop",
"(",
"lambda",
"_1",
",",
"_2",
",",
"_3",
":",
"tf",
".",
"equal",
"(",
"speculum",
".",
"size",
"(",
")",
",",
"0",
")",
",",
"env_step",
",",
"[",
"tf",
".",
"constant",
"(",
"0.0",
",",
"shape",
"=",
"(",
"num_agents",
",",
")",
")",
",",
"tf",
".",
"constant",
"(",
"0.0",
",",
"shape",
"=",
"(",
"num_agents",
",",
")",
")",
",",
"tf",
".",
"constant",
"(",
"False",
",",
"shape",
"=",
"(",
"num_agents",
",",
")",
")",
"]",
",",
"parallel_iterations",
"=",
"1",
",",
"back_prop",
"=",
"False",
",",
")",
"with",
"tf",
".",
"control_dependencies",
"(",
"[",
"pdf",
",",
"value_function",
"]",
")",
":",
"obs",
",",
"reward",
",",
"done",
",",
"action",
"=",
"speculum",
".",
"dequeue",
"(",
")",
"to_save",
"=",
"[",
"obs",
",",
"reward",
",",
"done",
",",
"action",
",",
"pdf",
",",
"value_function",
"]",
"save_ops",
"=",
"[",
"tf",
".",
"scatter_update",
"(",
"memory_slot",
",",
"index",
",",
"value",
")",
"for",
"memory_slot",
",",
"value",
"in",
"zip",
"(",
"memory",
",",
"to_save",
")",
"]",
"cumulate_rewards_op",
"=",
"cumulative_rewards",
".",
"assign_add",
"(",
"reward",
")",
"agent_indices_to_reset",
"=",
"tf",
".",
"where",
"(",
"top_level_done",
")",
"[",
":",
",",
"0",
"]",
"with",
"tf",
".",
"control_dependencies",
"(",
"[",
"cumulate_rewards_op",
"]",
")",
":",
"# TODO(piotrmilos): possibly we need cumulative_rewards.read_value()",
"scores_sum_delta",
"=",
"tf",
".",
"reduce_sum",
"(",
"tf",
".",
"gather",
"(",
"cumulative_rewards",
".",
"read_value",
"(",
")",
",",
"agent_indices_to_reset",
")",
")",
"scores_num_delta",
"=",
"tf",
".",
"count_nonzero",
"(",
"done",
",",
"dtype",
"=",
"tf",
".",
"int32",
")",
"with",
"tf",
".",
"control_dependencies",
"(",
"save_ops",
"+",
"[",
"scores_sum_delta",
",",
"scores_num_delta",
"]",
")",
":",
"reset_env_op",
"=",
"batch_env",
".",
"reset",
"(",
"agent_indices_to_reset",
")",
"reset_cumulative_rewards_op",
"=",
"tf",
".",
"scatter_update",
"(",
"cumulative_rewards",
",",
"agent_indices_to_reset",
",",
"tf",
".",
"gather",
"(",
"zeros_tensor",
",",
"agent_indices_to_reset",
")",
")",
"with",
"tf",
".",
"control_dependencies",
"(",
"[",
"reset_env_op",
",",
"reset_cumulative_rewards_op",
"]",
")",
":",
"return",
"[",
"index",
"+",
"1",
",",
"scores_sum",
"+",
"scores_sum_delta",
",",
"scores_num",
"+",
"scores_num_delta",
"]",
"def",
"stop_condition",
"(",
"i",
",",
"_",
",",
"resets",
")",
":",
"return",
"tf",
".",
"cond",
"(",
"eval_phase_t",
",",
"lambda",
":",
"resets",
"<",
"num_agents",
",",
"lambda",
":",
"i",
"<",
"epoch_length",
")",
"init",
"=",
"[",
"tf",
".",
"constant",
"(",
"0",
")",
",",
"tf",
".",
"constant",
"(",
"0.0",
")",
",",
"tf",
".",
"constant",
"(",
"0",
")",
"]",
"index",
",",
"scores_sum",
",",
"scores_num",
"=",
"tf",
".",
"while_loop",
"(",
"stop_condition",
",",
"step",
",",
"init",
",",
"parallel_iterations",
"=",
"1",
",",
"back_prop",
"=",
"False",
")",
"# We handle force_beginning_resets differently. We assume that all envs are",
"# reseted at the end of episod (though it happens at the beginning of the",
"# next one",
"scores_num",
"=",
"tf",
".",
"cond",
"(",
"force_beginning_resets",
",",
"lambda",
":",
"scores_num",
"+",
"len",
"(",
"batch_env",
")",
",",
"lambda",
":",
"scores_num",
")",
"with",
"tf",
".",
"control_dependencies",
"(",
"[",
"scores_sum",
"]",
")",
":",
"scores_sum",
"=",
"tf",
".",
"cond",
"(",
"force_beginning_resets",
",",
"lambda",
":",
"scores_sum",
"+",
"tf",
".",
"reduce_sum",
"(",
"cumulative_rewards",
".",
"read_value",
"(",
")",
")",
",",
"lambda",
":",
"scores_sum",
")",
"mean_score",
"=",
"tf",
".",
"cond",
"(",
"tf",
".",
"greater",
"(",
"scores_num",
",",
"0",
")",
",",
"lambda",
":",
"scores_sum",
"/",
"tf",
".",
"cast",
"(",
"scores_num",
",",
"tf",
".",
"float32",
")",
",",
"lambda",
":",
"0.",
")",
"printing",
"=",
"tf",
".",
"Print",
"(",
"0",
",",
"[",
"mean_score",
",",
"scores_sum",
",",
"scores_num",
"]",
",",
"\"mean_score: \"",
")",
"with",
"tf",
".",
"control_dependencies",
"(",
"[",
"index",
",",
"printing",
"]",
")",
":",
"memory",
"=",
"[",
"mem",
".",
"read_value",
"(",
")",
"for",
"mem",
"in",
"memory",
"]",
"# When generating real data together with PPO training we must use single",
"# agent. For PPO to work we reshape the history, as if it was generated",
"# by real_ppo_effective_num_agents.",
"if",
"ppo_hparams",
".",
"effective_num_agents",
"is",
"not",
"None",
"and",
"not",
"eval_phase",
":",
"new_memory",
"=",
"[",
"]",
"effective_num_agents",
"=",
"ppo_hparams",
".",
"effective_num_agents",
"assert",
"epoch_length",
"%",
"ppo_hparams",
".",
"effective_num_agents",
"==",
"0",
",",
"(",
"\"The rollout of ppo_hparams.epoch_length will be distributed amongst\"",
"\"effective_num_agents of agents\"",
")",
"new_epoch_length",
"=",
"int",
"(",
"epoch_length",
"/",
"effective_num_agents",
")",
"for",
"mem",
",",
"info",
"in",
"zip",
"(",
"memory",
",",
"rollout_metadata",
")",
":",
"shape",
",",
"_",
",",
"name",
"=",
"info",
"new_shape",
"=",
"[",
"effective_num_agents",
",",
"new_epoch_length",
"]",
"+",
"shape",
"[",
"1",
":",
"]",
"perm",
"=",
"list",
"(",
"range",
"(",
"len",
"(",
"shape",
")",
"+",
"1",
")",
")",
"perm",
"[",
"0",
"]",
"=",
"1",
"perm",
"[",
"1",
"]",
"=",
"0",
"mem",
"=",
"tf",
".",
"transpose",
"(",
"mem",
",",
"perm",
"=",
"perm",
")",
"mem",
"=",
"tf",
".",
"reshape",
"(",
"mem",
",",
"shape",
"=",
"new_shape",
")",
"mem",
"=",
"tf",
".",
"transpose",
"(",
"mem",
",",
"perm",
"=",
"perm",
",",
"name",
"=",
"\"collect_memory_%d_%s\"",
"%",
"(",
"new_epoch_length",
",",
"name",
")",
")",
"new_memory",
".",
"append",
"(",
"mem",
")",
"memory",
"=",
"new_memory",
"with",
"tf",
".",
"variable_scope",
"(",
"scope",
",",
"reuse",
"=",
"tf",
".",
"AUTO_REUSE",
")",
":",
"mean_score_summary",
"=",
"tf",
".",
"cond",
"(",
"tf",
".",
"greater",
"(",
"scores_num",
",",
"0",
")",
",",
"lambda",
":",
"tf",
".",
"summary",
".",
"scalar",
"(",
"\"mean_score_this_iter\"",
",",
"mean_score",
")",
",",
"str",
")",
"summaries",
"=",
"tf",
".",
"summary",
".",
"merge",
"(",
"[",
"mean_score_summary",
",",
"tf",
".",
"summary",
".",
"scalar",
"(",
"\"episodes_finished_this_iter\"",
",",
"scores_num",
")",
"]",
")",
"return",
"memory",
",",
"summaries",
",",
"initialization_lambda"
] |
Collect trajectories.
Args:
batch_env: Batch environment.
ppo_hparams: PPO hparams, defined in tensor2tensor.models.research.rl.
scope: var scope.
frame_stack_size: Number of last observations to feed into the policy.
eval_phase: TODO(koz4k): Write docstring.
sampling_temp: Sampling temperature for the policy.
force_beginning_resets: Whether to reset at the beginning of each episode.
Returns:
Returns memory (observations, rewards, dones, actions,
pdfs, values_functions)
containing a rollout of environment from nested wrapped structure.
|
[
"Collect",
"trajectories",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/rl/ppo_learner.py#L310-L515
|
train
|
Define the collect trajectories.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDASQ0Qkq,NL8dtWOpbcjF,_bikzM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aWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000 + 0o0) + chr(0b11 + 0o154) + '\063' + chr(0b110010) + chr(51), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x37' + '\x30', ord("\x08")), ehT0Px3KOsy9(chr(0b111 + 0o51) + chr(7307 - 7196) + chr(0b110011) + '\067' + chr(52), 0o10), ehT0Px3KOsy9(chr(0b11 + 0o55) + chr(2720 - 2609) + '\x35' + '\x34', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(2253 - 2142) + chr(0b1111 + 0o44) + chr(2948 - 2893) + chr(0b110001), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(5842 - 5731) + chr(0b110010) + chr(0b101000 + 0o12) + '\x33', 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110111), 0o10), ehT0Px3KOsy9(chr(0b100101 + 0o13) + chr(4098 - 3987) + chr(49) + chr(0b11000 + 0o37) + chr(0b110011), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(2298 - 2247) + chr(2144 - 2095) + chr(0b110000 + 0o3), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b11100 + 0o25) + '\065' + chr(52), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110011) + chr(1222 - 1174) + '\065', 29264 - 29256), ehT0Px3KOsy9(chr(0b111 + 0o51) + chr(0b1101111) + '\063' + '\x35' + chr(55), 11417 - 11409), ehT0Px3KOsy9(chr(48) + chr(0b1010100 + 0o33) + '\x33' + '\x31' + chr(0b110111), 45046 - 45038), ehT0Px3KOsy9(chr(545 - 497) + '\x6f' + '\x33' + '\x36' + '\x37', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(51) + '\060' + '\067', 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110010) + chr(0b11 + 0o61), 0b1000), ehT0Px3KOsy9(chr(48) + chr(8626 - 8515) + chr(1178 - 1127) + chr(426 - 374) + chr(0b110100 + 0o3), 58830 - 58822), ehT0Px3KOsy9(chr(0b110000) + chr(0b1011011 + 0o24) + chr(50) + '\066' + chr(0b110000), 46750 - 46742), ehT0Px3KOsy9('\x30' + '\x6f' + '\x31' + '\x31' + chr(52), 0o10), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110001) + '\061' + chr(0b100 + 0o62), ord("\x08")), ehT0Px3KOsy9(chr(0b100010 + 0o16) + chr(111) + chr(296 - 245) + chr(54) + chr(0b11100 + 0o31), 5267 - 5259), ehT0Px3KOsy9(chr(0b110000) + chr(10661 - 10550) + chr(986 - 937) + '\x37' + chr(1803 - 1749), 0b1000), ehT0Px3KOsy9(chr(48) + chr(3717 - 3606) + chr(0b110110) + chr(0b1111 + 0o42), 0o10), ehT0Px3KOsy9(chr(0b1001 + 0o47) + chr(0b1101111) + '\x34' + chr(0b110100), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110011) + '\067' + chr(52), 8), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110010) + '\x31' + '\060', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\065' + chr(0b1101 + 0o51), ord("\x08")), ehT0Px3KOsy9(chr(1941 - 1893) + chr(7117 - 7006) + chr(49) + chr(1162 - 1111) + chr(1034 - 979), 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b100000 + 0o22) + chr(0b110001) + chr(0b101000 + 0o16), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1001000 + 0o47) + chr(0b110001) + '\062', 0b1000), ehT0Px3KOsy9(chr(0b101010 + 0o6) + chr(111) + chr(1251 - 1200) + chr(1122 - 1071) + '\x32', 0o10), ehT0Px3KOsy9(chr(837 - 789) + chr(0b11100 + 0o123) + '\x37' + '\x37', ord("\x08")), ehT0Px3KOsy9(chr(0b10100 + 0o34) + chr(0b1000 + 0o147) + chr(51) + '\064' + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101001 + 0o6) + '\061' + '\064' + '\x32', 0b1000), ehT0Px3KOsy9(chr(783 - 735) + '\x6f' + chr(50) + chr(0b110001) + chr(0b10101 + 0o37), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110010) + '\x33' + chr(335 - 287), 34012 - 34004), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b10100 + 0o36) + chr(0b110101) + '\064', 0o10), ehT0Px3KOsy9(chr(1118 - 1070) + chr(0b10000 + 0o137) + chr(0b10 + 0o63) + chr(0b100111 + 0o12), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(1019 - 908) + chr(2031 - 1981) + '\x37' + chr(1819 - 1766), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110011) + '\062' + chr(0b110110), ord("\x08"))][WVxHKyX45z_L % ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(53) + '\060', 35277 - 35269)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xfd'), chr(100) + chr(101) + '\143' + chr(0b1101111) + '\144' + chr(5314 - 5213))(chr(0b1110101) + chr(9993 - 9877) + chr(0b101001 + 0o75) + chr(45) + chr(56)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def YlhivnUUnZWX(XbEJqqD0tOyU, BnONC1WXyHAo, CJBHNoj4zKoT, YYpMgs8WK8M7, Di5VCKGiDkQD, Ep30xVZP6Jij, s_GLvezGzJ3s):
oDj4OD6jdt6s = BnONC1WXyHAo.oDj4OD6jdt6s
PsDQEtASn5kU = []
with xafqLlk3kkUe(IDJ2eXGCBCDu, xafqLlk3kkUe(SXOLrMavuUCe(b'\xa5Y\x8eE\x98\xf1k\x1e\x94\x1f\xa6\x80\xbf\x92'), chr(2362 - 2262) + chr(0b10001 + 0o124) + chr(1912 - 1813) + chr(0b100011 + 0o114) + '\x64' + '\145')('\165' + chr(116) + chr(0b1100110) + '\x2d' + chr(0b110110 + 0o2)))(CJBHNoj4zKoT, reuse=xafqLlk3kkUe(IDJ2eXGCBCDu, xafqLlk3kkUe(SXOLrMavuUCe(b'\x92m\xa8c\xa6\xc1B.\x98)'), '\x64' + chr(0b1100101) + chr(0b1100011) + chr(0b1101111) + chr(0b1001010 + 0o32) + '\x65')('\165' + chr(116) + chr(0b1100110) + '\x2d' + chr(1187 - 1131)))):
aAPd49smBLXd = XbEJqqD0tOyU.ix9dZyeAmUxY
xafqLlk3kkUe(PsDQEtASn5kU, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb2H\x8cI\x97\xf7'), chr(0b1100010 + 0o2) + '\145' + chr(0b11101 + 0o106) + chr(0b1101110 + 0o1) + chr(0b100101 + 0o77) + chr(101))(chr(117) + chr(0b10010 + 0o142) + chr(102) + chr(0b10111 + 0o26) + chr(2330 - 2274)))(XbEJqqD0tOyU)
xqy_5KQMZiOD = [(cRqiba15XLW5, {xafqLlk3kkUe(SXOLrMavuUCe(b'\xbbQ\x8fX\x96\xe1~'), '\x64' + chr(101) + chr(99) + chr(0b1101111) + chr(0b1000010 + 0o42) + '\145')(chr(0b1110101) + chr(0b1110100) + chr(102) + chr(45) + chr(0b111000)): YYpMgs8WK8M7}), (J1qdO51xuRov, {})]
a5IXcxKvz3i_ = None
L4h8xgQeFB6y = None
for AOfzRywRzEXp in xqy_5KQMZiOD:
xafqLlk3kkUe(IDJ2eXGCBCDu.logging, xafqLlk3kkUe(SXOLrMavuUCe(b'\x80\x0f\xb4T\x8c\xf0`L\xa1\x00\x9f\x84'), chr(0b10111 + 0o115) + '\145' + chr(99) + chr(0b1101111) + '\x64' + '\145')(chr(0b10 + 0o163) + '\x74' + chr(0b10010 + 0o124) + chr(45) + '\x38'))(xafqLlk3kkUe(SXOLrMavuUCe(b'\x92H\x8c@\x80\xfai\x1c\xeb\x1b\xb7\x8e\xbf\x87\xa2f\xc7\x95?f\xd0\r\x18\x04\x88\xe7\x0e:\xe0|\xfa\x1a\x91L'), chr(0b1001 + 0o133) + '\x65' + chr(6895 - 6796) + chr(111) + '\144' + chr(0b1100101))('\x75' + '\164' + chr(0b1100110) + chr(0b101101) + chr(56)) % (M8_cKLkHVB2V(AOfzRywRzEXp[ehT0Px3KOsy9(chr(48) + '\x6f' + chr(48), 0b1000)]), M8_cKLkHVB2V(AOfzRywRzEXp[ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\061', 0b1000)]), M8_cKLkHVB2V(XbEJqqD0tOyU)))
XbEJqqD0tOyU = AOfzRywRzEXp[ehT0Px3KOsy9(chr(1966 - 1918) + chr(5231 - 5120) + chr(48), 8)](XbEJqqD0tOyU, **AOfzRywRzEXp[ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(49), 8)])
xafqLlk3kkUe(PsDQEtASn5kU, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb2H\x8cI\x97\xf7'), chr(0b1100100) + chr(451 - 350) + '\143' + chr(9663 - 9552) + chr(100) + chr(1858 - 1757))(chr(117) + '\164' + '\x66' + '\x2d' + chr(0b1100 + 0o54)))(XbEJqqD0tOyU)
a5IXcxKvz3i_ = UtB6eiIQOPar(XbEJqqD0tOyU)
L4h8xgQeFB6y = XbEJqqD0tOyU.speculum
def ZcTcH30AjAz1(HVWCHjSQ2I35):
for XbEJqqD0tOyU in PsDQEtASn5kU:
xafqLlk3kkUe(XbEJqqD0tOyU, xafqLlk3kkUe(SXOLrMavuUCe(b'\xbaV\x95X\x90\xf2k\x12\xb1\t'), '\144' + chr(101) + '\x63' + chr(111) + chr(0b1100100) + chr(0b1011 + 0o132))(chr(0b1110101) + chr(0b1110100) + chr(0b1100110) + chr(45) + chr(0b10001 + 0o47)))(HVWCHjSQ2I35)
KcR7WgfLppqF = [IDJ2eXGCBCDu.get_variable(xafqLlk3kkUe(SXOLrMavuUCe(b'\xb0W\x90@\x9c\xf0s$\xa6\t\xa8\x80\xbd\x8e\x981\x83\xefi='), '\144' + chr(0b1100101) + chr(0b10101 + 0o116) + chr(0b111000 + 0o67) + chr(100) + '\145')(chr(0b1110101) + '\164' + '\x66' + chr(0b100100 + 0o11) + chr(0b1111 + 0o51)) % (oDj4OD6jdt6s, AIvJRzLdDfgF), shape=[oDj4OD6jdt6s] + nauYfLglTpcb, dtype=jSV9IKnemH7K, initializer=IDJ2eXGCBCDu.zeros_initializer(), trainable=ehT0Px3KOsy9(chr(0b101000 + 0o10) + '\x6f' + chr(48), 8)) for (nauYfLglTpcb, jSV9IKnemH7K, AIvJRzLdDfgF) in a5IXcxKvz3i_]
l91zCr6SYXih = IDJ2eXGCBCDu.get_variable(xafqLlk3kkUe(SXOLrMavuUCe(b'\xb0M\x91Y\x95\xf2s\x12\xbd\t\x9a\x9d\xaa\x80\xa6f\x83\xc3'), '\x64' + '\145' + '\143' + '\x6f' + chr(0b1100100) + chr(0b1100101))(chr(13039 - 12922) + '\x74' + '\146' + chr(45) + '\070'), c2A0yzQpDQB3(XbEJqqD0tOyU), trainable=ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110000), 8))
DJkuX2s_NCy6 = IDJ2eXGCBCDu.convert_to_tensor(Di5VCKGiDkQD)
yt1e50waC7Nw = IDJ2eXGCBCDu.Variable(ehT0Px3KOsy9('\060' + '\157' + chr(0b110001), 8), trainable=ehT0Px3KOsy9('\060' + '\157' + chr(0b110000), 8))
zmPSF4C8yA86 = IDJ2eXGCBCDu.zeros(c2A0yzQpDQB3(XbEJqqD0tOyU))
s_GLvezGzJ3s = IDJ2eXGCBCDu.convert_to_tensor(s_GLvezGzJ3s)
def MVliMnAC8_aM():
return xafqLlk3kkUe(IDJ2eXGCBCDu, xafqLlk3kkUe(SXOLrMavuUCe(b'\x9d\x01\xa9B\x94\xcaq\x1a\x9c]\xb5\xa0'), chr(4238 - 4138) + chr(1155 - 1054) + '\143' + '\x6f' + '\144' + '\x65')('\x75' + chr(116) + chr(0b1100110) + chr(1796 - 1751) + '\070'))(xafqLlk3kkUe(XbEJqqD0tOyU, xafqLlk3kkUe(SXOLrMavuUCe(b'\xa1]\x8fI\x8d'), '\144' + chr(9381 - 9280) + '\143' + chr(0b1101111) + '\144' + '\x65')(chr(6126 - 6009) + chr(0b1101111 + 0o5) + chr(0b1100011 + 0o3) + chr(576 - 531) + '\x38'))(xafqLlk3kkUe(IDJ2eXGCBCDu, xafqLlk3kkUe(SXOLrMavuUCe(b'\xa1Y\x92K\x9c'), '\x64' + '\145' + '\143' + chr(0b1000010 + 0o55) + chr(2235 - 2135) + chr(101))(chr(3033 - 2916) + chr(116) + chr(5901 - 5799) + '\x2d' + chr(0b101101 + 0o13)))(c2A0yzQpDQB3(XbEJqqD0tOyU))), xafqLlk3kkUe(IDJ2eXGCBCDu, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb2K\x8fE\x9e\xfd'), '\144' + chr(101) + '\143' + chr(111) + '\x64' + '\x65')(chr(0b101 + 0o160) + '\164' + chr(0b1100110) + chr(1860 - 1815) + chr(0b111000)))(l91zCr6SYXih, zmPSF4C8yA86))
YiiYlveapBFq = IDJ2eXGCBCDu.cond(IDJ2eXGCBCDu.logical_or(yt1e50waC7Nw.read_value(), s_GLvezGzJ3s), MVliMnAC8_aM, IDJ2eXGCBCDu.no_op)
with xafqLlk3kkUe(IDJ2eXGCBCDu, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb0W\x92X\x8b\xfck$\xaf\t\xb5\x8a\xa1\x93\xa2z\x84\xd9)='), chr(0b1100100) + chr(0b1100101) + '\x63' + chr(111) + '\x64' + chr(0b1100101))('\x75' + chr(0b1101011 + 0o11) + chr(102) + '\x2d' + '\070'))([YiiYlveapBFq]):
njhvonLe7FV4 = IDJ2eXGCBCDu.assign(yt1e50waC7Nw, ehT0Px3KOsy9(chr(0b110000) + chr(11762 - 11651) + chr(864 - 816), 8))
with xafqLlk3kkUe(IDJ2eXGCBCDu, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb0W\x92X\x8b\xfck$\xaf\t\xb5\x8a\xa1\x93\xa2z\x84\xd9)='), '\144' + chr(6997 - 6896) + '\x63' + chr(111) + '\x64' + chr(101))(chr(117) + chr(581 - 465) + chr(102) + chr(45) + chr(0b111000)))([njhvonLe7FV4]):
def kDuFsAhEatcU(XdowRbJKZWL9, jZOhP6KqlxSS, amAvLqSvQ3zG):
XdowRbJKZWL9 %= oDj4OD6jdt6s
rLyryOWC4ruG = XbEJqqD0tOyU.observ + ehT0Px3KOsy9(chr(1231 - 1183) + chr(0b11001 + 0o126) + chr(0b110000), 8)
def t2ZGSUfehHlP(FnY8vW1IiyNe, neJFMtHtNq4v, LMkKzt6MbyFb):
(wF9nmvjsKjYM, axzX7T4hWtsc) = zh9fX_r7dhfA(rLyryOWC4ruG, BnONC1WXyHAo, XbEJqqD0tOyU.action_space)
vyskHDXig6uT = jSKPaHwSAfVv.sample_with_temperature(wF9nmvjsKjYM, Ep30xVZP6Jij)
vyskHDXig6uT = IDJ2eXGCBCDu.cast(vyskHDXig6uT, IDJ2eXGCBCDu.int32)
vyskHDXig6uT = IDJ2eXGCBCDu.reshape(vyskHDXig6uT, shape=(aAPd49smBLXd,))
(jEXsEsgeguP4, Ki86oC9WfglU) = XbEJqqD0tOyU.simulate(vyskHDXig6uT)
UO85Z8oJqKtd = Ys555qziAbad.distributions.Categorical(logits=wF9nmvjsKjYM).prob(vyskHDXig6uT)
UO85Z8oJqKtd = IDJ2eXGCBCDu.reshape(UO85Z8oJqKtd, shape=(aAPd49smBLXd,))
axzX7T4hWtsc = IDJ2eXGCBCDu.reshape(axzX7T4hWtsc, shape=(aAPd49smBLXd,))
Ki86oC9WfglU = IDJ2eXGCBCDu.reshape(Ki86oC9WfglU, shape=(aAPd49smBLXd,))
with xafqLlk3kkUe(IDJ2eXGCBCDu, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb0W\x92X\x8b\xfck$\xaf\t\xb5\x8a\xa1\x93\xa2z\x84\xd9)='), chr(0b1011010 + 0o12) + '\145' + chr(0b1100001 + 0o2) + chr(900 - 789) + chr(0b1100100) + '\145')(chr(0b1110101) + chr(116) + chr(4526 - 4424) + chr(0b101101) + chr(56)))([jEXsEsgeguP4, Ki86oC9WfglU]):
return (xafqLlk3kkUe(IDJ2eXGCBCDu, xafqLlk3kkUe(SXOLrMavuUCe(b'\xa5~\xa9k\xcc\xfeL#\xa8\x1a\x9c\xa8'), '\x64' + chr(0b111001 + 0o54) + chr(5583 - 5484) + chr(2822 - 2711) + chr(2846 - 2746) + chr(101))(chr(117) + '\x74' + chr(0b1000 + 0o136) + chr(0b100000 + 0o15) + chr(0b10101 + 0o43)))(UO85Z8oJqKtd), xafqLlk3kkUe(IDJ2eXGCBCDu, xafqLlk3kkUe(SXOLrMavuUCe(b'\xa5~\xa9k\xcc\xfeL#\xa8\x1a\x9c\xa8'), '\144' + chr(101) + '\143' + chr(9390 - 9279) + chr(100) + chr(3531 - 3430))(chr(0b11011 + 0o132) + chr(0b1100000 + 0o24) + '\x66' + '\055' + chr(0b110101 + 0o3)))(axzX7T4hWtsc), xafqLlk3kkUe(IDJ2eXGCBCDu, xafqLlk3kkUe(SXOLrMavuUCe(b'\xa5~\xa9k\xcc\xfeL#\xa8\x1a\x9c\xa8'), chr(100) + chr(0b1100101) + chr(0b1100011) + '\157' + chr(6231 - 6131) + chr(3277 - 3176))(chr(0b1001111 + 0o46) + chr(116) + chr(102) + '\x2d' + '\x38'))(Ki86oC9WfglU))
(UO85Z8oJqKtd, axzX7T4hWtsc, rGf7XaEfyo92) = IDJ2eXGCBCDu.while_loop(lambda IJswncSJ7jZx, Mt8sE1gVAomI, DMYSC0WsHPWf: IDJ2eXGCBCDu.equal(L4h8xgQeFB6y.NLcc3BCJnQka(), ehT0Px3KOsy9('\060' + '\157' + '\060', 8)), t2ZGSUfehHlP, [IDJ2eXGCBCDu.constant(0.0, shape=(aAPd49smBLXd,)), IDJ2eXGCBCDu.constant(0.0, shape=(aAPd49smBLXd,)), IDJ2eXGCBCDu.constant(ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\060', 8), shape=(aAPd49smBLXd,))], parallel_iterations=ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(49), 8), back_prop=ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110000), 8))
with xafqLlk3kkUe(IDJ2eXGCBCDu, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb0W\x92X\x8b\xfck$\xaf\t\xb5\x8a\xa1\x93\xa2z\x84\xd9)='), chr(100) + chr(3983 - 3882) + '\143' + chr(111) + '\144' + chr(101))(chr(0b1110101) + chr(2596 - 2480) + chr(0b1100110) + chr(0b101101) + chr(56)))([UO85Z8oJqKtd, axzX7T4hWtsc]):
(HUAx0lWcwxPP, jEXsEsgeguP4, Ki86oC9WfglU, vyskHDXig6uT) = L4h8xgQeFB6y.dequeue()
X1uZbhCQ9gDR = [HUAx0lWcwxPP, jEXsEsgeguP4, Ki86oC9WfglU, vyskHDXig6uT, UO85Z8oJqKtd, axzX7T4hWtsc]
IKpSQ8hQpc3T = [IDJ2eXGCBCDu.scatter_update(slVCJxIiPivg, XdowRbJKZWL9, QmmgWUB13VCJ) for (slVCJxIiPivg, QmmgWUB13VCJ) in pZ0NK2y6HRbn(KcR7WgfLppqF, X1uZbhCQ9gDR)]
hGxsXN3X3sLS = l91zCr6SYXih.assign_add(jEXsEsgeguP4)
TxHS1jNr9iTk = IDJ2eXGCBCDu.dRFAC59yQBm_(rGf7XaEfyo92)[:, ehT0Px3KOsy9(chr(0b1101 + 0o43) + chr(0b1101000 + 0o7) + '\060', 8)]
with xafqLlk3kkUe(IDJ2eXGCBCDu, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb0W\x92X\x8b\xfck$\xaf\t\xb5\x8a\xa1\x93\xa2z\x84\xd9)='), '\144' + '\x65' + '\x63' + chr(0b1001 + 0o146) + '\x64' + chr(101))(chr(0b111011 + 0o72) + chr(0b1110100) + chr(102) + chr(0b101101) + chr(0b111000)))([hGxsXN3X3sLS]):
U9GKAkuLHhCY = IDJ2eXGCBCDu.reduce_sum(IDJ2eXGCBCDu.gather(l91zCr6SYXih.read_value(), TxHS1jNr9iTk))
fJVMw7ATpITh = IDJ2eXGCBCDu.count_nonzero(Ki86oC9WfglU, dtype=IDJ2eXGCBCDu.int32)
with xafqLlk3kkUe(IDJ2eXGCBCDu, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb0W\x92X\x8b\xfck$\xaf\t\xb5\x8a\xa1\x93\xa2z\x84\xd9)='), chr(8250 - 8150) + '\x65' + chr(99) + chr(0b1101111) + '\144' + '\x65')(chr(117) + chr(0b1010000 + 0o44) + chr(102) + '\055' + chr(56)))(IKpSQ8hQpc3T + [U9GKAkuLHhCY, fJVMw7ATpITh]):
W7AsOdkOQb_j = XbEJqqD0tOyU.reset(TxHS1jNr9iTk)
YAQuZ_A7peZc = IDJ2eXGCBCDu.scatter_update(l91zCr6SYXih, TxHS1jNr9iTk, IDJ2eXGCBCDu.gather(zmPSF4C8yA86, TxHS1jNr9iTk))
with xafqLlk3kkUe(IDJ2eXGCBCDu, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb0W\x92X\x8b\xfck$\xaf\t\xb5\x8a\xa1\x93\xa2z\x84\xd9)='), chr(0b10110 + 0o116) + '\145' + chr(5026 - 4927) + chr(0b1010000 + 0o37) + '\144' + chr(6096 - 5995))(chr(5402 - 5285) + '\x74' + chr(102) + chr(45) + chr(0b111000)))([W7AsOdkOQb_j, YAQuZ_A7peZc]):
return [XdowRbJKZWL9 + ehT0Px3KOsy9('\060' + '\x6f' + chr(0b100000 + 0o21), 8), jZOhP6KqlxSS + U9GKAkuLHhCY, amAvLqSvQ3zG + fJVMw7ATpITh]
def bVsyesBLqyzg(WVxHKyX45z_L, VNGQdHSFPrso, k9xUGh1Yh1u7):
return xafqLlk3kkUe(IDJ2eXGCBCDu, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb0W\x92H'), chr(9945 - 9845) + chr(0b1011100 + 0o11) + chr(0b100101 + 0o76) + chr(0b1101111) + chr(0b1100100) + '\x65')(chr(7238 - 7121) + chr(0b1110100) + '\x66' + '\x2d' + '\070'))(DJkuX2s_NCy6, lambda : k9xUGh1Yh1u7 < aAPd49smBLXd, lambda : WVxHKyX45z_L < oDj4OD6jdt6s)
A5GIpkDsgP4U = [IDJ2eXGCBCDu.constant(ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b101110 + 0o2), 8)), IDJ2eXGCBCDu.constant(0.0), IDJ2eXGCBCDu.constant(ehT0Px3KOsy9(chr(1978 - 1930) + chr(0b1101111) + '\060', 8))]
(XdowRbJKZWL9, jZOhP6KqlxSS, amAvLqSvQ3zG) = IDJ2eXGCBCDu.while_loop(bVsyesBLqyzg, kDuFsAhEatcU, A5GIpkDsgP4U, parallel_iterations=ehT0Px3KOsy9(chr(1315 - 1267) + chr(111) + '\x31', 8), back_prop=ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x30', 8))
amAvLqSvQ3zG = IDJ2eXGCBCDu.cond(s_GLvezGzJ3s, lambda : amAvLqSvQ3zG + c2A0yzQpDQB3(XbEJqqD0tOyU), lambda : amAvLqSvQ3zG)
with xafqLlk3kkUe(IDJ2eXGCBCDu, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb0W\x92X\x8b\xfck$\xaf\t\xb5\x8a\xa1\x93\xa2z\x84\xd9)='), chr(0b1010111 + 0o15) + chr(3247 - 3146) + chr(0b10010 + 0o121) + chr(0b1101111) + '\x64' + chr(0b1100101))(chr(3546 - 3429) + chr(0b1110100) + chr(102) + chr(0b1011 + 0o42) + '\x38'))([jZOhP6KqlxSS]):
jZOhP6KqlxSS = IDJ2eXGCBCDu.cond(s_GLvezGzJ3s, lambda : jZOhP6KqlxSS + IDJ2eXGCBCDu.reduce_sum(l91zCr6SYXih.read_value()), lambda : jZOhP6KqlxSS)
dGXFHJpzTD_9 = IDJ2eXGCBCDu.cond(IDJ2eXGCBCDu.greater(amAvLqSvQ3zG, ehT0Px3KOsy9(chr(0b110000 + 0o0) + chr(0b10010 + 0o135) + chr(48), 8)), lambda : jZOhP6KqlxSS / IDJ2eXGCBCDu.cast(amAvLqSvQ3zG, IDJ2eXGCBCDu.float32), lambda : 0.0)
BSAZ8B0inTZG = IDJ2eXGCBCDu.Print(ehT0Px3KOsy9(chr(0b110000) + chr(0b101111 + 0o100) + '\x30', 8), [dGXFHJpzTD_9, jZOhP6KqlxSS, amAvLqSvQ3zG], xafqLlk3kkUe(SXOLrMavuUCe(b'\xbe]\x9dB\xa6\xe0d\x14\xb9\t\xff\xcf'), chr(0b1001000 + 0o34) + chr(0b1100101) + chr(0b1100011) + chr(111) + chr(0b110 + 0o136) + chr(0b1000010 + 0o43))(chr(12405 - 12288) + '\164' + '\x66' + chr(1580 - 1535) + '\070'))
with xafqLlk3kkUe(IDJ2eXGCBCDu, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb0W\x92X\x8b\xfck$\xaf\t\xb5\x8a\xa1\x93\xa2z\x84\xd9)='), chr(8345 - 8245) + chr(0b1100101) + '\x63' + '\x6f' + '\144' + chr(0b10010 + 0o123))(chr(0b11101 + 0o130) + chr(116) + chr(0b1000100 + 0o42) + '\055' + chr(0b111000)))([XdowRbJKZWL9, BSAZ8B0inTZG]):
KcR7WgfLppqF = [QEvRVVn4YOJx.read_value() for QEvRVVn4YOJx in KcR7WgfLppqF]
if xafqLlk3kkUe(BnONC1WXyHAo, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb6^\x9aI\x9a\xe7n\r\xae3\xab\x9a\xa2\xa8\xa6s\x82\xde8='), chr(100) + '\x65' + chr(99) + chr(0b1101111) + chr(0b10110 + 0o116) + chr(0b1100101))('\165' + '\164' + '\146' + '\x2d' + chr(310 - 254))) is not None and (not Di5VCKGiDkQD):
MNLvWmgHO_M3 = []
wyPw6IMlcC5k = BnONC1WXyHAo.effective_num_agents
assert oDj4OD6jdt6s % xafqLlk3kkUe(BnONC1WXyHAo, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb6^\x9aI\x9a\xe7n\r\xae3\xab\x9a\xa2\xa8\xa6s\x82\xde8='), '\144' + chr(9033 - 8932) + chr(9484 - 9385) + chr(111) + '\144' + chr(0b1100101))('\x75' + chr(116) + chr(5561 - 5459) + chr(0b101101) + chr(893 - 837))) == ehT0Px3KOsy9(chr(267 - 219) + chr(8412 - 8301) + chr(351 - 303), 8), xafqLlk3kkUe(SXOLrMavuUCe(b'\x87P\x99\x0c\x8b\xfck\x17\xa4\x19\xb1\xcf\xa0\x91\xe7d\x97\xdf\x13&\x85\x1fCE\x91\xfb\x00:\xfee\xb9W\xbd\x0e\xe9\xf6\xcb]\xd5\xf6\xa4Q\x90@\xd9\xf1b[\xaf\x05\xb6\x9b\xbd\x9e\xa5a\x93\xd5(n\x94\x13^J\x9b\xfbZ:\xe8l\xbf\\\x96\x0b\xfa\xfd\xf3G\xc8\xbb\x8cY\x9bI\x97\xe7t[\xa4\n\xe5\x8e\xa8\x92\xa9`\x94'), '\x64' + chr(0b1100101) + '\x63' + chr(0b1101111) + '\x64' + chr(0b1100101))(chr(0b1110101) + '\164' + chr(9140 - 9038) + chr(523 - 478) + chr(1045 - 989))
aix7WvKu4muB = ehT0Px3KOsy9(oDj4OD6jdt6s / wyPw6IMlcC5k)
for (QEvRVVn4YOJx, S7Hxucg7jlZk) in pZ0NK2y6HRbn(KcR7WgfLppqF, a5IXcxKvz3i_):
(nauYfLglTpcb, VNGQdHSFPrso, AIvJRzLdDfgF) = S7Hxucg7jlZk
P7dVzv6_yXeE = [wyPw6IMlcC5k, aix7WvKu4muB] + nauYfLglTpcb[ehT0Px3KOsy9(chr(0b10011 + 0o35) + chr(10079 - 9968) + chr(0b110001), 8):]
o8iooqRLTSy9 = YyaZ4tpXu4lf(vQr8gNKaIaWE(c2A0yzQpDQB3(nauYfLglTpcb) + ehT0Px3KOsy9('\060' + '\157' + chr(0b11010 + 0o27), 8)))
o8iooqRLTSy9[ehT0Px3KOsy9('\060' + '\x6f' + '\x30', 8)] = ehT0Px3KOsy9(chr(0b10 + 0o56) + '\x6f' + '\061', 8)
o8iooqRLTSy9[ehT0Px3KOsy9('\060' + chr(0b1101111) + '\061', 8)] = ehT0Px3KOsy9('\060' + chr(111) + chr(303 - 255), 8)
QEvRVVn4YOJx = IDJ2eXGCBCDu.transpose(QEvRVVn4YOJx, perm=o8iooqRLTSy9)
QEvRVVn4YOJx = IDJ2eXGCBCDu.reshape(QEvRVVn4YOJx, shape=P7dVzv6_yXeE)
QEvRVVn4YOJx = IDJ2eXGCBCDu.transpose(QEvRVVn4YOJx, perm=o8iooqRLTSy9, name=xafqLlk3kkUe(SXOLrMavuUCe(b'\xb0W\x90@\x9c\xf0s$\xa6\t\xa8\x80\xbd\x8e\x981\x83\xefi='), chr(0b1100100) + chr(0b1100101) + chr(1661 - 1562) + chr(0b1101111) + chr(8824 - 8724) + chr(101))(chr(8492 - 8375) + chr(4100 - 3984) + chr(0b111101 + 0o51) + chr(1086 - 1041) + '\070') % (aix7WvKu4muB, AIvJRzLdDfgF))
xafqLlk3kkUe(MNLvWmgHO_M3, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb2H\x8cI\x97\xf7'), '\144' + '\x65' + chr(0b10 + 0o141) + chr(0b111110 + 0o61) + '\x64' + '\x65')('\x75' + chr(0b1110100) + chr(0b11000 + 0o116) + '\055' + '\070'))(QEvRVVn4YOJx)
KcR7WgfLppqF = MNLvWmgHO_M3
with xafqLlk3kkUe(IDJ2eXGCBCDu, xafqLlk3kkUe(SXOLrMavuUCe(b'\xa5Y\x8eE\x98\xf1k\x1e\x94\x1f\xa6\x80\xbf\x92'), chr(5404 - 5304) + chr(0b1100101) + chr(0b1100011) + chr(111) + chr(0b1000 + 0o134) + chr(0b1101 + 0o130))(chr(1557 - 1440) + chr(0b110011 + 0o101) + '\146' + '\055' + '\x38'))(CJBHNoj4zKoT, reuse=xafqLlk3kkUe(IDJ2eXGCBCDu, xafqLlk3kkUe(SXOLrMavuUCe(b'\x92m\xa8c\xa6\xc1B.\x98)'), chr(0b1001101 + 0o27) + chr(0b101110 + 0o67) + '\143' + chr(0b1101111) + '\x64' + chr(0b10001 + 0o124))('\165' + chr(116) + chr(0b1100110) + chr(0b10111 + 0o26) + chr(0b111000)))):
TVua7DjFdTeT = IDJ2eXGCBCDu.cond(IDJ2eXGCBCDu.greater(amAvLqSvQ3zG, ehT0Px3KOsy9('\060' + chr(0b1101111) + '\060', 8)), lambda : IDJ2eXGCBCDu.summary.scalar(xafqLlk3kkUe(SXOLrMavuUCe(b'\xbe]\x9dB\xa6\xe0d\x14\xb9\t\x9a\x9b\xa7\x9e\xb4K\x8e\xc4)<'), chr(0b100010 + 0o102) + chr(0b1100101) + chr(0b1100011) + '\x6f' + '\x64' + '\145')(chr(117) + chr(116) + chr(0b1100110) + chr(0b101101) + '\070'), dGXFHJpzTD_9), M8_cKLkHVB2V)
Ss61w8pBYeZH = IDJ2eXGCBCDu.summary.mP5l0dPhBkus([TVua7DjFdTeT, IDJ2eXGCBCDu.summary.scalar(xafqLlk3kkUe(SXOLrMavuUCe(b'\xb6H\x95_\x96\xf7b\x08\x94\n\xac\x81\xa6\x84\xafq\x83\xef8&\x9c\rnM\x88\xed\\'), '\x64' + chr(5453 - 5352) + chr(0b1100011) + chr(0b1010111 + 0o30) + '\x64' + chr(774 - 673))('\165' + chr(0b1010001 + 0o43) + '\x66' + chr(0b101101) + chr(56)), amAvLqSvQ3zG)])
return (KcR7WgfLppqF, Ss61w8pBYeZH, ZcTcH30AjAz1)
|
tensorflow/tensor2tensor
|
tensor2tensor/models/vanilla_gan.py
|
deconv2d
|
def deconv2d(
input_, output_shape, k_h, k_w, d_h, d_w, stddev=0.02, name="deconv2d"):
"""Deconvolution layer."""
with tf.variable_scope(name):
w = tf.get_variable(
"w", [k_h, k_w, output_shape[-1], input_.get_shape()[-1]],
initializer=tf.random_normal_initializer(stddev=stddev))
deconv = tf.nn.conv2d_transpose(
input_, w, output_shape=output_shape, strides=[1, d_h, d_w, 1])
biases = tf.get_variable(
"biases", [output_shape[-1]], initializer=tf.constant_initializer(0.0))
return tf.reshape(tf.nn.bias_add(deconv, biases), deconv.get_shape())
|
python
|
def deconv2d(
input_, output_shape, k_h, k_w, d_h, d_w, stddev=0.02, name="deconv2d"):
"""Deconvolution layer."""
with tf.variable_scope(name):
w = tf.get_variable(
"w", [k_h, k_w, output_shape[-1], input_.get_shape()[-1]],
initializer=tf.random_normal_initializer(stddev=stddev))
deconv = tf.nn.conv2d_transpose(
input_, w, output_shape=output_shape, strides=[1, d_h, d_w, 1])
biases = tf.get_variable(
"biases", [output_shape[-1]], initializer=tf.constant_initializer(0.0))
return tf.reshape(tf.nn.bias_add(deconv, biases), deconv.get_shape())
|
[
"def",
"deconv2d",
"(",
"input_",
",",
"output_shape",
",",
"k_h",
",",
"k_w",
",",
"d_h",
",",
"d_w",
",",
"stddev",
"=",
"0.02",
",",
"name",
"=",
"\"deconv2d\"",
")",
":",
"with",
"tf",
".",
"variable_scope",
"(",
"name",
")",
":",
"w",
"=",
"tf",
".",
"get_variable",
"(",
"\"w\"",
",",
"[",
"k_h",
",",
"k_w",
",",
"output_shape",
"[",
"-",
"1",
"]",
",",
"input_",
".",
"get_shape",
"(",
")",
"[",
"-",
"1",
"]",
"]",
",",
"initializer",
"=",
"tf",
".",
"random_normal_initializer",
"(",
"stddev",
"=",
"stddev",
")",
")",
"deconv",
"=",
"tf",
".",
"nn",
".",
"conv2d_transpose",
"(",
"input_",
",",
"w",
",",
"output_shape",
"=",
"output_shape",
",",
"strides",
"=",
"[",
"1",
",",
"d_h",
",",
"d_w",
",",
"1",
"]",
")",
"biases",
"=",
"tf",
".",
"get_variable",
"(",
"\"biases\"",
",",
"[",
"output_shape",
"[",
"-",
"1",
"]",
"]",
",",
"initializer",
"=",
"tf",
".",
"constant_initializer",
"(",
"0.0",
")",
")",
"return",
"tf",
".",
"reshape",
"(",
"tf",
".",
"nn",
".",
"bias_add",
"(",
"deconv",
",",
"biases",
")",
",",
"deconv",
".",
"get_shape",
"(",
")",
")"
] |
Deconvolution layer.
|
[
"Deconvolution",
"layer",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/models/vanilla_gan.py#L37-L48
|
train
|
Deconvolution layer.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF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nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + chr(0b11000 + 0o127) + chr(1327 - 1278) + chr(0b101000 + 0o13) + '\x36', 31372 - 31364), ehT0Px3KOsy9(chr(0b101010 + 0o6) + chr(8984 - 8873) + chr(2226 - 2176) + chr(0b100011 + 0o23) + chr(0b110011), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b11110 + 0o24) + '\x32' + '\067', 0b1000), ehT0Px3KOsy9(chr(1430 - 1382) + chr(111) + chr(1392 - 1343) + chr(0b110011) + chr(1698 - 1650), 0b1000), ehT0Px3KOsy9('\060' + '\157' + '\x31' + chr(55) + chr(50), ord("\x08")), ehT0Px3KOsy9(chr(1536 - 1488) + '\x6f' + chr(0b10000 + 0o47) + chr(0b10110 + 0o33), 43546 - 43538), ehT0Px3KOsy9(chr(48) + chr(0b1100010 + 0o15) + chr(0b110111) + chr(705 - 654), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110001), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(388 - 339) + chr(2142 - 2090) + chr(0b1111 + 0o42), ord("\x08")), ehT0Px3KOsy9(chr(0b11000 + 0o30) + chr(111) + chr(50) + '\x33' + '\065', 23021 - 23013), ehT0Px3KOsy9('\060' + chr(8832 - 8721) + chr(0b110001) + '\x33' + '\062', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(49) + '\x32' + chr(272 - 217), 7149 - 7141), ehT0Px3KOsy9(chr(930 - 882) + chr(111) + chr(50) + chr(54) + chr(0b11110 + 0o27), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b110001 + 0o4) + chr(691 - 641), 0b1000), ehT0Px3KOsy9(chr(48) + chr(4859 - 4748) + '\x32' + chr(0b100111 + 0o20) + chr(0b110001), 0b1000), ehT0Px3KOsy9('\060' + chr(10415 - 10304) + '\x34' + '\x33', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + '\061' + chr(51) + chr(0b110001), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\063' + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(0b1100 + 0o44) + chr(1228 - 1117) + '\061' + chr(206 - 156) + chr(54), 39149 - 39141), ehT0Px3KOsy9(chr(0b1111 + 0o41) + chr(111) + chr(0b1000 + 0o52) + chr(0b110000) + chr(2793 - 2739), 63129 - 63121), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(51) + chr(683 - 634) + '\060', 0o10), ehT0Px3KOsy9(chr(1344 - 1296) + chr(0b1101111) + chr(1634 - 1583) + chr(0b111 + 0o53) + '\060', 0o10), ehT0Px3KOsy9(chr(2226 - 2178) + '\157' + chr(0b1111 + 0o44) + chr(815 - 767) + chr(51), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + '\x31' + chr(49) + chr(49), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b111100 + 0o63) + chr(888 - 839) + chr(55) + chr(0b11001 + 0o35), 7098 - 7090), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110111) + chr(0b110000), ord("\x08")), ehT0Px3KOsy9(chr(1703 - 1655) + chr(111) + chr(0b10010 + 0o37) + '\062' + chr(1428 - 1373), 8), ehT0Px3KOsy9(chr(528 - 480) + '\x6f' + '\x31', 8), ehT0Px3KOsy9(chr(98 - 50) + '\157' + chr(1960 - 1910) + '\064' + chr(0b1000 + 0o53), 36644 - 36636), ehT0Px3KOsy9(chr(0b1000 + 0o50) + '\157' + chr(0b110010) + chr(0b101011 + 0o6) + chr(52), 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(0b110000 + 0o1) + '\x33' + '\x33', 55701 - 55693), ehT0Px3KOsy9('\x30' + '\157' + chr(51) + chr(0b101011 + 0o13) + '\060', 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(2232 - 2183) + '\067' + '\062', 8), ehT0Px3KOsy9('\x30' + chr(0b1000010 + 0o55) + chr(0b110001) + chr(48) + chr(1955 - 1902), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + '\061' + chr(0b110000) + chr(1152 - 1097), ord("\x08")), ehT0Px3KOsy9(chr(0b111 + 0o51) + chr(8594 - 8483) + '\062' + chr(0b1001 + 0o52) + '\067', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b11 + 0o154) + '\062' + chr(0b110100) + chr(0b110100), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(306 - 195) + chr(0b10111 + 0o34) + '\x32' + chr(2183 - 2134), 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110100) + chr(51), 8), ehT0Px3KOsy9(chr(0b101000 + 0o10) + '\157' + chr(0b110010) + chr(48) + chr(0b110001), 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + chr(5525 - 5414) + chr(0b110101) + chr(2240 - 2192), 1380 - 1372)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'p'), chr(0b1100100) + '\x65' + chr(99) + '\157' + '\x64' + chr(0b101100 + 0o71))('\165' + chr(10925 - 10809) + '\x66' + chr(0b101101) + chr(0b100011 + 0o25)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def hHBLYFrbv3ZL(XhCS97ofyQZT, CeP8heSqnrCd, g38_8dImbiXG, tyQYepoXhyU7, k0AfRgumTg1P, utBlcDH1Ucq3, D1riUsWffEJl=0.02, AIvJRzLdDfgF=xafqLlk3kkUe(SXOLrMavuUCe(b':\xd6\xf47\x14O\te'), '\x64' + chr(0b1010101 + 0o20) + chr(8031 - 7932) + chr(111) + chr(0b1000100 + 0o40) + chr(7499 - 7398))(chr(0b0 + 0o165) + chr(0b1110100) + chr(6292 - 6190) + '\055' + '\x38')):
with xafqLlk3kkUe(IDJ2eXGCBCDu, xafqLlk3kkUe(SXOLrMavuUCe(b'(\xd2\xe51\x1b[Wd>\xee98\xc5O'), '\x64' + chr(101) + chr(0b1001000 + 0o33) + '\157' + '\144' + '\145')('\x75' + '\164' + chr(102) + chr(544 - 499) + chr(0b101111 + 0o11)))(AIvJRzLdDfgF):
AOfzRywRzEXp = IDJ2eXGCBCDu.get_variable(xafqLlk3kkUe(SXOLrMavuUCe(b')'), '\144' + chr(0b1011100 + 0o11) + chr(0b1100011) + '\157' + chr(3596 - 3496) + '\145')('\165' + chr(0b1 + 0o163) + chr(4209 - 4107) + '\055' + chr(56)), [g38_8dImbiXG, tyQYepoXhyU7, CeP8heSqnrCd[-ehT0Px3KOsy9(chr(48) + '\x6f' + '\061', 8)], XhCS97ofyQZT.get_shape()[-ehT0Px3KOsy9('\x30' + chr(111) + '\x31', 8)]], initializer=IDJ2eXGCBCDu.random_normal_initializer(stddev=D1riUsWffEJl))
lVVvE0Sa2bEP = IDJ2eXGCBCDu.nn.conv2d_transpose(XhCS97ofyQZT, AOfzRywRzEXp, output_shape=CeP8heSqnrCd, strides=[ehT0Px3KOsy9(chr(1613 - 1565) + '\157' + chr(49), 8), k0AfRgumTg1P, utBlcDH1Ucq3, ehT0Px3KOsy9(chr(1793 - 1745) + '\157' + chr(0b110001), 8)])
f9yyIWOeaTuE = IDJ2eXGCBCDu.get_variable(xafqLlk3kkUe(SXOLrMavuUCe(b'<\xda\xf6+\x1fJ'), chr(100) + '\145' + chr(0b1100011) + '\x6f' + chr(0b100000 + 0o104) + '\145')(chr(8967 - 8850) + chr(4439 - 4323) + '\146' + chr(45) + chr(0b111000)), [CeP8heSqnrCd[-ehT0Px3KOsy9(chr(0b101101 + 0o3) + chr(0b1000 + 0o147) + chr(49), 8)]], initializer=IDJ2eXGCBCDu.constant_initializer(0.0))
return xafqLlk3kkUe(IDJ2eXGCBCDu, xafqLlk3kkUe(SXOLrMavuUCe(b',\xd6\xe40\x1bI^'), chr(0b1100100) + chr(101) + chr(99) + chr(0b1101111) + chr(0b1100100) + '\x65')('\165' + '\164' + '\146' + chr(0b101101) + chr(56)))(xafqLlk3kkUe(IDJ2eXGCBCDu.nn, xafqLlk3kkUe(SXOLrMavuUCe(b'<\xda\xf6+%X_e'), '\144' + chr(1638 - 1537) + chr(0b1100011) + '\157' + chr(0b1100100) + chr(0b100100 + 0o101))('\165' + chr(116) + chr(0b1100110) + chr(0b101101) + chr(2599 - 2543)))(lVVvE0Sa2bEP, f9yyIWOeaTuE), xafqLlk3kkUe(lVVvE0Sa2bEP, xafqLlk3kkUe(SXOLrMavuUCe(b'9\xd6\xe3\x07\tQZq\x04'), chr(100) + chr(0b1010100 + 0o21) + '\x63' + chr(0b111 + 0o150) + '\144' + chr(0b1100101))(chr(0b1010110 + 0o37) + chr(12600 - 12484) + '\x66' + chr(45) + chr(0b11111 + 0o31)))())
|
tensorflow/tensor2tensor
|
tensor2tensor/models/vanilla_gan.py
|
sliced_gan
|
def sliced_gan():
"""Basic parameters for a vanilla_gan."""
hparams = common_hparams.basic_params1()
hparams.optimizer = "adam"
hparams.learning_rate_constant = 0.0002
hparams.learning_rate_warmup_steps = 500
hparams.learning_rate_schedule = "constant * linear_warmup"
hparams.label_smoothing = 0.0
hparams.batch_size = 128
hparams.hidden_size = 128
hparams.initializer = "uniform_unit_scaling"
hparams.initializer_gain = 1.0
hparams.weight_decay = 1e-6
hparams.kernel_height = 4
hparams.kernel_width = 4
hparams.bottleneck_bits = 128
hparams.add_hparam("discriminator_batchnorm", True)
hparams.add_hparam("num_sliced_vecs", 4096)
return hparams
|
python
|
def sliced_gan():
"""Basic parameters for a vanilla_gan."""
hparams = common_hparams.basic_params1()
hparams.optimizer = "adam"
hparams.learning_rate_constant = 0.0002
hparams.learning_rate_warmup_steps = 500
hparams.learning_rate_schedule = "constant * linear_warmup"
hparams.label_smoothing = 0.0
hparams.batch_size = 128
hparams.hidden_size = 128
hparams.initializer = "uniform_unit_scaling"
hparams.initializer_gain = 1.0
hparams.weight_decay = 1e-6
hparams.kernel_height = 4
hparams.kernel_width = 4
hparams.bottleneck_bits = 128
hparams.add_hparam("discriminator_batchnorm", True)
hparams.add_hparam("num_sliced_vecs", 4096)
return hparams
|
[
"def",
"sliced_gan",
"(",
")",
":",
"hparams",
"=",
"common_hparams",
".",
"basic_params1",
"(",
")",
"hparams",
".",
"optimizer",
"=",
"\"adam\"",
"hparams",
".",
"learning_rate_constant",
"=",
"0.0002",
"hparams",
".",
"learning_rate_warmup_steps",
"=",
"500",
"hparams",
".",
"learning_rate_schedule",
"=",
"\"constant * linear_warmup\"",
"hparams",
".",
"label_smoothing",
"=",
"0.0",
"hparams",
".",
"batch_size",
"=",
"128",
"hparams",
".",
"hidden_size",
"=",
"128",
"hparams",
".",
"initializer",
"=",
"\"uniform_unit_scaling\"",
"hparams",
".",
"initializer_gain",
"=",
"1.0",
"hparams",
".",
"weight_decay",
"=",
"1e-6",
"hparams",
".",
"kernel_height",
"=",
"4",
"hparams",
".",
"kernel_width",
"=",
"4",
"hparams",
".",
"bottleneck_bits",
"=",
"128",
"hparams",
".",
"add_hparam",
"(",
"\"discriminator_batchnorm\"",
",",
"True",
")",
"hparams",
".",
"add_hparam",
"(",
"\"num_sliced_vecs\"",
",",
"4096",
")",
"return",
"hparams"
] |
Basic parameters for a vanilla_gan.
|
[
"Basic",
"parameters",
"for",
"a",
"vanilla_gan",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/models/vanilla_gan.py#L199-L217
|
train
|
Basic parameters for a vanilla_gan.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDASQ0Qkq,NL8dtWOpbcjF,_bikzMuRfbJG,sznFqDbNBHlx,ZsDPvpP4xdo3,cW7yQuyEnJ6E,KOHQGQ8qLDWm,NE1Yam2HHroQ,ygAzbDzrvRMh,SBRjvOU1ufVC,hOkXjmluKZfJ,q1QCh3W88sgk,TLbJ60djyws0,rIcPej9ZqMqV,WTxpD_zs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,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(48) + chr(0b100 + 0o153) + chr(0b10111 + 0o33) + '\062' + chr(0b110100), 0b1000), ehT0Px3KOsy9(chr(0b10010 + 0o36) + chr(111) + chr(49) + chr(2098 - 2049) + chr(0b110010), 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110010) + chr(0b110001 + 0o1) + '\x37', 49409 - 49401), ehT0Px3KOsy9(chr(48) + chr(0b1100111 + 0o10) + '\x32' + '\x31' + chr(748 - 700), 0o10), ehT0Px3KOsy9(chr(1743 - 1695) + chr(0b1010011 + 0o34) + '\x33' + chr(54) + chr(0b110110), 0o10), ehT0Px3KOsy9('\060' + chr(10523 - 10412) + chr(0b110010) + chr(0b1 + 0o60) + chr(2181 - 2131), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b100 + 0o56) + chr(2323 - 2273) + chr(0b11011 + 0o34), 8), ehT0Px3KOsy9(chr(1905 - 1857) + '\x6f' + '\064', 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(0b110011) + chr(49) + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(0b1000 + 0o50) + '\x6f' + chr(0b110011) + chr(0b110001) + chr(0b101101 + 0o5), 0o10), ehT0Px3KOsy9('\x30' + chr(0b111111 + 0o60) + '\x31' + chr(0b110111) + chr(586 - 533), ord("\x08")), ehT0Px3KOsy9(chr(105 - 57) + chr(0b1101111) + chr(2502 - 2451) + chr(1249 - 1197) + '\065', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(5723 - 5612) + '\063' + '\x32' + chr(0b110010), 48714 - 48706), ehT0Px3KOsy9(chr(2234 - 2186) + chr(111) + chr(0b110011) + '\060' + chr(1465 - 1416), 0b1000), ehT0Px3KOsy9(chr(48) + chr(6022 - 5911) + chr(2078 - 2027) + chr(0b10001 + 0o40) + chr(0b110001), ord("\x08")), ehT0Px3KOsy9(chr(961 - 913) + chr(0b111101 + 0o62) + chr(950 - 899) + chr(379 - 327) + chr(52), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + '\x36' + chr(782 - 732), 0b1000), ehT0Px3KOsy9('\060' + chr(5575 - 5464) + chr(525 - 474) + chr(55) + chr(2297 - 2246), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\157' + '\x32' + chr(691 - 636) + chr(0b11001 + 0o36), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110011 + 0o0) + chr(0b101011 + 0o11) + chr(52), 8), ehT0Px3KOsy9(chr(212 - 164) + '\157' + chr(491 - 442) + chr(0b110010 + 0o5) + chr(48), 0b1000), ehT0Px3KOsy9(chr(855 - 807) + chr(0b1101111) + chr(1254 - 1203) + '\x33' + chr(0b1001 + 0o55), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(6157 - 6046) + chr(0b1011 + 0o50) + chr(0b110111) + chr(0b110011), 8), ehT0Px3KOsy9(chr(0b1001 + 0o47) + chr(0b1101111) + '\062' + chr(0b110110) + chr(48), 42683 - 42675), ehT0Px3KOsy9(chr(48) + chr(12005 - 11894) + chr(0b110010) + chr(0b101011 + 0o5), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(52) + chr(0b101100 + 0o10), 0b1000), ehT0Px3KOsy9(chr(827 - 779) + chr(0b1101111) + chr(51) + chr(75 - 25) + '\067', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110011) + chr(0b110011), ord("\x08")), ehT0Px3KOsy9(chr(0b100010 + 0o16) + chr(0b1101111) + '\x31' + chr(0b10000 + 0o46) + chr(0b110011), 45186 - 45178), ehT0Px3KOsy9(chr(48) + chr(111) + chr(50) + '\067', 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + '\063' + chr(0b110110) + chr(55), 1813 - 1805), ehT0Px3KOsy9(chr(48) + chr(11826 - 11715) + chr(0b110100) + chr(0b110101), 0o10), ehT0Px3KOsy9(chr(1773 - 1725) + '\x6f' + '\x32' + chr(0b110111) + chr(0b110001), 62024 - 62016), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110010) + '\x35', 10246 - 10238), ehT0Px3KOsy9('\x30' + chr(11021 - 10910) + chr(0b110011) + chr(50) + chr(0b11010 + 0o30), 8), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(49) + chr(593 - 545) + chr(0b110010), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110011) + chr(0b110100) + '\060', ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(2328 - 2279) + '\066' + chr(0b1010 + 0o52), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(49) + chr(0b100011 + 0o16) + '\064', ord("\x08")), ehT0Px3KOsy9(chr(1759 - 1711) + chr(4817 - 4706) + chr(49), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b100100 + 0o14) + '\157' + '\065' + chr(0b1110 + 0o42), ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xba'), '\x64' + '\x65' + chr(5868 - 5769) + '\157' + chr(0b1100100) + chr(0b1100101))('\165' + '\x74' + chr(102) + '\x2d' + chr(775 - 719)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def rzYt1LMmcSyN():
n4ljua2gi1Pr = vLnG3ZpOXWXZ.basic_params1()
n4ljua2gi1Pr.XdKNcYRObPK3 = xafqLlk3kkUe(SXOLrMavuUCe(b'\xf5.\xf6\xe5'), chr(3124 - 3024) + chr(10033 - 9932) + '\143' + chr(111) + chr(0b101101 + 0o67) + '\x65')(chr(0b1011010 + 0o33) + chr(0b101010 + 0o112) + chr(0b1010001 + 0o25) + chr(0b101101) + chr(56))
n4ljua2gi1Pr.Ot9HUjnkxXA_ = 0.0002
n4ljua2gi1Pr.fHyhoyGmdvM9 = ehT0Px3KOsy9('\x30' + chr(2477 - 2366) + chr(0b110111 + 0o0) + chr(0b10000 + 0o46) + '\064', 53733 - 53725)
n4ljua2gi1Pr.Lz_s7neUzM5V = xafqLlk3kkUe(SXOLrMavuUCe(b'\xf7%\xf9\xfb\x82\xeb\xf9p\xef\xe0]\x89\xbb\xaf\xac\x85@\xa4\xc8\x85\n\xb3\x8e\xc0'), chr(0b1011110 + 0o6) + chr(101) + chr(0b1100011) + '\157' + chr(100) + '\145')(chr(3956 - 3839) + '\164' + chr(102) + '\055' + chr(56))
n4ljua2gi1Pr.FSjUgdaczzRk = 0.0
n4ljua2gi1Pr.ix9dZyeAmUxY = ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110010) + chr(0b110000) + chr(0b11101 + 0o23), 0b1000)
n4ljua2gi1Pr.qzoyXN3kdhDL = ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\062' + chr(0b100010 + 0o16) + chr(0b10 + 0o56), 8)
n4ljua2gi1Pr.kwfuYzkY5C57 = xafqLlk3kkUe(SXOLrMavuUCe(b'\xe1$\xfe\xee\x99\xf8\xfa[\xba\xa4\x14\x91\x8d\xb2\xaa\x85^\x92\xd1\x83'), '\x64' + '\145' + chr(99) + chr(111) + '\x64' + chr(101))(chr(0b101000 + 0o115) + chr(5064 - 4948) + chr(0b1100110) + chr(0b101101) + chr(56))
n4ljua2gi1Pr.S1SbCBXLapw8 = 1.0
n4ljua2gi1Pr.eB4rJl6fUxw9 = 1e-06
n4ljua2gi1Pr.aWtpZRO3JbHj = ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110100), 8)
n4ljua2gi1Pr.xCDNMTg51zI4 = ehT0Px3KOsy9(chr(0b1001 + 0o47) + chr(111) + chr(0b100001 + 0o23), 8)
n4ljua2gi1Pr.L0tf_yAed5SW = ehT0Px3KOsy9('\060' + '\157' + chr(0b110010) + chr(0b11010 + 0o26) + '\x30', 8)
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'\xf5.\xf3\xd7\x9e\xfa\xf6v\xae\xa7'), chr(8606 - 8506) + '\x65' + chr(0b1100011) + chr(0b1101111) + chr(0b1100100) + chr(101))('\x75' + chr(116) + chr(0b1001111 + 0o27) + '\x2d' + '\x38'))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xf0#\xe4\xeb\x84\xe3\xfam\xa1\xab\t\x8a\xa0\x9e\xab\x85F\x98\xd7\x8a\x17\xac\x96'), '\x64' + chr(7438 - 7337) + chr(0b1100011) + '\157' + '\144' + chr(0b1100101))(chr(4435 - 4318) + chr(116) + chr(0b10011 + 0o123) + chr(823 - 778) + chr(0b111000)), ehT0Px3KOsy9(chr(938 - 890) + '\157' + chr(1144 - 1095), 8))
xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'\xf5.\xf3\xd7\x9e\xfa\xf6v\xae\xa7'), '\x64' + chr(0b1100101) + chr(0b1000111 + 0o34) + '\x6f' + chr(100) + '\145')(chr(0b101101 + 0o110) + chr(228 - 112) + chr(3614 - 3512) + '\055' + chr(0b100110 + 0o22)))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xfa?\xfa\xd7\x85\xe6\xfeg\xaa\xae"\x93\xb7\xa2\xba'), chr(0b1000110 + 0o36) + chr(0b1100101) + '\143' + '\157' + '\x64' + chr(0b111101 + 0o50))(chr(117) + chr(0b101100 + 0o110) + '\146' + '\055' + '\x38'), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110001) + chr(0b101 + 0o53) + '\x30' + '\x30' + chr(48), 45725 - 45717))
return n4ljua2gi1Pr
|
tensorflow/tensor2tensor
|
tensor2tensor/models/vanilla_gan.py
|
AbstractGAN.discriminator
|
def discriminator(self, x, is_training, reuse=False):
"""Discriminator architecture based on InfoGAN.
Args:
x: input images, shape [bs, h, w, channels]
is_training: boolean, are we in train or eval model.
reuse: boolean, should params be re-used.
Returns:
out_logit: the output logits (before sigmoid).
"""
hparams = self.hparams
with tf.variable_scope(
"discriminator", reuse=reuse,
initializer=tf.random_normal_initializer(stddev=0.02)):
batch_size, height, width = common_layers.shape_list(x)[:3]
# Mapping x from [bs, h, w, c] to [bs, 1]
net = tf.layers.conv2d(x, 64, (4, 4), strides=(2, 2),
padding="SAME", name="d_conv1")
# [bs, h/2, w/2, 64]
net = lrelu(net)
net = tf.layers.conv2d(net, 128, (4, 4), strides=(2, 2),
padding="SAME", name="d_conv2")
# [bs, h/4, w/4, 128]
if hparams.discriminator_batchnorm:
net = tf.layers.batch_normalization(net, training=is_training,
momentum=0.999, name="d_bn2")
net = lrelu(net)
size = height * width
net = tf.reshape(net, [batch_size, size * 8]) # [bs, h * w * 8]
net = tf.layers.dense(net, 1024, name="d_fc3") # [bs, 1024]
if hparams.discriminator_batchnorm:
net = tf.layers.batch_normalization(net, training=is_training,
momentum=0.999, name="d_bn3")
net = lrelu(net)
return net
|
python
|
def discriminator(self, x, is_training, reuse=False):
"""Discriminator architecture based on InfoGAN.
Args:
x: input images, shape [bs, h, w, channels]
is_training: boolean, are we in train or eval model.
reuse: boolean, should params be re-used.
Returns:
out_logit: the output logits (before sigmoid).
"""
hparams = self.hparams
with tf.variable_scope(
"discriminator", reuse=reuse,
initializer=tf.random_normal_initializer(stddev=0.02)):
batch_size, height, width = common_layers.shape_list(x)[:3]
# Mapping x from [bs, h, w, c] to [bs, 1]
net = tf.layers.conv2d(x, 64, (4, 4), strides=(2, 2),
padding="SAME", name="d_conv1")
# [bs, h/2, w/2, 64]
net = lrelu(net)
net = tf.layers.conv2d(net, 128, (4, 4), strides=(2, 2),
padding="SAME", name="d_conv2")
# [bs, h/4, w/4, 128]
if hparams.discriminator_batchnorm:
net = tf.layers.batch_normalization(net, training=is_training,
momentum=0.999, name="d_bn2")
net = lrelu(net)
size = height * width
net = tf.reshape(net, [batch_size, size * 8]) # [bs, h * w * 8]
net = tf.layers.dense(net, 1024, name="d_fc3") # [bs, 1024]
if hparams.discriminator_batchnorm:
net = tf.layers.batch_normalization(net, training=is_training,
momentum=0.999, name="d_bn3")
net = lrelu(net)
return net
|
[
"def",
"discriminator",
"(",
"self",
",",
"x",
",",
"is_training",
",",
"reuse",
"=",
"False",
")",
":",
"hparams",
"=",
"self",
".",
"hparams",
"with",
"tf",
".",
"variable_scope",
"(",
"\"discriminator\"",
",",
"reuse",
"=",
"reuse",
",",
"initializer",
"=",
"tf",
".",
"random_normal_initializer",
"(",
"stddev",
"=",
"0.02",
")",
")",
":",
"batch_size",
",",
"height",
",",
"width",
"=",
"common_layers",
".",
"shape_list",
"(",
"x",
")",
"[",
":",
"3",
"]",
"# Mapping x from [bs, h, w, c] to [bs, 1]",
"net",
"=",
"tf",
".",
"layers",
".",
"conv2d",
"(",
"x",
",",
"64",
",",
"(",
"4",
",",
"4",
")",
",",
"strides",
"=",
"(",
"2",
",",
"2",
")",
",",
"padding",
"=",
"\"SAME\"",
",",
"name",
"=",
"\"d_conv1\"",
")",
"# [bs, h/2, w/2, 64]",
"net",
"=",
"lrelu",
"(",
"net",
")",
"net",
"=",
"tf",
".",
"layers",
".",
"conv2d",
"(",
"net",
",",
"128",
",",
"(",
"4",
",",
"4",
")",
",",
"strides",
"=",
"(",
"2",
",",
"2",
")",
",",
"padding",
"=",
"\"SAME\"",
",",
"name",
"=",
"\"d_conv2\"",
")",
"# [bs, h/4, w/4, 128]",
"if",
"hparams",
".",
"discriminator_batchnorm",
":",
"net",
"=",
"tf",
".",
"layers",
".",
"batch_normalization",
"(",
"net",
",",
"training",
"=",
"is_training",
",",
"momentum",
"=",
"0.999",
",",
"name",
"=",
"\"d_bn2\"",
")",
"net",
"=",
"lrelu",
"(",
"net",
")",
"size",
"=",
"height",
"*",
"width",
"net",
"=",
"tf",
".",
"reshape",
"(",
"net",
",",
"[",
"batch_size",
",",
"size",
"*",
"8",
"]",
")",
"# [bs, h * w * 8]",
"net",
"=",
"tf",
".",
"layers",
".",
"dense",
"(",
"net",
",",
"1024",
",",
"name",
"=",
"\"d_fc3\"",
")",
"# [bs, 1024]",
"if",
"hparams",
".",
"discriminator_batchnorm",
":",
"net",
"=",
"tf",
".",
"layers",
".",
"batch_normalization",
"(",
"net",
",",
"training",
"=",
"is_training",
",",
"momentum",
"=",
"0.999",
",",
"name",
"=",
"\"d_bn3\"",
")",
"net",
"=",
"lrelu",
"(",
"net",
")",
"return",
"net"
] |
Discriminator architecture based on InfoGAN.
Args:
x: input images, shape [bs, h, w, channels]
is_training: boolean, are we in train or eval model.
reuse: boolean, should params be re-used.
Returns:
out_logit: the output logits (before sigmoid).
|
[
"Discriminator",
"architecture",
"based",
"on",
"InfoGAN",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/models/vanilla_gan.py#L58-L93
|
train
|
Discriminator architecture based on InfoGAN.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N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A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(1707 - 1658) + chr(2184 - 2129) + chr(1082 - 1031), 59698 - 59690), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\062' + '\x30' + '\x30', 0b1000), ehT0Px3KOsy9('\060' + chr(111) + '\063' + chr(50) + chr(1626 - 1571), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(816 - 766) + chr(54) + chr(0b110011), ord("\x08")), ehT0Px3KOsy9(chr(1870 - 1822) + chr(0b1101111) + chr(0b100 + 0o56) + chr(0b110001) + '\066', 0o10), ehT0Px3KOsy9(chr(144 - 96) + chr(0b1011010 + 0o25) + '\062' + '\x34' + '\x30', 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(51) + chr(0b110111) + chr(969 - 916), 0b1000), ehT0Px3KOsy9(chr(48) + chr(9306 - 9195) + chr(0b1100 + 0o45) + chr(2042 - 1991), 0o10), ehT0Px3KOsy9('\x30' + chr(10931 - 10820) + chr(0b1000 + 0o54) + chr(0b101010 + 0o14), ord("\x08")), ehT0Px3KOsy9(chr(0b100111 + 0o11) + '\x6f' + chr(0b110010 + 0o0) + '\062' + '\066', 63443 - 63435), ehT0Px3KOsy9(chr(0b1 + 0o57) + '\157' + chr(2184 - 2134) + chr(0b110010) + chr(0b110101 + 0o1), 8), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(1023 - 968) + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(0b101001 + 0o7) + chr(0b1101111) + '\066' + chr(1026 - 976), 0b1000), ehT0Px3KOsy9(chr(852 - 804) + chr(8632 - 8521) + '\x31' + chr(1194 - 1145) + chr(55), ord("\x08")), ehT0Px3KOsy9(chr(1246 - 1198) + '\157' + chr(0b100100 + 0o17) + chr(48) + chr(0b110101), 0o10), ehT0Px3KOsy9(chr(48) + chr(111) + chr(0b110101), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(1895 - 1844) + chr(50) + chr(55), 8), ehT0Px3KOsy9(chr(927 - 879) + '\157' + '\x32' + chr(0b110001) + '\061', 20475 - 20467), ehT0Px3KOsy9(chr(48) + chr(0b11110 + 0o121) + chr(0b110001) + '\063' + chr(0b110110 + 0o1), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(50) + chr(515 - 467), 0b1000), ehT0Px3KOsy9(chr(1840 - 1792) + chr(9182 - 9071) + chr(0b110100) + chr(0b110111), 47954 - 47946), ehT0Px3KOsy9(chr(782 - 734) + '\157' + chr(0b110001) + chr(0b110011) + chr(2229 - 2176), 62149 - 62141), ehT0Px3KOsy9('\060' + chr(111) + chr(0b110011) + chr(0b110001) + '\063', 0o10), ehT0Px3KOsy9(chr(661 - 613) + chr(0b1101111) + chr(0b110011), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(7167 - 7056) + chr(0b110011) + '\x36' + chr(390 - 336), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110010) + '\065' + chr(0b1011 + 0o50), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(0b100000 + 0o22) + '\066' + chr(1020 - 968), 56495 - 56487), ehT0Px3KOsy9(chr(889 - 841) + chr(0b1101111) + chr(0b110110) + '\x33', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(12127 - 12016) + chr(49) + '\062' + chr(0b11011 + 0o26), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(75 - 26) + chr(0b0 + 0o62) + chr(0b110110), 20761 - 20753), ehT0Px3KOsy9(chr(0b110000) + chr(0b11100 + 0o123) + chr(0b110001) + chr(53), 0o10), ehT0Px3KOsy9(chr(0b111 + 0o51) + '\x6f' + chr(0b110011) + chr(0b101011 + 0o10) + chr(0b110011), 0b1000), ehT0Px3KOsy9('\060' + chr(7780 - 7669) + chr(0b110001) + chr(187 - 138) + chr(273 - 218), 8), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x35' + '\063', 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x32' + '\064' + chr(1189 - 1136), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(2257 - 2206), 8), ehT0Px3KOsy9('\060' + '\x6f' + chr(0b110010) + chr(202 - 149), 0b1000), ehT0Px3KOsy9(chr(0b1 + 0o57) + chr(0b1101111) + chr(1387 - 1336) + '\x35' + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(1681 - 1633) + chr(0b100000 + 0o117) + chr(0b101111 + 0o2) + chr(0b10101 + 0o41) + chr(2064 - 2011), ord("\x08")), ehT0Px3KOsy9(chr(0b1 + 0o57) + chr(0b1101111) + chr(347 - 297) + '\x34' + '\060', 8)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + chr(111) + chr(0b110101) + '\x30', 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'U'), '\x64' + '\x65' + chr(0b1001000 + 0o33) + chr(9209 - 9098) + chr(0b110 + 0o136) + '\x65')(chr(9585 - 9468) + '\164' + chr(0b101010 + 0o74) + '\055' + '\070') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def PgtWWoVsho2z(oVre8I6UXc3b, OeWW0F1dBPRQ, XQJVi3cQFN5l, pmC5wdSFgdFj=ehT0Px3KOsy9('\060' + '\x6f' + '\060', 0o10)):
n4ljua2gi1Pr = oVre8I6UXc3b.n4ljua2gi1Pr
with xafqLlk3kkUe(IDJ2eXGCBCDu, xafqLlk3kkUe(SXOLrMavuUCe(b'\r\xe1\xa5\xda\xef\xc2\x91ny\xe5\xf5SB*'), '\144' + chr(0b1100101) + chr(0b1100011) + chr(0b1101111) + chr(0b1010000 + 0o24) + chr(101))(chr(0b1001111 + 0o46) + chr(0b1110100) + '\x66' + chr(0b101101) + '\x38'))(xafqLlk3kkUe(SXOLrMavuUCe(b'\x1f\xe9\xa4\xd0\xfc\xc9\x90bH\xf7\xe2S@'), '\144' + chr(0b1001011 + 0o32) + chr(99) + '\157' + '\144' + '\145')('\x75' + chr(0b1110100) + '\x66' + chr(0b101101) + chr(1061 - 1005)), reuse=pmC5wdSFgdFj, initializer=xafqLlk3kkUe(IDJ2eXGCBCDu, xafqLlk3kkUe(SXOLrMavuUCe(b'\t\xe1\xb9\xd7\xe1\xcd\xa2eI\xe4\xfb]^\x10\xack\xbe\xfd6qK4\xb1f\x84'), chr(4647 - 4547) + chr(9760 - 9659) + chr(0b1001100 + 0o27) + chr(0b1100101 + 0o12) + chr(5093 - 4993) + chr(10114 - 10013))('\165' + chr(0b1110100) + chr(7448 - 7346) + chr(0b101101) + chr(0b11010 + 0o36)))(stddev=0.02)):
(ix9dZyeAmUxY, ehbUULKuygfC, mPx09rBTrGXR) = jSKPaHwSAfVv.shape_list(OeWW0F1dBPRQ)[:ehT0Px3KOsy9('\060' + '\x6f' + chr(51 - 0), 8)]
DyzboKL9cczb = IDJ2eXGCBCDu.layers.conv2d(OeWW0F1dBPRQ, ehT0Px3KOsy9(chr(48) + '\x6f' + '\061' + chr(0b110000) + '\x30', ord("\x08")), (ehT0Px3KOsy9('\x30' + chr(0b1011000 + 0o27) + chr(1723 - 1671), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110100), 8)), strides=(ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(50), 0b1000), ehT0Px3KOsy9('\060' + chr(3915 - 3804) + chr(142 - 92), 8)), padding=xafqLlk3kkUe(SXOLrMavuUCe(b'(\xc1\x9a\xf6'), chr(2916 - 2816) + chr(0b1100101) + '\143' + chr(0b1101111) + '\144' + chr(101))('\x75' + '\x74' + chr(0b1000100 + 0o42) + chr(0b101101) + '\070'), name=xafqLlk3kkUe(SXOLrMavuUCe(b'\x1f\xdf\xb4\xdc\xe0\xd6\xcc'), chr(100) + '\x65' + '\143' + '\157' + chr(0b1100100) + chr(101))(chr(0b1000101 + 0o60) + chr(0b1100111 + 0o15) + chr(102) + '\055' + chr(56)))
DyzboKL9cczb = cTCWPzYxG6P7(DyzboKL9cczb)
DyzboKL9cczb = IDJ2eXGCBCDu.layers.conv2d(DyzboKL9cczb, ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(50) + chr(1261 - 1213) + chr(0b10011 + 0o35), 8), (ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110100), 8), ehT0Px3KOsy9(chr(0b10010 + 0o36) + chr(111) + chr(52), 8)), strides=(ehT0Px3KOsy9(chr(0b101001 + 0o7) + chr(4488 - 4377) + '\x32', 8), ehT0Px3KOsy9(chr(48) + chr(111) + chr(50), 8)), padding=xafqLlk3kkUe(SXOLrMavuUCe(b'(\xc1\x9a\xf6'), chr(8332 - 8232) + chr(0b1100101) + chr(0b1100011) + chr(0b1101111) + chr(0b1001111 + 0o25) + '\145')('\x75' + chr(0b1100111 + 0o15) + '\146' + chr(0b10 + 0o53) + chr(0b110100 + 0o4)), name=xafqLlk3kkUe(SXOLrMavuUCe(b'\x1f\xdf\xb4\xdc\xe0\xd6\xcf'), chr(0b1010001 + 0o23) + chr(7870 - 7769) + chr(0b1100011) + chr(11434 - 11323) + chr(0b1100100) + chr(0b1100101))(chr(0b1110101) + '\164' + '\146' + chr(0b101101) + '\070'))
if xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'\x1f\xe9\xa4\xd0\xfc\xc9\x90bH\xf7\xe2S@\x10\xa7d\xa3\xea7~H/\xa6'), chr(100) + '\x65' + chr(99) + chr(10651 - 10540) + chr(0b1100100) + '\x65')(chr(6050 - 5933) + '\164' + chr(0b1100110) + chr(45) + chr(56))):
DyzboKL9cczb = IDJ2eXGCBCDu.layers.batch_normalization(DyzboKL9cczb, training=XQJVi3cQFN5l, momentum=0.999, name=xafqLlk3kkUe(SXOLrMavuUCe(b'\x1f\xdf\xb5\xdd\xbc'), chr(100) + chr(5119 - 5018) + chr(0b1100011) + '\x6f' + chr(100) + chr(0b111000 + 0o55))('\165' + '\164' + chr(102) + chr(0b101101) + '\x38'))
DyzboKL9cczb = cTCWPzYxG6P7(DyzboKL9cczb)
NLcc3BCJnQka = ehbUULKuygfC * mPx09rBTrGXR
DyzboKL9cczb = IDJ2eXGCBCDu.reshape(DyzboKL9cczb, [ix9dZyeAmUxY, NLcc3BCJnQka * ehT0Px3KOsy9(chr(48) + '\157' + chr(1602 - 1553) + '\060', ord("\x08"))])
DyzboKL9cczb = IDJ2eXGCBCDu.layers.dense(DyzboKL9cczb, ehT0Px3KOsy9(chr(0b101000 + 0o10) + chr(0b1101111) + '\x32' + chr(0b0 + 0o60) + chr(48) + chr(0b100 + 0o54), ord("\x08")), name=xafqLlk3kkUe(SXOLrMavuUCe(b'\x1f\xdf\xb1\xd0\xbd'), chr(0b1001001 + 0o33) + '\x65' + chr(8064 - 7965) + '\x6f' + chr(9848 - 9748) + '\145')(chr(0b111100 + 0o71) + '\x74' + '\x66' + chr(45) + chr(0b10010 + 0o46)))
if xafqLlk3kkUe(n4ljua2gi1Pr, xafqLlk3kkUe(SXOLrMavuUCe(b'\x1f\xe9\xa4\xd0\xfc\xc9\x90bH\xf7\xe2S@\x10\xa7d\xa3\xea7~H/\xa6'), chr(0b1001101 + 0o27) + chr(0b1100101) + chr(6880 - 6781) + '\x6f' + chr(0b10011 + 0o121) + '\145')(chr(117) + '\x74' + chr(0b1100110) + '\055' + '\070')):
DyzboKL9cczb = IDJ2eXGCBCDu.layers.batch_normalization(DyzboKL9cczb, training=XQJVi3cQFN5l, momentum=0.999, name=xafqLlk3kkUe(SXOLrMavuUCe(b'\x1f\xdf\xb5\xdd\xbd'), chr(2706 - 2606) + '\145' + chr(0b101001 + 0o72) + chr(0b1101111) + chr(100) + '\x65')(chr(8026 - 7909) + '\x74' + chr(102) + '\x2d' + '\070'))
DyzboKL9cczb = cTCWPzYxG6P7(DyzboKL9cczb)
return DyzboKL9cczb
|
tensorflow/tensor2tensor
|
tensor2tensor/models/vanilla_gan.py
|
AbstractGAN.generator
|
def generator(self, z, is_training, out_shape):
"""Generator outputting image in [0, 1]."""
hparams = self.hparams
height, width, c_dim = out_shape
batch_size = hparams.batch_size
with tf.variable_scope(
"generator",
initializer=tf.random_normal_initializer(stddev=0.02)):
net = tf.layers.dense(z, 1024, name="g_fc1")
net = tf.layers.batch_normalization(net, training=is_training,
momentum=0.999, name="g_bn1")
net = lrelu(net)
net = tf.layers.dense(net, 128 * (height // 4) * (width // 4),
name="g_fc2")
net = tf.layers.batch_normalization(net, training=is_training,
momentum=0.999, name="g_bn2")
net = lrelu(net)
net = tf.reshape(net, [batch_size, height // 4, width // 4, 128])
net = deconv2d(net, [batch_size, height // 2, width // 2, 64],
4, 4, 2, 2, name="g_dc3")
net = tf.layers.batch_normalization(net, training=is_training,
momentum=0.999, name="g_bn3")
net = lrelu(net)
net = deconv2d(net, [batch_size, height, width, c_dim],
4, 4, 2, 2, name="g_dc4")
out = tf.nn.sigmoid(net)
return common_layers.convert_real_to_rgb(out)
|
python
|
def generator(self, z, is_training, out_shape):
"""Generator outputting image in [0, 1]."""
hparams = self.hparams
height, width, c_dim = out_shape
batch_size = hparams.batch_size
with tf.variable_scope(
"generator",
initializer=tf.random_normal_initializer(stddev=0.02)):
net = tf.layers.dense(z, 1024, name="g_fc1")
net = tf.layers.batch_normalization(net, training=is_training,
momentum=0.999, name="g_bn1")
net = lrelu(net)
net = tf.layers.dense(net, 128 * (height // 4) * (width // 4),
name="g_fc2")
net = tf.layers.batch_normalization(net, training=is_training,
momentum=0.999, name="g_bn2")
net = lrelu(net)
net = tf.reshape(net, [batch_size, height // 4, width // 4, 128])
net = deconv2d(net, [batch_size, height // 2, width // 2, 64],
4, 4, 2, 2, name="g_dc3")
net = tf.layers.batch_normalization(net, training=is_training,
momentum=0.999, name="g_bn3")
net = lrelu(net)
net = deconv2d(net, [batch_size, height, width, c_dim],
4, 4, 2, 2, name="g_dc4")
out = tf.nn.sigmoid(net)
return common_layers.convert_real_to_rgb(out)
|
[
"def",
"generator",
"(",
"self",
",",
"z",
",",
"is_training",
",",
"out_shape",
")",
":",
"hparams",
"=",
"self",
".",
"hparams",
"height",
",",
"width",
",",
"c_dim",
"=",
"out_shape",
"batch_size",
"=",
"hparams",
".",
"batch_size",
"with",
"tf",
".",
"variable_scope",
"(",
"\"generator\"",
",",
"initializer",
"=",
"tf",
".",
"random_normal_initializer",
"(",
"stddev",
"=",
"0.02",
")",
")",
":",
"net",
"=",
"tf",
".",
"layers",
".",
"dense",
"(",
"z",
",",
"1024",
",",
"name",
"=",
"\"g_fc1\"",
")",
"net",
"=",
"tf",
".",
"layers",
".",
"batch_normalization",
"(",
"net",
",",
"training",
"=",
"is_training",
",",
"momentum",
"=",
"0.999",
",",
"name",
"=",
"\"g_bn1\"",
")",
"net",
"=",
"lrelu",
"(",
"net",
")",
"net",
"=",
"tf",
".",
"layers",
".",
"dense",
"(",
"net",
",",
"128",
"*",
"(",
"height",
"//",
"4",
")",
"*",
"(",
"width",
"//",
"4",
")",
",",
"name",
"=",
"\"g_fc2\"",
")",
"net",
"=",
"tf",
".",
"layers",
".",
"batch_normalization",
"(",
"net",
",",
"training",
"=",
"is_training",
",",
"momentum",
"=",
"0.999",
",",
"name",
"=",
"\"g_bn2\"",
")",
"net",
"=",
"lrelu",
"(",
"net",
")",
"net",
"=",
"tf",
".",
"reshape",
"(",
"net",
",",
"[",
"batch_size",
",",
"height",
"//",
"4",
",",
"width",
"//",
"4",
",",
"128",
"]",
")",
"net",
"=",
"deconv2d",
"(",
"net",
",",
"[",
"batch_size",
",",
"height",
"//",
"2",
",",
"width",
"//",
"2",
",",
"64",
"]",
",",
"4",
",",
"4",
",",
"2",
",",
"2",
",",
"name",
"=",
"\"g_dc3\"",
")",
"net",
"=",
"tf",
".",
"layers",
".",
"batch_normalization",
"(",
"net",
",",
"training",
"=",
"is_training",
",",
"momentum",
"=",
"0.999",
",",
"name",
"=",
"\"g_bn3\"",
")",
"net",
"=",
"lrelu",
"(",
"net",
")",
"net",
"=",
"deconv2d",
"(",
"net",
",",
"[",
"batch_size",
",",
"height",
",",
"width",
",",
"c_dim",
"]",
",",
"4",
",",
"4",
",",
"2",
",",
"2",
",",
"name",
"=",
"\"g_dc4\"",
")",
"out",
"=",
"tf",
".",
"nn",
".",
"sigmoid",
"(",
"net",
")",
"return",
"common_layers",
".",
"convert_real_to_rgb",
"(",
"out",
")"
] |
Generator outputting image in [0, 1].
|
[
"Generator",
"outputting",
"image",
"in",
"[",
"0",
"1",
"]",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/models/vanilla_gan.py#L95-L121
|
train
|
Generator outputting image in [ 0 1 ).
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,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zTRfSmY,reqGiMiVQ77y,bsS9P6_LpdIe,sbGAZlkZOtyh,Cf_Qef15s3_F,eX02hlZjMfR0,wLqBDw8l0eIm,g1Uy6IV0tyJQ,f9CsFWzvg0Vq,YlkZvXL8qwsX,MCqssyYhLtLC,bpgWCAbiJWkL,CMUdZtaORwo4,hi1V0ySZcNds,kkSX4ccExqw4,V4roHaS3Ppej,o8rvoPw8ep3k,xafqLlk3kkUe,h0qciNl3EEEj,lot1PSoAwYhj,xfhwxiBOH72k,HcyiPkCViZiX,fOIXYo9a1WNS,z8EhBlYI2Bx4,Y3jVKaC8LEDU,ehT0Px3KOsy9,PlSM16l2KDPD,J6u1YyThfhgG,ZdP978XkGspL,c2A0yzQpDQB3,I7ZO3Ma9cXBb,YyaZ4tpXu4lf,eHmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b10101 + 0o33) + '\157' + chr(51) + chr(0b110000) + chr(157 - 106), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1100011 + 0o14) + '\061' + chr(55) + chr(0b110101), 35644 - 35636), ehT0Px3KOsy9(chr(0b110000) + chr(0b101100 + 0o103) + chr(2321 - 2270) + chr(0b0 + 0o61) + '\x32', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(111) + '\063' + chr(0b11001 + 0o35) + chr(48), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(50) + chr(307 - 259) + '\065', ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x32' + '\x30' + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b101001 + 0o12) + chr(0b11000 + 0o31) + chr(1169 - 1114), 53305 - 53297), ehT0Px3KOsy9('\x30' + chr(7567 - 7456) + '\x33' + chr(53) + '\067', ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(0b1111 + 0o42) + chr(835 - 782) + chr(0b110101), ord("\x08")), ehT0Px3KOsy9('\060' + chr(111) + '\x32' + chr(0b110100) + chr(0b10100 + 0o41), 0b1000), ehT0Px3KOsy9('\060' + chr(6585 - 6474) + '\x31' + '\x31' + '\066', 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(1405 - 1356) + chr(52) + '\x35', 0o10), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(1261 - 1210) + chr(0b110110 + 0o0) + chr(51), 20675 - 20667), ehT0Px3KOsy9(chr(0b1001 + 0o47) + chr(0b1101111) + '\063' + chr(48) + chr(0b110011), 8), ehT0Px3KOsy9(chr(586 - 538) + '\157' + '\x32' + '\063' + chr(0b101111 + 0o1), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(11543 - 11432) + '\063' + chr(0b110110) + '\x34', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101001 + 0o6) + chr(1100 - 1049) + chr(0b101 + 0o57) + chr(55), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\062' + chr(0b110110) + '\063', 0o10), ehT0Px3KOsy9('\x30' + chr(0b10001 + 0o136) + '\x31' + chr(0b10010 + 0o43) + '\067', 59603 - 59595), ehT0Px3KOsy9(chr(780 - 732) + chr(0b1100110 + 0o11) + chr(0b101100 + 0o12) + chr(0b110001 + 0o0), 0o10), ehT0Px3KOsy9(chr(0b11100 + 0o24) + chr(0b111110 + 0o61) + chr(0b110001) + '\x37' + chr(0b110001), 45684 - 45676), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x31' + chr(48) + '\063', 38793 - 38785), ehT0Px3KOsy9('\060' + chr(111) + '\063' + chr(1771 - 1719) + chr(0b11111 + 0o30), 8), ehT0Px3KOsy9(chr(269 - 221) + chr(111) + '\063' + chr(0b110011 + 0o4) + chr(0b111 + 0o56), 11087 - 11079), ehT0Px3KOsy9(chr(0b11101 + 0o23) + chr(0b1101111) + chr(0b100 + 0o55) + chr(54) + '\064', 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110101) + '\x37', 0o10), ehT0Px3KOsy9('\060' + chr(111) + '\x37', 0b1000), ehT0Px3KOsy9(chr(48) + chr(12159 - 12048) + chr(388 - 337) + '\067' + '\x30', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(5150 - 5039) + chr(2363 - 2313) + chr(0b110100) + chr(2513 - 2460), 8), ehT0Px3KOsy9(chr(1166 - 1118) + '\x6f' + chr(49) + chr(0b110111) + chr(52), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\062' + '\x34' + chr(2559 - 2504), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x31', 0o10), ehT0Px3KOsy9(chr(0b11000 + 0o30) + '\x6f' + chr(0b110011) + chr(0b1101 + 0o50) + '\x34', ord("\x08")), ehT0Px3KOsy9(chr(0b100000 + 0o20) + chr(0b1101111) + chr(49) + chr(52) + chr(0b101001 + 0o7), 33360 - 33352), ehT0Px3KOsy9(chr(0b110000) + chr(0b1000101 + 0o52) + chr(51) + chr(0b110111 + 0o0) + chr(887 - 833), 0b1000), ehT0Px3KOsy9('\060' + chr(5904 - 5793) + chr(368 - 319) + chr(0b1101 + 0o45) + '\064', 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x31' + chr(159 - 107) + '\064', 0b1000), ehT0Px3KOsy9(chr(832 - 784) + chr(659 - 548) + '\061' + chr(169 - 117) + chr(0b110001), ord("\x08")), ehT0Px3KOsy9(chr(0b10000 + 0o40) + '\x6f' + '\x35' + '\x30', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(574 - 463) + chr(0b110010) + '\x31' + chr(0b110111), 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + chr(111) + '\065' + '\x30', 8)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xed'), chr(100) + chr(2997 - 2896) + '\143' + chr(111) + chr(0b1100100) + '\x65')(chr(12085 - 11968) + chr(0b1110100) + chr(102) + '\055' + '\070') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def bTFcxMKbQoFz(oVre8I6UXc3b, AFGBo4BePxZi, XQJVi3cQFN5l, wjefSqyQUekw):
n4ljua2gi1Pr = oVre8I6UXc3b.n4ljua2gi1Pr
(ehbUULKuygfC, mPx09rBTrGXR, svOMa3HpAcEV) = wjefSqyQUekw
ix9dZyeAmUxY = n4ljua2gi1Pr.ix9dZyeAmUxY
with xafqLlk3kkUe(IDJ2eXGCBCDu, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb5\x1c\xb8\x99\xe4\xe0\xa3\x8a2\xd6-\n\x83\xa6'), chr(0b1100100) + chr(5069 - 4968) + chr(0b1000010 + 0o41) + '\157' + '\144' + chr(9102 - 9001))('\x75' + chr(3751 - 3635) + chr(102) + chr(245 - 200) + chr(0b101111 + 0o11)))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xa4\x18\xa4\x95\xf7\xe3\xbb\x80\x1f'), '\144' + chr(101) + chr(0b1100011) + chr(2275 - 2164) + '\144' + chr(101))('\x75' + '\x74' + chr(9080 - 8978) + '\055' + '\070'), initializer=xafqLlk3kkUe(IDJ2eXGCBCDu, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb1\x1c\xa4\x94\xea\xef\x90\x81\x02\xd7#\x04\x9f\x9c\xf1\x9a\x8e\xc7\x06P\x15*\x9d\x98\x06'), chr(0b1011111 + 0o5) + chr(101) + chr(2523 - 2424) + chr(0b1101111) + chr(7075 - 6975) + chr(4573 - 4472))(chr(0b1110101) + chr(12110 - 11994) + '\x66' + chr(1652 - 1607) + '\x38'))(stddev=0.02)):
DyzboKL9cczb = IDJ2eXGCBCDu.layers.dense(AFGBo4BePxZi, ehT0Px3KOsy9('\x30' + '\x6f' + '\062' + '\060' + chr(474 - 426) + chr(48), 0b1000), name=xafqLlk3kkUe(SXOLrMavuUCe(b'\xa4"\xac\x93\xb4'), '\144' + '\x65' + '\143' + chr(5060 - 4949) + chr(0b11000 + 0o114) + chr(1933 - 1832))(chr(117) + chr(116) + '\146' + chr(0b1001 + 0o44) + chr(1797 - 1741)))
DyzboKL9cczb = IDJ2eXGCBCDu.layers.batch_normalization(DyzboKL9cczb, training=XQJVi3cQFN5l, momentum=0.999, name=xafqLlk3kkUe(SXOLrMavuUCe(b'\xa4"\xa8\x9e\xb4'), '\144' + chr(0b100101 + 0o100) + chr(1478 - 1379) + chr(111) + chr(791 - 691) + chr(5840 - 5739))('\165' + chr(0b1100000 + 0o24) + '\x66' + chr(1715 - 1670) + chr(0b111000)))
DyzboKL9cczb = cTCWPzYxG6P7(DyzboKL9cczb)
DyzboKL9cczb = IDJ2eXGCBCDu.layers.dense(DyzboKL9cczb, ehT0Px3KOsy9('\060' + '\157' + chr(0b110010) + '\x30' + '\x30', 0o10) * (ehbUULKuygfC // ehT0Px3KOsy9(chr(48) + chr(111) + chr(64 - 12), ord("\x08"))) * (mPx09rBTrGXR // ehT0Px3KOsy9(chr(48) + '\x6f' + chr(52), 8)), name=xafqLlk3kkUe(SXOLrMavuUCe(b'\xa4"\xac\x93\xb7'), chr(0b1100100) + chr(101) + chr(0b1111 + 0o124) + chr(537 - 426) + '\x64' + '\x65')(chr(0b1110101) + chr(0b1110100) + chr(8987 - 8885) + '\055' + chr(0b111000)))
DyzboKL9cczb = IDJ2eXGCBCDu.layers.batch_normalization(DyzboKL9cczb, training=XQJVi3cQFN5l, momentum=0.999, name=xafqLlk3kkUe(SXOLrMavuUCe(b'\xa4"\xa8\x9e\xb7'), chr(100) + chr(101) + chr(0b1100011) + chr(0b1111 + 0o140) + chr(0b1100100) + chr(5331 - 5230))(chr(0b1110101) + chr(0b100001 + 0o123) + chr(102) + '\055' + '\x38'))
DyzboKL9cczb = cTCWPzYxG6P7(DyzboKL9cczb)
DyzboKL9cczb = IDJ2eXGCBCDu.reshape(DyzboKL9cczb, [ix9dZyeAmUxY, ehbUULKuygfC // ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(52), 8), mPx09rBTrGXR // ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(1113 - 1061), 8), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b100110 + 0o14) + chr(1811 - 1763) + '\x30', 8)])
DyzboKL9cczb = hHBLYFrbv3ZL(DyzboKL9cczb, [ix9dZyeAmUxY, ehbUULKuygfC // ehT0Px3KOsy9(chr(0b110 + 0o52) + chr(111) + chr(50), 22618 - 22610), mPx09rBTrGXR // ehT0Px3KOsy9(chr(0b100 + 0o54) + '\157' + chr(0b1011 + 0o47), 8), ehT0Px3KOsy9(chr(0b110000) + chr(8317 - 8206) + '\x31' + chr(0b110000) + '\x30', 0o10)], ehT0Px3KOsy9('\x30' + '\157' + chr(737 - 685), 8), ehT0Px3KOsy9(chr(48) + chr(4551 - 4440) + chr(52), 8), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110010), 8), ehT0Px3KOsy9('\060' + '\157' + chr(0b1100 + 0o46), 8), name=xafqLlk3kkUe(SXOLrMavuUCe(b'\xa4"\xae\x93\xb6'), chr(4004 - 3904) + chr(0b1100101) + chr(99) + chr(10176 - 10065) + chr(0b1100100) + chr(101))('\165' + chr(0b1110100) + chr(0b1100110) + '\055' + chr(56)))
DyzboKL9cczb = IDJ2eXGCBCDu.layers.batch_normalization(DyzboKL9cczb, training=XQJVi3cQFN5l, momentum=0.999, name=xafqLlk3kkUe(SXOLrMavuUCe(b'\xa4"\xa8\x9e\xb6'), '\144' + '\x65' + '\143' + '\x6f' + chr(0b1011 + 0o131) + chr(4371 - 4270))('\165' + '\164' + '\146' + chr(0b10001 + 0o34) + chr(56)))
DyzboKL9cczb = cTCWPzYxG6P7(DyzboKL9cczb)
DyzboKL9cczb = hHBLYFrbv3ZL(DyzboKL9cczb, [ix9dZyeAmUxY, ehbUULKuygfC, mPx09rBTrGXR, svOMa3HpAcEV], ehT0Px3KOsy9(chr(48) + chr(6533 - 6422) + chr(0b110000 + 0o4), 8), ehT0Px3KOsy9(chr(0b100010 + 0o16) + chr(0b1101111) + '\064', 8), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110010), 8), ehT0Px3KOsy9('\060' + chr(111) + chr(0b11001 + 0o31), 8), name=xafqLlk3kkUe(SXOLrMavuUCe(b'\xa4"\xae\x93\xb1'), chr(100) + chr(101) + '\x63' + '\157' + chr(0b1100100) + chr(9912 - 9811))('\x75' + '\x74' + chr(102) + chr(45) + chr(1623 - 1567)))
UkrMp_I0RDmo = IDJ2eXGCBCDu.nn.sigmoid(DyzboKL9cczb)
return xafqLlk3kkUe(jSKPaHwSAfVv, xafqLlk3kkUe(SXOLrMavuUCe(b'\xa0\x12\xa4\x86\xe0\xf0\xbb\xb0\x1f\xc0/\t\xac\xb7\xf7\xab\x95\xd4\r'), chr(0b1100100) + chr(2613 - 2512) + chr(8314 - 8215) + chr(111) + chr(9953 - 9853) + '\x65')('\165' + '\x74' + chr(4854 - 4752) + '\x2d' + chr(0b101001 + 0o17)))(UkrMp_I0RDmo)
|
tensorflow/tensor2tensor
|
tensor2tensor/models/vanilla_gan.py
|
AbstractGAN.body
|
def body(self, features):
"""Body of the model.
Args:
features: a dictionary with the tensors.
Returns:
A pair (predictions, losses) where predictions is the generated image
and losses is a dictionary of losses (that get added for the final loss).
"""
features["targets"] = features["inputs"]
is_training = self.hparams.mode == tf.estimator.ModeKeys.TRAIN
# Input images.
inputs = tf.to_float(features["targets_raw"])
# Noise vector.
z = tf.random_uniform([self.hparams.batch_size,
self.hparams.bottleneck_bits],
minval=-1, maxval=1, name="z")
# Generator output: fake images.
out_shape = common_layers.shape_list(inputs)[1:4]
g = self.generator(z, is_training, out_shape)
losses = self.losses(inputs, g) # pylint: disable=not-callable
summary_g_image = tf.reshape(
g[0, :], [1] + common_layers.shape_list(inputs)[1:])
tf.summary.image("generated", summary_g_image, max_outputs=1)
if is_training: # Returns an dummy output and the losses dictionary.
return tf.zeros_like(inputs), losses
return tf.reshape(g, tf.shape(inputs)), losses
|
python
|
def body(self, features):
"""Body of the model.
Args:
features: a dictionary with the tensors.
Returns:
A pair (predictions, losses) where predictions is the generated image
and losses is a dictionary of losses (that get added for the final loss).
"""
features["targets"] = features["inputs"]
is_training = self.hparams.mode == tf.estimator.ModeKeys.TRAIN
# Input images.
inputs = tf.to_float(features["targets_raw"])
# Noise vector.
z = tf.random_uniform([self.hparams.batch_size,
self.hparams.bottleneck_bits],
minval=-1, maxval=1, name="z")
# Generator output: fake images.
out_shape = common_layers.shape_list(inputs)[1:4]
g = self.generator(z, is_training, out_shape)
losses = self.losses(inputs, g) # pylint: disable=not-callable
summary_g_image = tf.reshape(
g[0, :], [1] + common_layers.shape_list(inputs)[1:])
tf.summary.image("generated", summary_g_image, max_outputs=1)
if is_training: # Returns an dummy output and the losses dictionary.
return tf.zeros_like(inputs), losses
return tf.reshape(g, tf.shape(inputs)), losses
|
[
"def",
"body",
"(",
"self",
",",
"features",
")",
":",
"features",
"[",
"\"targets\"",
"]",
"=",
"features",
"[",
"\"inputs\"",
"]",
"is_training",
"=",
"self",
".",
"hparams",
".",
"mode",
"==",
"tf",
".",
"estimator",
".",
"ModeKeys",
".",
"TRAIN",
"# Input images.",
"inputs",
"=",
"tf",
".",
"to_float",
"(",
"features",
"[",
"\"targets_raw\"",
"]",
")",
"# Noise vector.",
"z",
"=",
"tf",
".",
"random_uniform",
"(",
"[",
"self",
".",
"hparams",
".",
"batch_size",
",",
"self",
".",
"hparams",
".",
"bottleneck_bits",
"]",
",",
"minval",
"=",
"-",
"1",
",",
"maxval",
"=",
"1",
",",
"name",
"=",
"\"z\"",
")",
"# Generator output: fake images.",
"out_shape",
"=",
"common_layers",
".",
"shape_list",
"(",
"inputs",
")",
"[",
"1",
":",
"4",
"]",
"g",
"=",
"self",
".",
"generator",
"(",
"z",
",",
"is_training",
",",
"out_shape",
")",
"losses",
"=",
"self",
".",
"losses",
"(",
"inputs",
",",
"g",
")",
"# pylint: disable=not-callable",
"summary_g_image",
"=",
"tf",
".",
"reshape",
"(",
"g",
"[",
"0",
",",
":",
"]",
",",
"[",
"1",
"]",
"+",
"common_layers",
".",
"shape_list",
"(",
"inputs",
")",
"[",
"1",
":",
"]",
")",
"tf",
".",
"summary",
".",
"image",
"(",
"\"generated\"",
",",
"summary_g_image",
",",
"max_outputs",
"=",
"1",
")",
"if",
"is_training",
":",
"# Returns an dummy output and the losses dictionary.",
"return",
"tf",
".",
"zeros_like",
"(",
"inputs",
")",
",",
"losses",
"return",
"tf",
".",
"reshape",
"(",
"g",
",",
"tf",
".",
"shape",
"(",
"inputs",
")",
")",
",",
"losses"
] |
Body of the model.
Args:
features: a dictionary with the tensors.
Returns:
A pair (predictions, losses) where predictions is the generated image
and losses is a dictionary of losses (that get added for the final loss).
|
[
"Body",
"of",
"the",
"model",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/models/vanilla_gan.py#L127-L160
|
train
|
The body of the model.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o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edError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9('\x30' + chr(1172 - 1061) + '\x33' + '\x31' + chr(52), 0o10), ehT0Px3KOsy9('\060' + chr(111) + chr(0b1101 + 0o44) + chr(0b110011) + chr(1860 - 1806), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(54) + chr(0b1100 + 0o44), 2041 - 2033), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(49) + '\x33' + chr(2365 - 2315), 0o10), ehT0Px3KOsy9('\060' + '\157' + chr(0b110010) + chr(51) + chr(1538 - 1487), 0b1000), ehT0Px3KOsy9('\060' + chr(5563 - 5452) + '\x33' + '\067' + chr(51), 42215 - 42207), ehT0Px3KOsy9(chr(0b101100 + 0o4) + '\x6f' + chr(828 - 779) + '\x30' + chr(2153 - 2103), ord("\x08")), ehT0Px3KOsy9(chr(0b10010 + 0o36) + '\x6f' + chr(50) + '\x35' + '\064', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1101111) + '\061' + '\x34', 43453 - 43445), ehT0Px3KOsy9(chr(799 - 751) + chr(111) + '\x33' + chr(500 - 448) + '\x33', 49290 - 49282), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(49) + chr(55) + chr(0b101011 + 0o14), 45668 - 45660), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110011 + 0o0) + chr(285 - 233) + chr(592 - 541), 8), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(0b110010) + '\x32' + '\x30', 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(51) + chr(1851 - 1797) + chr(1075 - 1025), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(2104 - 2053) + chr(0b110001) + chr(0b110111), 26463 - 26455), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\x31' + chr(54) + chr(0b100011 + 0o17), ord("\x08")), ehT0Px3KOsy9(chr(0b101 + 0o53) + chr(0b1101111) + '\064', 0o10), ehT0Px3KOsy9('\x30' + chr(6179 - 6068) + chr(0b110011) + chr(0b110010) + '\x34', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1000011 + 0o54) + chr(1290 - 1240) + '\x31' + chr(654 - 599), 0o10), ehT0Px3KOsy9(chr(48) + '\x6f' + '\061' + chr(50) + '\x36', 22196 - 22188), ehT0Px3KOsy9('\x30' + chr(0b11100 + 0o123) + chr(1846 - 1791) + chr(0b1 + 0o61), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b110001) + chr(2770 - 2717) + chr(0b1000 + 0o55), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + '\x37' + chr(0b110101), 0o10), ehT0Px3KOsy9('\060' + chr(111) + '\061' + '\x30' + '\065', ord("\x08")), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110010) + chr(0b100001 + 0o23) + chr(51), 0b1000), ehT0Px3KOsy9(chr(1135 - 1087) + '\157' + chr(0b110011) + chr(0b110001) + chr(498 - 450), 0b1000), ehT0Px3KOsy9(chr(48) + chr(2933 - 2822) + '\x31' + '\x33' + '\066', 8), ehT0Px3KOsy9(chr(48) + chr(0b1000101 + 0o52) + chr(1844 - 1792) + chr(50), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(49) + '\066' + chr(50), 8), ehT0Px3KOsy9(chr(0b1 + 0o57) + chr(7065 - 6954) + chr(49) + chr(50) + chr(0b110110), 8), ehT0Px3KOsy9(chr(1990 - 1942) + chr(0b1101111) + chr(55) + '\064', 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(2107 - 2056) + chr(0b11000 + 0o30) + '\066', 60226 - 60218), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b110011) + '\060' + '\061', 0b1000), ehT0Px3KOsy9('\060' + chr(111) + chr(51) + chr(0b100011 + 0o21) + chr(0b11101 + 0o25), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110011) + chr(50) + '\062', 0b1000), ehT0Px3KOsy9('\060' + chr(4390 - 4279) + '\x32' + chr(2216 - 2168) + '\066', 0b1000), ehT0Px3KOsy9('\060' + chr(0b1100000 + 0o17) + '\062' + '\062' + chr(0b11110 + 0o27), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110010) + chr(0b101 + 0o61) + chr(0b1010 + 0o50), 0o10), ehT0Px3KOsy9(chr(0b10 + 0o56) + '\x6f' + chr(0b110010) + '\x34' + '\061', ord("\x08")), ehT0Px3KOsy9(chr(0b101110 + 0o2) + '\x6f' + chr(0b110001 + 0o0) + '\060' + '\x35', 8)][WVxHKyX45z_L % ehT0Px3KOsy9('\060' + chr(2662 - 2551) + '\x35' + chr(1511 - 1463), ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xe2'), chr(0b1010 + 0o132) + chr(0b1100101) + chr(99) + chr(0b1101111) + '\x64' + '\x65')(chr(0b1110101) + chr(0b1110100) + '\x66' + chr(0b101101) + '\x38') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def TD8C81EGml3n(oVre8I6UXc3b, EEf4r9nUvta_):
EEf4r9nUvta_[xafqLlk3kkUe(SXOLrMavuUCe(b'\xb8?B=\xfe\x8f1'), chr(100) + '\145' + chr(99) + chr(0b1100111 + 0o10) + chr(0b1001100 + 0o30) + chr(101))('\165' + chr(0b1110100) + chr(0b1101 + 0o131) + chr(663 - 618) + '\x38')] = EEf4r9nUvta_[xafqLlk3kkUe(SXOLrMavuUCe(b'\xa50@/\xef\x88'), '\x64' + '\x65' + '\143' + '\157' + chr(0b1100011 + 0o1) + '\145')(chr(0b1010000 + 0o45) + '\x74' + '\x66' + chr(1576 - 1531) + '\x38')]
XQJVi3cQFN5l = oVre8I6UXc3b.hparams.mode == IDJ2eXGCBCDu.estimator.ModeKeys.TRAIN
vXoupepMtCXU = IDJ2eXGCBCDu.ZUL3kHBGU8Uu(EEf4r9nUvta_[xafqLlk3kkUe(SXOLrMavuUCe(b'\xb8?B=\xfe\x8f1\xf3~\x82\x08'), chr(0b1100001 + 0o3) + chr(1497 - 1396) + chr(2575 - 2476) + chr(3342 - 3231) + '\144' + chr(0b1100101))(chr(117) + '\164' + chr(9401 - 9299) + chr(45) + chr(1567 - 1511))])
AFGBo4BePxZi = IDJ2eXGCBCDu.random_uniform([oVre8I6UXc3b.hparams.ix9dZyeAmUxY, oVre8I6UXc3b.hparams.L0tf_yAed5SW], minval=-ehT0Px3KOsy9('\060' + '\157' + '\061', 0b1000), maxval=ehT0Px3KOsy9(chr(962 - 914) + chr(0b111001 + 0o66) + chr(0b110001), 8), name=xafqLlk3kkUe(SXOLrMavuUCe(b'\xb6'), '\x64' + chr(9570 - 9469) + chr(0b1100011) + chr(4525 - 4414) + '\x64' + '\x65')(chr(555 - 438) + '\x74' + chr(102) + '\x2d' + '\x38'))
wjefSqyQUekw = jSKPaHwSAfVv.shape_list(vXoupepMtCXU)[ehT0Px3KOsy9(chr(236 - 188) + chr(111) + chr(1287 - 1238), 8):ehT0Px3KOsy9(chr(0b100001 + 0o17) + '\157' + chr(52), 8)]
RWHpzFEeviFP = oVre8I6UXc3b.generator(AFGBo4BePxZi, XQJVi3cQFN5l, wjefSqyQUekw)
eJKWkHA7qzlZ = oVre8I6UXc3b.eJKWkHA7qzlZ(vXoupepMtCXU, RWHpzFEeviFP)
x0xh6BckERbX = IDJ2eXGCBCDu.reshape(RWHpzFEeviFP[ehT0Px3KOsy9(chr(861 - 813) + chr(111) + chr(0b110000), 0o10), :], [ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b11 + 0o56), 8)] + jSKPaHwSAfVv.shape_list(vXoupepMtCXU)[ehT0Px3KOsy9(chr(48) + chr(0b1001 + 0o146) + chr(0b110001), 8):])
xafqLlk3kkUe(IDJ2eXGCBCDu.summary, xafqLlk3kkUe(SXOLrMavuUCe(b'\x85:]\x1b\xd3\xac$\xef}\x91\x11\x93'), chr(0b1100100) + chr(101) + '\143' + '\x6f' + chr(100) + chr(101))(chr(1342 - 1225) + '\x74' + chr(595 - 493) + chr(0b101101) + '\070'))(xafqLlk3kkUe(SXOLrMavuUCe(b'\xab;^?\xe9\x9a6\xc9h'), chr(100) + '\x65' + chr(5028 - 4929) + chr(0b1101111) + chr(100) + chr(0b1100101))(chr(1803 - 1686) + '\x74' + chr(3883 - 3781) + '\055' + '\x38'), x0xh6BckERbX, max_outputs=ehT0Px3KOsy9('\060' + '\157' + chr(84 - 35), 8))
if XQJVi3cQFN5l:
return (xafqLlk3kkUe(IDJ2eXGCBCDu, xafqLlk3kkUe(SXOLrMavuUCe(b'\xb6;B5\xe8\xa4.\xc5g\x86'), chr(533 - 433) + chr(0b1100101) + chr(99) + '\157' + chr(100) + chr(0b111101 + 0o50))('\x75' + chr(0b1011010 + 0o32) + chr(9622 - 9520) + '\055' + '\x38'))(vXoupepMtCXU), eJKWkHA7qzlZ)
return (xafqLlk3kkUe(IDJ2eXGCBCDu, xafqLlk3kkUe(SXOLrMavuUCe(b"\xbe;C2\xfa\x8b'"), chr(100) + chr(101) + chr(0b1110 + 0o125) + chr(111) + chr(311 - 211) + chr(0b1100101))('\165' + chr(0b1100111 + 0o15) + chr(0b1001000 + 0o36) + chr(0b101101) + chr(0b110 + 0o62)))(RWHpzFEeviFP, xafqLlk3kkUe(IDJ2eXGCBCDu, xafqLlk3kkUe(SXOLrMavuUCe(b'\xa2?E\x03\xfd\xb7%\xc0X\x93\x1c\x81'), chr(8955 - 8855) + '\x65' + chr(7967 - 7868) + chr(111) + chr(0b1100100) + '\x65')(chr(117) + '\164' + '\x66' + chr(0b1110 + 0o37) + '\x38'))(vXoupepMtCXU)), eJKWkHA7qzlZ)
|
tensorflow/tensor2tensor
|
tensor2tensor/trax/inputs.py
|
inputs
|
def inputs(num_devices, dataset_name, data_dir=None, input_name=None,
num_chunks=0, append_targets=False):
"""Make Inputs for built-in datasets.
Args:
num_devices: how many devices to build the inputs for.
dataset_name: a TFDS or T2T dataset name. If it's a T2T dataset name, prefix
with "t2t_".
data_dir: data directory.
input_name: optional, name of the inputs from the dictionary.
num_chunks: optional, into how many pieces should we chunk (large inputs).
append_targets: optional, instead of inputs return a pair (inputs, targets)
which is useful for autoregressive models.
Returns:
trax.inputs.Inputs
"""
assert data_dir, "Must provide a data directory"
data_dir = os.path.expanduser(data_dir)
(train_batches, train_eval_batches, eval_batches,
input_name, input_shape) = _train_and_eval_batches(
dataset_name, data_dir, input_name, num_devices)
def numpy_stream(dataset):
return dataset_to_stream(
dataset, input_name,
num_chunks=num_chunks, append_targets=append_targets)
if num_chunks > 0:
length = input_shape[0]
input_shape = tuple(
[tuple([length // num_chunks] + list(input_shape)[1:])] * num_chunks)
return Inputs(train_stream=lambda: numpy_stream(train_batches),
train_eval_stream=lambda: numpy_stream(train_eval_batches),
eval_stream=lambda: numpy_stream(eval_batches),
input_shape=input_shape)
|
python
|
def inputs(num_devices, dataset_name, data_dir=None, input_name=None,
num_chunks=0, append_targets=False):
"""Make Inputs for built-in datasets.
Args:
num_devices: how many devices to build the inputs for.
dataset_name: a TFDS or T2T dataset name. If it's a T2T dataset name, prefix
with "t2t_".
data_dir: data directory.
input_name: optional, name of the inputs from the dictionary.
num_chunks: optional, into how many pieces should we chunk (large inputs).
append_targets: optional, instead of inputs return a pair (inputs, targets)
which is useful for autoregressive models.
Returns:
trax.inputs.Inputs
"""
assert data_dir, "Must provide a data directory"
data_dir = os.path.expanduser(data_dir)
(train_batches, train_eval_batches, eval_batches,
input_name, input_shape) = _train_and_eval_batches(
dataset_name, data_dir, input_name, num_devices)
def numpy_stream(dataset):
return dataset_to_stream(
dataset, input_name,
num_chunks=num_chunks, append_targets=append_targets)
if num_chunks > 0:
length = input_shape[0]
input_shape = tuple(
[tuple([length // num_chunks] + list(input_shape)[1:])] * num_chunks)
return Inputs(train_stream=lambda: numpy_stream(train_batches),
train_eval_stream=lambda: numpy_stream(train_eval_batches),
eval_stream=lambda: numpy_stream(eval_batches),
input_shape=input_shape)
|
[
"def",
"inputs",
"(",
"num_devices",
",",
"dataset_name",
",",
"data_dir",
"=",
"None",
",",
"input_name",
"=",
"None",
",",
"num_chunks",
"=",
"0",
",",
"append_targets",
"=",
"False",
")",
":",
"assert",
"data_dir",
",",
"\"Must provide a data directory\"",
"data_dir",
"=",
"os",
".",
"path",
".",
"expanduser",
"(",
"data_dir",
")",
"(",
"train_batches",
",",
"train_eval_batches",
",",
"eval_batches",
",",
"input_name",
",",
"input_shape",
")",
"=",
"_train_and_eval_batches",
"(",
"dataset_name",
",",
"data_dir",
",",
"input_name",
",",
"num_devices",
")",
"def",
"numpy_stream",
"(",
"dataset",
")",
":",
"return",
"dataset_to_stream",
"(",
"dataset",
",",
"input_name",
",",
"num_chunks",
"=",
"num_chunks",
",",
"append_targets",
"=",
"append_targets",
")",
"if",
"num_chunks",
">",
"0",
":",
"length",
"=",
"input_shape",
"[",
"0",
"]",
"input_shape",
"=",
"tuple",
"(",
"[",
"tuple",
"(",
"[",
"length",
"//",
"num_chunks",
"]",
"+",
"list",
"(",
"input_shape",
")",
"[",
"1",
":",
"]",
")",
"]",
"*",
"num_chunks",
")",
"return",
"Inputs",
"(",
"train_stream",
"=",
"lambda",
":",
"numpy_stream",
"(",
"train_batches",
")",
",",
"train_eval_stream",
"=",
"lambda",
":",
"numpy_stream",
"(",
"train_eval_batches",
")",
",",
"eval_stream",
"=",
"lambda",
":",
"numpy_stream",
"(",
"eval_batches",
")",
",",
"input_shape",
"=",
"input_shape",
")"
] |
Make Inputs for built-in datasets.
Args:
num_devices: how many devices to build the inputs for.
dataset_name: a TFDS or T2T dataset name. If it's a T2T dataset name, prefix
with "t2t_".
data_dir: data directory.
input_name: optional, name of the inputs from the dictionary.
num_chunks: optional, into how many pieces should we chunk (large inputs).
append_targets: optional, instead of inputs return a pair (inputs, targets)
which is useful for autoregressive models.
Returns:
trax.inputs.Inputs
|
[
"Make",
"Inputs",
"for",
"built",
"-",
"in",
"datasets",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/trax/inputs.py#L58-L95
|
train
|
Create Inputs for built - in datasets.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKt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Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b11001 + 0o27) + chr(0b1101111) + '\x33' + chr(51) + chr(0b100 + 0o63), 19318 - 19310), ehT0Px3KOsy9(chr(48) + chr(8803 - 8692) + chr(0b1111 + 0o43) + '\x34' + chr(0b110100 + 0o3), 60535 - 60527), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\061' + chr(50) + chr(0b110011), ord("\x08")), ehT0Px3KOsy9('\060' + '\157' + '\x33' + chr(50) + chr(48), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\063' + chr(0b10000 + 0o41), ord("\x08")), ehT0Px3KOsy9(chr(834 - 786) + chr(111) + chr(50) + chr(0b10000 + 0o47) + chr(49), 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b110001) + chr(0b100010 + 0o23) + chr(50), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x31' + chr(48) + chr(0b110101), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1010011 + 0o34) + '\x32' + chr(0b11100 + 0o30) + '\065', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b1001111 + 0o40) + chr(0b110010) + chr(0b110100) + chr(0b1110 + 0o43), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b101111 + 0o3) + chr(1687 - 1634) + chr(0b101111 + 0o3), 19671 - 19663), ehT0Px3KOsy9(chr(48) + chr(0b11111 + 0o120) + chr(51) + chr(0b110101) + '\x36', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x33' + chr(0b10001 + 0o43) + chr(0b1110 + 0o47), 8893 - 8885), ehT0Px3KOsy9(chr(48) + '\157' + '\x31' + '\x31' + '\064', 40998 - 40990), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101101 + 0o2) + chr(837 - 786) + '\x31' + chr(0b10 + 0o60), 24394 - 24386), ehT0Px3KOsy9(chr(229 - 181) + '\x6f' + chr(412 - 360) + '\x36', ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b11100 + 0o123) + '\x37' + '\x31', 0b1000), ehT0Px3KOsy9('\x30' + '\x6f' + chr(1246 - 1196) + '\064' + chr(0b110010), ord("\x08")), ehT0Px3KOsy9(chr(0b101110 + 0o2) + '\x6f' + chr(373 - 323) + '\063' + chr(182 - 134), 0b1000), ehT0Px3KOsy9(chr(0b1111 + 0o41) + '\x6f' + chr(0b101010 + 0o7) + chr(54), 0o10), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110001) + chr(2632 - 2579) + '\x33', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(6728 - 6617) + chr(49) + chr(54) + '\x33', 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + '\063' + '\x32' + chr(0b110011), 0b1000), ehT0Px3KOsy9(chr(48) + '\157' + '\061' + chr(53) + '\060', 0b1000), ehT0Px3KOsy9(chr(0b10001 + 0o37) + chr(0b1011 + 0o144) + chr(0b110110) + '\066', 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1011001 + 0o26) + chr(0b110011) + chr(54) + chr(0b11010 + 0o35), 0b1000), ehT0Px3KOsy9(chr(48) + '\x6f' + '\x33' + chr(52) + '\x35', 8), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\x33' + chr(95 - 44) + chr(0b110101), 0b1000), ehT0Px3KOsy9(chr(1442 - 1394) + chr(0b11100 + 0o123) + '\x33' + '\x37', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1001111 + 0o40) + '\066' + chr(0b100001 + 0o23), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(565 - 515) + chr(55) + '\x31', 8), ehT0Px3KOsy9(chr(1683 - 1635) + chr(0b1101111) + chr(51) + chr(0b1010 + 0o50) + chr(249 - 195), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(716 - 605) + chr(51) + '\x32' + chr(2399 - 2349), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110010) + chr(0b101011 + 0o11) + chr(0b101 + 0o62), 8), ehT0Px3KOsy9('\060' + chr(0b1000011 + 0o54) + '\x33' + chr(0b110111) + chr(1620 - 1571), 27407 - 27399), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b1100 + 0o47) + chr(52), 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(0b110011) + '\x34' + chr(0b110100), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + '\x31' + chr(0b10010 + 0o40) + chr(0b110101), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b100001 + 0o22) + chr(743 - 695) + chr(1992 - 1942), 60734 - 60726), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x32' + chr(0b11 + 0o61) + '\x30', 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b110101 + 0o0) + chr(0b110000), 3304 - 3296)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xf1'), chr(4519 - 4419) + chr(101) + chr(0b11111 + 0o104) + '\157' + chr(543 - 443) + chr(0b1000001 + 0o44))('\165' + '\164' + chr(0b1100110) + chr(1954 - 1909) + '\x38') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def vXoupepMtCXU(eK0vLxsq0cly, p_vJ076GqAjR, kVFRD544hi_1=None, T1P2HfUVrGuW=None, BlFrQS9ngZ43=ehT0Px3KOsy9('\x30' + chr(9250 - 9139) + '\x30', 0o10), RUyVFghp0aLq=ehT0Px3KOsy9(chr(0b110000) + chr(0b111011 + 0o64) + '\x30', 8)):
assert kVFRD544hi_1, xafqLlk3kkUe(SXOLrMavuUCe(b'\x92\xd2 \xa49\xc9\x18*\xd3\xc8\xce\x8b\xc5-\xeaBX\xd6\xf9.\x0f\x1a\xa1\rU\x83\x8a\xaff'), '\x64' + '\x65' + '\x63' + chr(0b100111 + 0o110) + chr(6875 - 6775) + chr(7163 - 7062))(chr(7324 - 7207) + chr(116) + chr(0b1100110) + chr(0b101010 + 0o3) + '\x38')
kVFRD544hi_1 = oqhJDdMJfuwx.path.expanduser(kVFRD544hi_1)
(K4VUJHAd1wl8, WsS9H6uHiqxt, RPGQtUZ2bC76, T1P2HfUVrGuW, tANyZeuTfu5y) = AAEGeRVs7aFT(p_vJ076GqAjR, kVFRD544hi_1, T1P2HfUVrGuW, eK0vLxsq0cly)
def BfwH63HTHS5D(xQt6gV9VfTO3):
return l_3a5CRvTADe(xQt6gV9VfTO3, T1P2HfUVrGuW, num_chunks=BlFrQS9ngZ43, append_targets=RUyVFghp0aLq)
if BlFrQS9ngZ43 > ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b110000), 8):
CHAOgk5VCHH_ = tANyZeuTfu5y[ehT0Px3KOsy9(chr(0b110000) + chr(0b1100000 + 0o17) + chr(1905 - 1857), 8)]
tANyZeuTfu5y = KNyTy8rYcwji([KNyTy8rYcwji([CHAOgk5VCHH_ // BlFrQS9ngZ43] + YyaZ4tpXu4lf(tANyZeuTfu5y)[ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(49), 0o10):])] * BlFrQS9ngZ43)
return RZrosssZ9Fqo(train_stream=lambda : BfwH63HTHS5D(K4VUJHAd1wl8), train_eval_stream=lambda : BfwH63HTHS5D(WsS9H6uHiqxt), eval_stream=lambda : BfwH63HTHS5D(RPGQtUZ2bC76), input_shape=tANyZeuTfu5y)
|
tensorflow/tensor2tensor
|
tensor2tensor/trax/inputs.py
|
random_inputs
|
def random_inputs(
num_devices,
input_shape=gin.REQUIRED, input_dtype=np.int32, input_range=(0, 255),
output_shape=gin.REQUIRED, output_dtype=np.int32, output_range=(0, 9)):
"""Make random Inputs for debugging.
Args:
num_devices: how many devices to build the inputs for.
input_shape: the shape of inputs (including batch dimension).
input_dtype: the type of the inputs (int32 by default).
input_range: the range of inputs (defaults to (0, 255)).
output_shape: the shape of outputs (including batch dimension).
output_dtype: the type of the outputs (int32 by default).
output_range: the range of outputs (defaults to (0, 9)).
Returns:
trax.inputs.Inputs
"""
if input_shape[0] % num_devices != 0:
tf.logging.fatal(
"num_devices[%d] should divide the first dimension of input_shape[%s]",
num_devices, input_shape)
if output_shape[0] % num_devices != 0:
tf.logging.fatal(
"num_devices[%d] should divide the first dimension of output_shape[%s]",
num_devices, output_shape)
def random_minibatches():
"""Generate a stream of random mini-batches."""
if input_dtype in [np.float16, np.float32, np.float64]:
rand = np.random.uniform
else:
rand = np.random.random_integers
while True:
inp = rand(input_range[0], input_range[1], input_shape)
inp = inp.astype(input_dtype)
out = rand(output_range[0], output_range[1], output_shape)
out = out.astype(output_dtype)
yield inp, out
input_shape_without_batch = list(input_shape)[1:]
return Inputs(train_stream=random_minibatches,
train_eval_stream=random_minibatches,
eval_stream=random_minibatches,
input_shape=input_shape_without_batch)
|
python
|
def random_inputs(
num_devices,
input_shape=gin.REQUIRED, input_dtype=np.int32, input_range=(0, 255),
output_shape=gin.REQUIRED, output_dtype=np.int32, output_range=(0, 9)):
"""Make random Inputs for debugging.
Args:
num_devices: how many devices to build the inputs for.
input_shape: the shape of inputs (including batch dimension).
input_dtype: the type of the inputs (int32 by default).
input_range: the range of inputs (defaults to (0, 255)).
output_shape: the shape of outputs (including batch dimension).
output_dtype: the type of the outputs (int32 by default).
output_range: the range of outputs (defaults to (0, 9)).
Returns:
trax.inputs.Inputs
"""
if input_shape[0] % num_devices != 0:
tf.logging.fatal(
"num_devices[%d] should divide the first dimension of input_shape[%s]",
num_devices, input_shape)
if output_shape[0] % num_devices != 0:
tf.logging.fatal(
"num_devices[%d] should divide the first dimension of output_shape[%s]",
num_devices, output_shape)
def random_minibatches():
"""Generate a stream of random mini-batches."""
if input_dtype in [np.float16, np.float32, np.float64]:
rand = np.random.uniform
else:
rand = np.random.random_integers
while True:
inp = rand(input_range[0], input_range[1], input_shape)
inp = inp.astype(input_dtype)
out = rand(output_range[0], output_range[1], output_shape)
out = out.astype(output_dtype)
yield inp, out
input_shape_without_batch = list(input_shape)[1:]
return Inputs(train_stream=random_minibatches,
train_eval_stream=random_minibatches,
eval_stream=random_minibatches,
input_shape=input_shape_without_batch)
|
[
"def",
"random_inputs",
"(",
"num_devices",
",",
"input_shape",
"=",
"gin",
".",
"REQUIRED",
",",
"input_dtype",
"=",
"np",
".",
"int32",
",",
"input_range",
"=",
"(",
"0",
",",
"255",
")",
",",
"output_shape",
"=",
"gin",
".",
"REQUIRED",
",",
"output_dtype",
"=",
"np",
".",
"int32",
",",
"output_range",
"=",
"(",
"0",
",",
"9",
")",
")",
":",
"if",
"input_shape",
"[",
"0",
"]",
"%",
"num_devices",
"!=",
"0",
":",
"tf",
".",
"logging",
".",
"fatal",
"(",
"\"num_devices[%d] should divide the first dimension of input_shape[%s]\"",
",",
"num_devices",
",",
"input_shape",
")",
"if",
"output_shape",
"[",
"0",
"]",
"%",
"num_devices",
"!=",
"0",
":",
"tf",
".",
"logging",
".",
"fatal",
"(",
"\"num_devices[%d] should divide the first dimension of output_shape[%s]\"",
",",
"num_devices",
",",
"output_shape",
")",
"def",
"random_minibatches",
"(",
")",
":",
"\"\"\"Generate a stream of random mini-batches.\"\"\"",
"if",
"input_dtype",
"in",
"[",
"np",
".",
"float16",
",",
"np",
".",
"float32",
",",
"np",
".",
"float64",
"]",
":",
"rand",
"=",
"np",
".",
"random",
".",
"uniform",
"else",
":",
"rand",
"=",
"np",
".",
"random",
".",
"random_integers",
"while",
"True",
":",
"inp",
"=",
"rand",
"(",
"input_range",
"[",
"0",
"]",
",",
"input_range",
"[",
"1",
"]",
",",
"input_shape",
")",
"inp",
"=",
"inp",
".",
"astype",
"(",
"input_dtype",
")",
"out",
"=",
"rand",
"(",
"output_range",
"[",
"0",
"]",
",",
"output_range",
"[",
"1",
"]",
",",
"output_shape",
")",
"out",
"=",
"out",
".",
"astype",
"(",
"output_dtype",
")",
"yield",
"inp",
",",
"out",
"input_shape_without_batch",
"=",
"list",
"(",
"input_shape",
")",
"[",
"1",
":",
"]",
"return",
"Inputs",
"(",
"train_stream",
"=",
"random_minibatches",
",",
"train_eval_stream",
"=",
"random_minibatches",
",",
"eval_stream",
"=",
"random_minibatches",
",",
"input_shape",
"=",
"input_shape_without_batch",
")"
] |
Make random Inputs for debugging.
Args:
num_devices: how many devices to build the inputs for.
input_shape: the shape of inputs (including batch dimension).
input_dtype: the type of the inputs (int32 by default).
input_range: the range of inputs (defaults to (0, 255)).
output_shape: the shape of outputs (including batch dimension).
output_dtype: the type of the outputs (int32 by default).
output_range: the range of outputs (defaults to (0, 9)).
Returns:
trax.inputs.Inputs
|
[
"Make",
"random",
"Inputs",
"for",
"debugging",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/trax/inputs.py#L99-L143
|
train
|
Generate random inputs for debugging.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0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bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b100010 + 0o16) + chr(11643 - 11532) + chr(0b110001) + chr(0b100011 + 0o21) + '\x36', 0o10), ehT0Px3KOsy9('\x30' + '\157' + chr(51) + '\x32' + chr(0b110101), 0b1000), ehT0Px3KOsy9(chr(0b100 + 0o54) + '\x6f' + chr(924 - 875) + chr(0b111 + 0o52) + chr(0b110001 + 0o4), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\062' + chr(55) + chr(1962 - 1911), 14617 - 14609), ehT0Px3KOsy9('\x30' + '\x6f' + '\063', ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + chr(51) + '\064' + chr(0b10011 + 0o42), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\061' + chr(0b10011 + 0o36) + '\065', 8), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(1372 - 1323) + '\x35' + '\x35', 0o10), ehT0Px3KOsy9(chr(0b101 + 0o53) + chr(0b100000 + 0o117) + chr(50) + '\065' + chr(0b110010), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1011010 + 0o25) + '\x32' + chr(2091 - 2036) + chr(432 - 379), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\062' + chr(0b110100 + 0o2) + chr(0b11 + 0o57), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b11110 + 0o121) + chr(0b110010) + chr(0b1101 + 0o43) + '\x35', 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\061' + '\x33' + '\066', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(859 - 809) + chr(53) + chr(0b110111), 0o10), ehT0Px3KOsy9(chr(48) + chr(9963 - 9852) + chr(0b100001 + 0o20) + '\064' + chr(0b100 + 0o63), 0o10), ehT0Px3KOsy9(chr(1793 - 1745) + '\x6f' + chr(0b110101) + chr(1766 - 1713), ord("\x08")), ehT0Px3KOsy9(chr(108 - 60) + '\x6f' + chr(49) + chr(0b110010) + '\067', 0o10), ehT0Px3KOsy9(chr(750 - 702) + chr(0b1101111) + '\061' + chr(2471 - 2418) + chr(53), 8), ehT0Px3KOsy9(chr(785 - 737) + '\x6f' + chr(0b10011 + 0o43) + chr(0b110110), 63270 - 63262), ehT0Px3KOsy9(chr(840 - 792) + chr(0b1101111) + chr(0b110011) + '\066' + chr(0b110010), 0o10), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b1010 + 0o47) + chr(51), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(0b110000 + 0o77) + chr(50) + '\x31' + '\065', ord("\x08")), ehT0Px3KOsy9('\060' + chr(0b1001001 + 0o46) + '\x35' + chr(0b1001 + 0o51), 40822 - 40814), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(0b1000 + 0o53) + '\065' + '\x31', 0b1000), ehT0Px3KOsy9(chr(0b101111 + 0o1) + chr(111) + chr(0b1110 + 0o45) + chr(52) + chr(0b110110), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(49) + '\062' + chr(0b110011), 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + '\062' + chr(0b110101) + chr(0b101110 + 0o2), 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(5009 - 4898) + chr(1276 - 1227) + chr(51) + chr(48), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(53) + '\x33', 0b1000), ehT0Px3KOsy9(chr(48) + chr(111) + chr(2492 - 2441) + '\066' + chr(0b110010), 8), ehT0Px3KOsy9('\060' + '\157' + chr(0b110001 + 0o1) + '\x30' + chr(0b100111 + 0o15), 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b10001 + 0o40) + chr(0b110111 + 0o0), 0o10), ehT0Px3KOsy9('\060' + chr(8824 - 8713) + chr(1107 - 1056) + '\066', ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(54) + chr(1441 - 1392), 0o10), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + '\062' + chr(48) + chr(0b110000), 0b1000), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b110010) + chr(0b100110 + 0o17) + chr(0b110000 + 0o3), 34868 - 34860), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x33', 8), ehT0Px3KOsy9('\x30' + chr(111) + chr(51) + chr(433 - 378) + chr(0b101101 + 0o11), 63403 - 63395), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x33' + chr(1378 - 1325) + chr(0b110110), 3381 - 3373), ehT0Px3KOsy9(chr(48) + '\157' + chr(50) + chr(52) + '\x33', 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(0b110000) + chr(0b10100 + 0o133) + chr(0b11100 + 0o31) + '\x30', ord("\x08"))] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'H'), chr(100) + chr(101) + chr(0b1010 + 0o131) + '\x6f' + chr(100) + '\x65')('\x75' + '\164' + '\146' + '\055' + '\x38') + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def aoAB_FHxkR1_(eK0vLxsq0cly, tANyZeuTfu5y=xafqLlk3kkUe(WpThBfI19lUe, xafqLlk3kkUe(SXOLrMavuUCe(b'4\x90\x1c\xeeJ\xb7\x08)'), chr(0b10101 + 0o117) + '\145' + chr(99) + chr(111) + chr(0b1100100) + chr(0b1011110 + 0o7))(chr(0b1110101) + chr(0b1100 + 0o150) + chr(0b100111 + 0o77) + chr(45) + chr(1087 - 1031))), CRaQWfvjNvJw=xafqLlk3kkUe(WqUC3KWvYVup, xafqLlk3kkUe(SXOLrMavuUCe(b'\x0f\xbb9\x881'), chr(0b111010 + 0o52) + '\x65' + chr(0b1100011) + chr(11238 - 11127) + '\144' + chr(9998 - 9897))('\165' + '\164' + chr(102) + chr(0b1010 + 0o43) + chr(0b111000))), aSj5Z_mOblDm=(ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110000), 0b1000), ehT0Px3KOsy9(chr(1057 - 1009) + '\x6f' + '\x33' + chr(0b110111) + chr(0b110111), 28443 - 28435)), CeP8heSqnrCd=xafqLlk3kkUe(WpThBfI19lUe, xafqLlk3kkUe(SXOLrMavuUCe(b'4\x90\x1c\xeeJ\xb7\x08)'), '\x64' + chr(0b1001111 + 0o26) + '\143' + '\157' + chr(312 - 212) + chr(0b101100 + 0o71))(chr(0b1010010 + 0o43) + '\164' + chr(0b1011 + 0o133) + chr(0b101101) + chr(56))), _jfMdHW8p_pH=xafqLlk3kkUe(WqUC3KWvYVup, xafqLlk3kkUe(SXOLrMavuUCe(b'\x0f\xbb9\x881'), '\x64' + '\x65' + chr(99) + chr(111) + chr(0b1100100) + '\x65')(chr(117) + chr(0b1011 + 0o151) + chr(0b1100110) + '\x2d' + '\070')), rPKPyqyZKnRz=(ehT0Px3KOsy9('\060' + '\157' + '\060', 8), ehT0Px3KOsy9('\x30' + '\157' + chr(0b110001) + '\x31', 0o10))):
if tANyZeuTfu5y[ehT0Px3KOsy9(chr(0b1010 + 0o46) + chr(0b1101111) + chr(48), 8)] % eK0vLxsq0cly != ehT0Px3KOsy9('\x30' + chr(9806 - 9695) + chr(0b110000), 8):
xafqLlk3kkUe(IDJ2eXGCBCDu.logging, xafqLlk3kkUe(SXOLrMavuUCe(b'\x00\xb49\xdao'), chr(9383 - 9283) + chr(0b110010 + 0o63) + '\x63' + '\157' + '\144' + chr(0b1101 + 0o130))(chr(6765 - 6648) + chr(0b1110100) + chr(8365 - 8263) + '\055' + chr(56)))(xafqLlk3kkUe(SXOLrMavuUCe(b'\x08\xa0 \xe4g\x80;\x04\xc9\xd8\xc1\xde{\xcb:\r$\x05Y\x87g\xe9\n\x8d\x8f%\xc1<N\xd2\xf0g{\x11\xe6\xc2q\x8d\x9a\x83\x02\xbc \xdem\x96$\x02\xc4\x9d\xdd\xe3~\xc6\t]"\x19i\x81c\xecZ\x8c\xbdv\xdb\x05'), '\x64' + chr(0b111010 + 0o53) + '\143' + chr(111) + chr(0b1100100) + '\145')('\x75' + '\x74' + chr(0b1100110) + '\x2d' + '\070'), eK0vLxsq0cly, tANyZeuTfu5y)
if CeP8heSqnrCd[ehT0Px3KOsy9('\060' + '\x6f' + '\060', 8)] % eK0vLxsq0cly != ehT0Px3KOsy9('\x30' + chr(111) + '\060', 8):
xafqLlk3kkUe(IDJ2eXGCBCDu.logging, xafqLlk3kkUe(SXOLrMavuUCe(b'\x00\xb49\xdao'), chr(0b1100100) + chr(101) + chr(4720 - 4621) + '\x6f' + chr(0b1100100) + '\145')(chr(0b10010 + 0o143) + '\164' + chr(0b101011 + 0o73) + chr(976 - 931) + '\x38'))(xafqLlk3kkUe(SXOLrMavuUCe(b"\x08\xa0 \xe4g\x80;\x04\xc9\xd8\xc1\xde{\xcb:\r$\x05Y\x87g\xe9\n\x8d\x8f%\xc1<N\xd2\xf0g{\x11\xe6\xc2q\x8d\x9a\x83\x02\xbc \xdem\x96$\x02\xc4\x9d\xdd\xe3~\xc0\x12Y'\x18B\xadx\xe5K\x99\x83\x08\x8d+v"), '\x64' + chr(1541 - 1440) + chr(6970 - 6871) + chr(3319 - 3208) + chr(2572 - 2472) + '\145')(chr(0b1110101) + chr(116) + '\146' + chr(0b101101) + '\070'), eK0vLxsq0cly, CeP8heSqnrCd)
def GISoqZvyYMk_():
if CRaQWfvjNvJw in [xafqLlk3kkUe(WqUC3KWvYVup, xafqLlk3kkUe(SXOLrMavuUCe(b'\x00\xb9"\xdaw\xd4{'), chr(0b1100100) + '\x65' + chr(0b1100011) + chr(111) + chr(0b1011110 + 0o6) + '\x65')('\x75' + '\x74' + chr(0b1100110) + chr(0b101101) + chr(0b110 + 0o62))), xafqLlk3kkUe(WqUC3KWvYVup, xafqLlk3kkUe(SXOLrMavuUCe(b'\x00\xb9"\xdaw\xd6\x7f'), chr(0b1100100) + chr(5623 - 5522) + chr(0b1100011) + '\x6f' + '\144' + '\x65')(chr(0b1001100 + 0o51) + '\x74' + '\146' + chr(45) + chr(2525 - 2469))), xafqLlk3kkUe(WqUC3KWvYVup, xafqLlk3kkUe(SXOLrMavuUCe(b'\x00\xb9"\xdaw\xd3y'), chr(0b0 + 0o144) + '\x65' + chr(0b100000 + 0o103) + '\157' + chr(2538 - 2438) + '\145')(chr(0b1110101) + chr(7286 - 7170) + chr(0b1100110) + '\055' + chr(609 - 553)))]:
ViP387u3nRBw = WqUC3KWvYVup.random.uniform
else:
ViP387u3nRBw = WqUC3KWvYVup.random.random_integers
while ehT0Px3KOsy9('\060' + '\x6f' + chr(2333 - 2284), 3096 - 3088):
_axPQ91Y6C0x = ViP387u3nRBw(aSj5Z_mOblDm[ehT0Px3KOsy9(chr(208 - 160) + chr(7546 - 7435) + chr(48), 8)], aSj5Z_mOblDm[ehT0Px3KOsy9('\060' + chr(111) + chr(0b101010 + 0o7), 8)], tANyZeuTfu5y)
_axPQ91Y6C0x = _axPQ91Y6C0x.astype(CRaQWfvjNvJw)
UkrMp_I0RDmo = ViP387u3nRBw(rPKPyqyZKnRz[ehT0Px3KOsy9('\x30' + chr(1062 - 951) + chr(48), 8)], rPKPyqyZKnRz[ehT0Px3KOsy9('\060' + chr(0b1101111) + '\x31', 8)], CeP8heSqnrCd)
UkrMp_I0RDmo = UkrMp_I0RDmo.astype(_jfMdHW8p_pH)
yield (_axPQ91Y6C0x, UkrMp_I0RDmo)
ScjnRy3IyyXQ = YyaZ4tpXu4lf(tANyZeuTfu5y)[ehT0Px3KOsy9('\x30' + chr(7806 - 7695) + '\061', 8):]
return RZrosssZ9Fqo(train_stream=GISoqZvyYMk_, train_eval_stream=GISoqZvyYMk_, eval_stream=GISoqZvyYMk_, input_shape=ScjnRy3IyyXQ)
|
tensorflow/tensor2tensor
|
tensor2tensor/trax/inputs.py
|
dataset_to_stream
|
def dataset_to_stream(dataset, input_name, num_chunks=0, append_targets=False):
"""Takes a tf.Dataset and creates a numpy stream of ready batches."""
for example in tfds.as_numpy(dataset):
inp, out = example[0][input_name], example[1]
if len(out.shape) > 1 and out.shape[-1] == 1:
out = np.squeeze(out, axis=-1)
if num_chunks > 0:
inp = np.split(inp, num_chunks, axis=1)
out = np.split(out, num_chunks, axis=1)
if append_targets:
inp = (inp, out)
yield inp, out
|
python
|
def dataset_to_stream(dataset, input_name, num_chunks=0, append_targets=False):
"""Takes a tf.Dataset and creates a numpy stream of ready batches."""
for example in tfds.as_numpy(dataset):
inp, out = example[0][input_name], example[1]
if len(out.shape) > 1 and out.shape[-1] == 1:
out = np.squeeze(out, axis=-1)
if num_chunks > 0:
inp = np.split(inp, num_chunks, axis=1)
out = np.split(out, num_chunks, axis=1)
if append_targets:
inp = (inp, out)
yield inp, out
|
[
"def",
"dataset_to_stream",
"(",
"dataset",
",",
"input_name",
",",
"num_chunks",
"=",
"0",
",",
"append_targets",
"=",
"False",
")",
":",
"for",
"example",
"in",
"tfds",
".",
"as_numpy",
"(",
"dataset",
")",
":",
"inp",
",",
"out",
"=",
"example",
"[",
"0",
"]",
"[",
"input_name",
"]",
",",
"example",
"[",
"1",
"]",
"if",
"len",
"(",
"out",
".",
"shape",
")",
">",
"1",
"and",
"out",
".",
"shape",
"[",
"-",
"1",
"]",
"==",
"1",
":",
"out",
"=",
"np",
".",
"squeeze",
"(",
"out",
",",
"axis",
"=",
"-",
"1",
")",
"if",
"num_chunks",
">",
"0",
":",
"inp",
"=",
"np",
".",
"split",
"(",
"inp",
",",
"num_chunks",
",",
"axis",
"=",
"1",
")",
"out",
"=",
"np",
".",
"split",
"(",
"out",
",",
"num_chunks",
",",
"axis",
"=",
"1",
")",
"if",
"append_targets",
":",
"inp",
"=",
"(",
"inp",
",",
"out",
")",
"yield",
"inp",
",",
"out"
] |
Takes a tf.Dataset and creates a numpy stream of ready batches.
|
[
"Takes",
"a",
"tf",
".",
"Dataset",
"and",
"creates",
"a",
"numpy",
"stream",
"of",
"ready",
"batches",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/trax/inputs.py#L146-L157
|
train
|
Takes a tf. Dataset and creates a numpy stream of ready batches.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,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HmS9durw_Vs,abA97kOQKaLo,tsdjvlgh9gDP,VTYZGD68sBIs,Dx22bkKPdt5d,nSwwHEeM4cxI,sR_24x3xd4bh,xmV2riMOClNT,_fwkIVCGgtAN,Jp8aZ6mjyZZT,eO8Xfv8UVFey,zLUzGokYBM2Z,FL7SmUoxlR9h,k6bl9sLammpH,vQr8gNKaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(873 - 825) + chr(11786 - 11675) + chr(1412 - 1361) + chr(0b110001) + '\063', ord("\x08")), ehT0Px3KOsy9(chr(1547 - 1499) + chr(0b1101111) + chr(0b110011) + chr(876 - 826) + chr(0b100011 + 0o23), 0b1000), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + chr(1354 - 1304), 0o10), ehT0Px3KOsy9(chr(1434 - 1386) + '\x6f' + chr(0b110010) + chr(0b110000 + 0o7) + '\x33', 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + '\x37' + '\066', 8615 - 8607), ehT0Px3KOsy9(chr(0b10 + 0o56) + chr(0b10110 + 0o131) + '\063' + chr(0b110111) + chr(0b110101), 37351 - 37343), ehT0Px3KOsy9(chr(0b1000 + 0o50) + chr(111) + '\061' + '\062' + chr(0b1001 + 0o50), 0o10), ehT0Px3KOsy9(chr(0b100011 + 0o15) + '\157' + '\062' + chr(1596 - 1543) + '\062', ord("\x08")), ehT0Px3KOsy9(chr(1837 - 1789) + chr(9109 - 8998) + chr(53), 0o10), ehT0Px3KOsy9(chr(0b10011 + 0o35) + chr(0b1101111) + chr(0b100101 + 0o14) + '\x37', ord("\x08")), ehT0Px3KOsy9(chr(0b1111 + 0o41) + chr(6684 - 6573) + '\061' + chr(0b110011), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + '\x31' + chr(51) + '\x37', 1855 - 1847), ehT0Px3KOsy9('\x30' + chr(0b1001110 + 0o41) + '\067' + '\063', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\157' + '\x32' + chr(0b110011), 0b1000), ehT0Px3KOsy9(chr(0b0 + 0o60) + '\x6f' + '\067' + '\064', 0o10), ehT0Px3KOsy9(chr(0b110000) + '\x6f' + '\x33' + chr(2289 - 2241) + chr(54), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + chr(0b100110 + 0o15) + '\x33' + chr(49), 62800 - 62792), ehT0Px3KOsy9(chr(396 - 348) + chr(9211 - 9100) + '\062' + '\x30' + chr(0b1 + 0o66), 47647 - 47639), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110011) + chr(0b111 + 0o57) + chr(758 - 707), 0b1000), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(0b101000 + 0o13) + '\063' + chr(0b100110 + 0o13), 8), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110001) + '\x32' + chr(0b1100 + 0o52), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(50) + chr(52) + chr(0b110000), 0b1000), ehT0Px3KOsy9('\060' + '\x6f' + chr(964 - 913) + chr(0b100000 + 0o20) + '\063', ord("\x08")), ehT0Px3KOsy9(chr(0b100001 + 0o17) + chr(0b1101111) + chr(0b111 + 0o52) + chr(48), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b11010 + 0o125) + chr(0b100000 + 0o22) + chr(1313 - 1265) + chr(0b0 + 0o65), ord("\x08")), ehT0Px3KOsy9('\060' + chr(6639 - 6528) + '\061' + chr(0b110110) + chr(52), 56685 - 56677), ehT0Px3KOsy9(chr(0b110000) + chr(0b1011100 + 0o23) + chr(0b110110) + '\x31', 0o10), ehT0Px3KOsy9(chr(1036 - 988) + chr(0b100110 + 0o111) + '\061' + '\064', 33738 - 33730), ehT0Px3KOsy9('\x30' + '\157' + chr(0b11010 + 0o27) + chr(51) + chr(52), 0b1000), ehT0Px3KOsy9('\060' + '\157' + chr(702 - 653) + chr(1915 - 1867), 8), ehT0Px3KOsy9(chr(2167 - 2119) + chr(4114 - 4003) + chr(0b110010) + chr(0b110111) + chr(51), 8), ehT0Px3KOsy9('\x30' + chr(0b1101111) + chr(1416 - 1366) + chr(0b0 + 0o64) + chr(0b1111 + 0o42), 11202 - 11194), ehT0Px3KOsy9(chr(0b101110 + 0o2) + chr(0b1101111) + chr(0b110011) + '\067' + chr(0b110101), 8), ehT0Px3KOsy9(chr(48) + chr(0b11101 + 0o122) + chr(1596 - 1545) + '\x33' + chr(0b110110), 0o10), ehT0Px3KOsy9(chr(606 - 558) + '\157' + chr(51) + chr(2215 - 2162) + chr(50), ord("\x08")), ehT0Px3KOsy9('\060' + chr(8230 - 8119) + chr(0b101 + 0o54) + chr(0b110111) + chr(708 - 656), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110010) + chr(2263 - 2210) + '\066', ord("\x08")), ehT0Px3KOsy9(chr(0b100111 + 0o11) + chr(11473 - 11362) + chr(0b100010 + 0o20) + chr(343 - 295) + chr(0b10 + 0o56), 39047 - 39039), ehT0Px3KOsy9(chr(0b11 + 0o55) + '\x6f' + chr(0b110110) + '\x36', 0b1000), ehT0Px3KOsy9(chr(0b100100 + 0o14) + chr(0b1000010 + 0o55) + '\064' + chr(1825 - 1777), 0b1000)][WVxHKyX45z_L % ehT0Px3KOsy9('\x30' + chr(6389 - 6278) + chr(0b110101) + '\x30', 0o10)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'\xe5'), '\x64' + chr(101) + chr(7826 - 7727) + chr(111) + '\144' + '\145')('\165' + chr(0b1110100) + chr(0b111101 + 0o51) + chr(45) + chr(0b111000)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def l_3a5CRvTADe(xQt6gV9VfTO3, T1P2HfUVrGuW, BlFrQS9ngZ43=ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(48), ord("\x08")), RUyVFghp0aLq=ehT0Px3KOsy9(chr(1803 - 1755) + '\157' + chr(173 - 125), 8)):
for kP4qaKv0ZkGv in xafqLlk3kkUe(gPhLUExQYf8r, xafqLlk3kkUe(SXOLrMavuUCe(b'\xaa\xa5]\xd5K\x90!\xd3'), chr(0b1010010 + 0o22) + chr(101) + '\143' + chr(0b1011100 + 0o23) + chr(0b1100100) + chr(0b11 + 0o142))(chr(0b1110101) + chr(0b1100011 + 0o21) + chr(102) + chr(45) + chr(0b101110 + 0o12)))(xQt6gV9VfTO3):
(_axPQ91Y6C0x, UkrMp_I0RDmo) = (kP4qaKv0ZkGv[ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(0b100100 + 0o14), 8)][T1P2HfUVrGuW], kP4qaKv0ZkGv[ehT0Px3KOsy9(chr(0b1010 + 0o46) + '\x6f' + chr(49), 0o10)])
if c2A0yzQpDQB3(xafqLlk3kkUe(UkrMp_I0RDmo, xafqLlk3kkUe(SXOLrMavuUCe(b'\xa5\xb7w\xe2X\xb16\xc6Q\x7fh='), chr(0b101001 + 0o73) + chr(101) + chr(0b1100011) + '\x6f' + chr(0b1100100) + '\145')(chr(6125 - 6008) + chr(116) + chr(0b11 + 0o143) + chr(1382 - 1337) + '\070'))) > ehT0Px3KOsy9('\060' + chr(9931 - 9820) + chr(0b101100 + 0o5), 8) and xafqLlk3kkUe(UkrMp_I0RDmo, xafqLlk3kkUe(SXOLrMavuUCe(b'\xa5\xb7w\xe2X\xb16\xc6Q\x7fh='), chr(8525 - 8425) + '\145' + '\143' + chr(111) + '\144' + chr(0b101100 + 0o71))('\x75' + '\164' + '\146' + chr(0b10101 + 0o30) + '\070'))[-ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(49), 8)] == ehT0Px3KOsy9('\x30' + chr(111) + chr(0b10010 + 0o37), 8):
UkrMp_I0RDmo = WqUC3KWvYVup.squeeze(UkrMp_I0RDmo, axis=-ehT0Px3KOsy9(chr(0b0 + 0o60) + '\157' + chr(0b11010 + 0o27), 8))
if BlFrQS9ngZ43 > ehT0Px3KOsy9(chr(0b10101 + 0o33) + chr(0b1101111) + '\060', 8):
_axPQ91Y6C0x = WqUC3KWvYVup.split(_axPQ91Y6C0x, BlFrQS9ngZ43, axis=ehT0Px3KOsy9(chr(48) + '\157' + '\x31', 8))
UkrMp_I0RDmo = WqUC3KWvYVup.split(UkrMp_I0RDmo, BlFrQS9ngZ43, axis=ehT0Px3KOsy9('\060' + chr(11876 - 11765) + chr(0b110001), 8))
if RUyVFghp0aLq:
_axPQ91Y6C0x = (_axPQ91Y6C0x, UkrMp_I0RDmo)
yield (_axPQ91Y6C0x, UkrMp_I0RDmo)
|
tensorflow/tensor2tensor
|
tensor2tensor/trax/inputs.py
|
_train_and_eval_dataset_v1
|
def _train_and_eval_dataset_v1(problem_name, data_dir):
"""Return train and evaluation datasets, feature info and supervised keys."""
assert not tf.executing_eagerly(), "tf.eager mode must be turned off."
problem = t2t_problems.problem(problem_name)
train_dataset = problem.dataset(tf.estimator.ModeKeys.TRAIN, data_dir)
train_dataset = train_dataset.map(_select_features)
eval_dataset = problem.dataset(tf.estimator.ModeKeys.EVAL, data_dir)
eval_dataset = eval_dataset.map(_select_features)
hparams = problem.get_hparams()
# We take a few training examples to guess the shapes.
input_shapes, target_shapes = [], []
example_tensor = train_dataset.make_one_shot_iterator().get_next()
sess = tf.Session()
example1 = sess.run(example_tensor)
example2 = sess.run(example_tensor)
example3 = sess.run(example_tensor)
# We use "inputs" as input except for purely auto-regressive tasks like
# language models where "targets" are used as input_key.
input_key = "inputs" if "inputs" in example1 else "targets"
supervised_keys = ([input_key], ["targets"])
for example in [example1, example2, example3]:
input_shapes.append(list(example[input_key].shape))
target_shapes.append(list(example["targets"].shape))
input_vocab_size = hparams.vocab_size[input_key]
target_vocab_size = hparams.vocab_size["targets"]
input_info = _make_info(input_shapes, input_vocab_size)
target_info = _make_info(target_shapes, target_vocab_size)
info = {input_key: input_info, "targets": target_info}
return train_dataset, eval_dataset, info, supervised_keys
|
python
|
def _train_and_eval_dataset_v1(problem_name, data_dir):
"""Return train and evaluation datasets, feature info and supervised keys."""
assert not tf.executing_eagerly(), "tf.eager mode must be turned off."
problem = t2t_problems.problem(problem_name)
train_dataset = problem.dataset(tf.estimator.ModeKeys.TRAIN, data_dir)
train_dataset = train_dataset.map(_select_features)
eval_dataset = problem.dataset(tf.estimator.ModeKeys.EVAL, data_dir)
eval_dataset = eval_dataset.map(_select_features)
hparams = problem.get_hparams()
# We take a few training examples to guess the shapes.
input_shapes, target_shapes = [], []
example_tensor = train_dataset.make_one_shot_iterator().get_next()
sess = tf.Session()
example1 = sess.run(example_tensor)
example2 = sess.run(example_tensor)
example3 = sess.run(example_tensor)
# We use "inputs" as input except for purely auto-regressive tasks like
# language models where "targets" are used as input_key.
input_key = "inputs" if "inputs" in example1 else "targets"
supervised_keys = ([input_key], ["targets"])
for example in [example1, example2, example3]:
input_shapes.append(list(example[input_key].shape))
target_shapes.append(list(example["targets"].shape))
input_vocab_size = hparams.vocab_size[input_key]
target_vocab_size = hparams.vocab_size["targets"]
input_info = _make_info(input_shapes, input_vocab_size)
target_info = _make_info(target_shapes, target_vocab_size)
info = {input_key: input_info, "targets": target_info}
return train_dataset, eval_dataset, info, supervised_keys
|
[
"def",
"_train_and_eval_dataset_v1",
"(",
"problem_name",
",",
"data_dir",
")",
":",
"assert",
"not",
"tf",
".",
"executing_eagerly",
"(",
")",
",",
"\"tf.eager mode must be turned off.\"",
"problem",
"=",
"t2t_problems",
".",
"problem",
"(",
"problem_name",
")",
"train_dataset",
"=",
"problem",
".",
"dataset",
"(",
"tf",
".",
"estimator",
".",
"ModeKeys",
".",
"TRAIN",
",",
"data_dir",
")",
"train_dataset",
"=",
"train_dataset",
".",
"map",
"(",
"_select_features",
")",
"eval_dataset",
"=",
"problem",
".",
"dataset",
"(",
"tf",
".",
"estimator",
".",
"ModeKeys",
".",
"EVAL",
",",
"data_dir",
")",
"eval_dataset",
"=",
"eval_dataset",
".",
"map",
"(",
"_select_features",
")",
"hparams",
"=",
"problem",
".",
"get_hparams",
"(",
")",
"# We take a few training examples to guess the shapes.",
"input_shapes",
",",
"target_shapes",
"=",
"[",
"]",
",",
"[",
"]",
"example_tensor",
"=",
"train_dataset",
".",
"make_one_shot_iterator",
"(",
")",
".",
"get_next",
"(",
")",
"sess",
"=",
"tf",
".",
"Session",
"(",
")",
"example1",
"=",
"sess",
".",
"run",
"(",
"example_tensor",
")",
"example2",
"=",
"sess",
".",
"run",
"(",
"example_tensor",
")",
"example3",
"=",
"sess",
".",
"run",
"(",
"example_tensor",
")",
"# We use \"inputs\" as input except for purely auto-regressive tasks like",
"# language models where \"targets\" are used as input_key.",
"input_key",
"=",
"\"inputs\"",
"if",
"\"inputs\"",
"in",
"example1",
"else",
"\"targets\"",
"supervised_keys",
"=",
"(",
"[",
"input_key",
"]",
",",
"[",
"\"targets\"",
"]",
")",
"for",
"example",
"in",
"[",
"example1",
",",
"example2",
",",
"example3",
"]",
":",
"input_shapes",
".",
"append",
"(",
"list",
"(",
"example",
"[",
"input_key",
"]",
".",
"shape",
")",
")",
"target_shapes",
".",
"append",
"(",
"list",
"(",
"example",
"[",
"\"targets\"",
"]",
".",
"shape",
")",
")",
"input_vocab_size",
"=",
"hparams",
".",
"vocab_size",
"[",
"input_key",
"]",
"target_vocab_size",
"=",
"hparams",
".",
"vocab_size",
"[",
"\"targets\"",
"]",
"input_info",
"=",
"_make_info",
"(",
"input_shapes",
",",
"input_vocab_size",
")",
"target_info",
"=",
"_make_info",
"(",
"target_shapes",
",",
"target_vocab_size",
")",
"info",
"=",
"{",
"input_key",
":",
"input_info",
",",
"\"targets\"",
":",
"target_info",
"}",
"return",
"train_dataset",
",",
"eval_dataset",
",",
"info",
",",
"supervised_keys"
] |
Return train and evaluation datasets, feature info and supervised keys.
|
[
"Return",
"train",
"and",
"evaluation",
"datasets",
"feature",
"info",
"and",
"supervised",
"keys",
"."
] |
272500b6efe353aeb638d2745ed56e519462ca31
|
https://github.com/tensorflow/tensor2tensor/blob/272500b6efe353aeb638d2745ed56e519462ca31/tensor2tensor/trax/inputs.py#L229-L257
|
train
|
Return train and evaluation datasets feature info and supervised keys.
|
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGLtp_O,sR2sPcm7Zrfn,yROw0HWBk0Qc,j9rjMYnN2BMp,hIlP7994qj8O,_fsda0v2_OKU,o0CgT5HPthxA,DXjfarvgFnbl,RQ6CSRrFArYB,RouZF7bjEXAv,jIl9qoALCRyb,bdLuls3EQFSd,FXUco0R3m83n,V5s4UV3vwoyK,Q6d3QdTENfxw,sbc9gub6LIFp,QWgp4ELTmqy4,_zJ24Vce7wp0,KlPSljPzIJ_u,N5Ee6d9YGQ_x,yDcnbVVBZ5VZ,OTstrxJfIC1n,GXwwnDRMCHJX,a9IKoVgO_m3w,GNd6AVvhYicE,ixtrydDuthdu,n0ZkatoveZpF,eh4BeXwijHpf,ZMHESMWYyt8h,hr2QaoivbFQ2,Iiw8L0MH5qfg,koCeDPYTrOFe,qqrhSmCSbbqk,pz9FlfzsWoy1,BXIwDASQ0Qkq,NL8dtWOpbcjF,_b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KaIaWE,S6hV9M2g7fO0,RFiwrCZH9Ie6,jB_HdqgHmVpI,MVEN8G6CxlvR,t0rOMsrOC7R_,W3g84rNiEdDQ,vUlqIvNSaRMa,gDnh40_OUDCn,M8_cKLkHVB2V,xkxBmo49x2An,KNx0Ujaz9UM0,KNyTy8rYcwji,wmQmyeWBmUpv,p1G5VS3dE_Ss,pZ0NK2y6HRbn,HByLaO1XdVEe,pgRJLRS7Iy8j,OZYzwAeSQh7N,tmzuw0hjv33u,RwRZiUMA3VWp,Gbej4oZqKLA6,TqkAMbUz4aLg,rw68imZ2Ikxp=ArithmeticError,AssertionError,AttributeError,BaseException,BlockingIOError,BrokenPipeError,BufferError,BytesWarning,ChildProcessError,ConnectionAbortedError,ConnectionError,ConnectionRefusedError,ConnectionResetError,DeprecationWarning,EOFError,Ellipsis,EncodingWarning,EnvironmentError,Exception,False,FileExistsError,FileNotFoundError,FloatingPointError,FutureWarning,GeneratorExit,IOError,ImportError,ImportWarning,IndentationError,IndexError,InterruptedError,IsADirectoryError,KeyError,KeyboardInterrupt,LookupError,MemoryError,ModuleNotFoundError,NameError,None,NotADirectoryError,NotImplemented,NotImplementedError,OSError,OverflowError,PendingDeprecationWarning,PermissionError,ProcessLookupError,RecursionError,ReferenceError,ResourceWarning,RuntimeError,RuntimeWarning,StopAsyncIteration,StopIteration,SyntaxError,SyntaxWarning,SystemError,SystemExit,TabError,TimeoutError,True,TypeError,UnboundLocalError,UnicodeDecodeError,UnicodeEncodeError,UnicodeError,UnicodeTranslateError,UnicodeWarning,UserWarning,ValueError,Warning,WindowsError,ZeroDivisionError,__build_class__,__debug__,__doc__,__import__,__loader__,__name__,__package__,__spec__,abs,aiter,all,anext,any,ascii,bin,bool,breakpoint,bytearray,bytes,callable,chr,classmethod,compile,complex,copyright,credits,delattr,dict,dir,divmod,enumerate,eval,exec,exit,filter,float,format,frozenset,getattr,globals,hasattr,hash,help,hex,id,input,int,isinstance,issubclass,iter,len,license,list,locals,map,max,memoryview,min,next,object,oct,open,ord,pow,print,property,quit,range,repr,reversed,round,set,setattr,slice,sorted,staticmethod,str,sum,super,tuple,type,vars,zip,__builtins__,__cached__,__doc__,__file__,__loader__,__name__,__package__,__spec__
SXOLrMavuUCe = lambda XbwU38w7NW8n: QOfmzcVJsrp8([OeWW0F1dBPRQ ^ [ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(0b110001) + chr(2218 - 2168) + chr(999 - 948), ord("\x08")), ehT0Px3KOsy9(chr(0b1 + 0o57) + chr(111) + '\x31' + '\065' + chr(0b110011), 0b1000), ehT0Px3KOsy9(chr(48) + chr(6565 - 6454) + '\x31' + chr(1048 - 995) + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + '\157' + chr(49) + '\x30' + chr(1929 - 1881), ord("\x08")), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b1000 + 0o51) + chr(0b110110) + '\060', 0o10), ehT0Px3KOsy9('\x30' + '\x6f' + chr(0b100001 + 0o23), ord("\x08")), ehT0Px3KOsy9(chr(0b101010 + 0o6) + chr(8367 - 8256) + chr(2144 - 2094) + chr(0b110110), 0o10), ehT0Px3KOsy9('\x30' + chr(3455 - 3344) + chr(126 - 77) + '\060' + chr(1867 - 1814), 40510 - 40502), ehT0Px3KOsy9(chr(0b110000) + chr(0b11101 + 0o122) + chr(49) + '\065' + chr(0b1101 + 0o51), 0b1000), ehT0Px3KOsy9('\x30' + '\157' + chr(49) + chr(0b100011 + 0o22), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(6820 - 6709) + chr(0b110011) + chr(54), 56577 - 56569), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(51) + '\x35' + chr(0b110111), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + '\062' + chr(0b11100 + 0o27) + chr(0b1111 + 0o50), 0b1000), ehT0Px3KOsy9(chr(48) + chr(0b1101111) + chr(0b110010) + '\x37' + '\x31', 57142 - 57134), ehT0Px3KOsy9(chr(2179 - 2131) + '\157' + chr(1683 - 1634) + chr(0b110000) + '\x34', 0b1000), ehT0Px3KOsy9(chr(0b110000) + chr(10742 - 10631) + chr(0b10100 + 0o41) + '\065', ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(0b1001011 + 0o44) + '\x32' + '\x37' + chr(1338 - 1290), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(0b100001 + 0o21) + chr(0b101100 + 0o4) + chr(558 - 505), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(0b1101111) + chr(2578 - 2527) + '\065' + chr(2741 - 2686), 8), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(1900 - 1847) + '\066', 0b1000), ehT0Px3KOsy9(chr(0b10010 + 0o36) + chr(3217 - 3106) + chr(0b11001 + 0o33) + chr(2492 - 2441), ord("\x08")), ehT0Px3KOsy9(chr(0b10011 + 0o35) + '\157' + chr(0b110101), ord("\x08")), ehT0Px3KOsy9('\060' + chr(9186 - 9075) + '\066' + chr(53), 0o10), ehT0Px3KOsy9('\060' + chr(0b10100 + 0o133) + chr(49) + chr(50) + chr(0b110100), 0o10), ehT0Px3KOsy9(chr(864 - 816) + '\157' + chr(0b1 + 0o61) + '\064' + chr(0b110101), ord("\x08")), ehT0Px3KOsy9(chr(0b110000) + chr(111) + chr(0b110010) + chr(48) + '\x35', 8), ehT0Px3KOsy9('\x30' + '\x6f' + chr(1096 - 1045) + '\065' + chr(0b11110 + 0o27), ord("\x08")), ehT0Px3KOsy9('\x30' + chr(111) + '\x31' + chr(48), ord("\x08")), ehT0Px3KOsy9(chr(48) + '\x6f' + chr(51) + chr(49) + '\x37', ord("\x08")), ehT0Px3KOsy9('\060' + '\x6f' + '\x33' + '\x30' + '\062', 0b1000), ehT0Px3KOsy9('\060' + chr(7975 - 7864) + chr(0b0 + 0o61) + chr(1883 - 1831) + chr(0b110111), 0b1000), ehT0Px3KOsy9('\060' + chr(0b1101111) + chr(51) + chr(435 - 384) + chr(0b1 + 0o66), 0b1000), ehT0Px3KOsy9(chr(48) + chr(11885 - 11774) + '\x32' + chr(0b100000 + 0o23) + chr(0b101101 + 0o6), 0o10), ehT0Px3KOsy9(chr(48) + '\157' + chr(1899 - 1849) + chr(49), ord("\x08")), ehT0Px3KOsy9('\x30' + '\157' + chr(0b1000 + 0o52), 0o10), ehT0Px3KOsy9(chr(0b110000) + chr(8792 - 8681) + chr(53) + '\061', 52852 - 52844), ehT0Px3KOsy9(chr(0b110000) + chr(0b1000110 + 0o51) + chr(51) + chr(52) + chr(55), ord("\x08")), ehT0Px3KOsy9(chr(0b1001 + 0o47) + chr(0b111101 + 0o62) + chr(0b101001 + 0o11) + '\067' + chr(1349 - 1297), 521 - 513), ehT0Px3KOsy9(chr(0b11000 + 0o30) + '\157' + chr(49) + chr(55), 0b1000), ehT0Px3KOsy9(chr(188 - 140) + '\157' + chr(0b1111 + 0o43) + '\x30' + chr(55), 0o10)][WVxHKyX45z_L % ehT0Px3KOsy9(chr(899 - 851) + chr(111) + chr(1464 - 1411) + chr(0b11011 + 0o25), 8004 - 7996)] for (WVxHKyX45z_L, OeWW0F1dBPRQ) in YlkZvXL8qwsX(XbwU38w7NW8n)])
def NPPHb59961Bv(RqocVGOryNPv, _CF03Rifpmdh):
try:
return jFWsnpHpAUWz(RqocVGOryNPv + xafqLlk3kkUe(SXOLrMavuUCe(b'}'), chr(100) + chr(0b101000 + 0o75) + '\143' + chr(0b1101100 + 0o3) + chr(0b101011 + 0o71) + '\145')('\165' + chr(9275 - 9159) + '\146' + chr(0b101101) + chr(56)) + _CF03Rifpmdh)
except yROw0HWBk0Qc:
return jFWsnpHpAUWz(RqocVGOryNPv)
def xTaEeUNS_uJ6(wezGpYDorAsK, kVFRD544hi_1):
assert not xafqLlk3kkUe(IDJ2eXGCBCDu, xafqLlk3kkUe(SXOLrMavuUCe(b'6\x13\r#\x05p\x7f+\tR{\x8e\xf8\xdc6A\xc1'), chr(0b111100 + 0o50) + chr(0b111010 + 0o53) + chr(0b1001101 + 0o26) + chr(111) + '\x64' + chr(0b1100101))('\x75' + chr(0b11 + 0o161) + chr(0b1100110) + '\x2d' + chr(56)))(), xafqLlk3kkUe(SXOLrMavuUCe(b"'\rF%\x11cs7N`q\x8b\xfa\x99)X\xcb\xf1\xcfLF%A!\xd7\xeb\x88l\xef\xad\x01\xb9\xb5"), chr(0b1 + 0o143) + '\x65' + chr(2510 - 2411) + chr(3824 - 3713) + '\x64' + '\x65')(chr(0b1110101) + '\164' + chr(102) + chr(45) + chr(0b111000))
sO7e1A_Mor6Q = Bwycf57TS8m6.sO7e1A_Mor6Q(wezGpYDorAsK)
_H7HhX1OiYNO = sO7e1A_Mor6Q.dataset(IDJ2eXGCBCDu.estimator.ModeKeys.TRAIN, kVFRD544hi_1)
_H7HhX1OiYNO = _H7HhX1OiYNO.map(AslM28mnUrps)
yXL7lYDLbCr_ = sO7e1A_Mor6Q.dataset(IDJ2eXGCBCDu.estimator.ModeKeys.EVAL, kVFRD544hi_1)
yXL7lYDLbCr_ = yXL7lYDLbCr_.map(AslM28mnUrps)
n4ljua2gi1Pr = sO7e1A_Mor6Q.get_hparams()
(MUaMiwsTdGeu, l6V0bqbLx_b9) = ([], [])
mtURyOzXAiGn = _H7HhX1OiYNO.make_one_shot_iterator().get_next()
HVWCHjSQ2I35 = IDJ2eXGCBCDu.Session()
fuVZQYYmCmIL = HVWCHjSQ2I35.sgt5BU61bwZ2(mtURyOzXAiGn)
KEN7VBM5yLnz = HVWCHjSQ2I35.sgt5BU61bwZ2(mtURyOzXAiGn)
J0ccc3JgDPv_ = HVWCHjSQ2I35.sgt5BU61bwZ2(mtURyOzXAiGn)
cSYvAmO9j4zD = xafqLlk3kkUe(SXOLrMavuUCe(b':\x05\x185\x04w'), chr(100) + chr(0b1100101) + chr(0b1100011) + chr(0b101001 + 0o106) + chr(100) + chr(101))(chr(0b1110101) + chr(116) + chr(8354 - 8252) + chr(0b1100 + 0o41) + chr(56)) if xafqLlk3kkUe(SXOLrMavuUCe(b':\x05\x185\x04w'), chr(100) + chr(0b1100101) + '\x63' + '\x6f' + '\x64' + '\145')(chr(0b1110101) + chr(0b1100100 + 0o20) + '\x66' + chr(0b11101 + 0o20) + chr(0b101101 + 0o13)) in fuVZQYYmCmIL else xafqLlk3kkUe(SXOLrMavuUCe(b"'\n\x1a'\x15pe"), chr(9205 - 9105) + chr(0b1100101) + '\x63' + chr(0b111011 + 0o64) + chr(2752 - 2652) + '\145')(chr(0b1110101) + '\x74' + '\146' + chr(0b101101) + chr(56))
CZW_z9Phwam0 = ([cSYvAmO9j4zD], [xafqLlk3kkUe(SXOLrMavuUCe(b"'\n\x1a'\x15pe"), chr(100) + '\x65' + chr(0b1100011) + chr(111) + chr(0b1100100) + chr(0b111001 + 0o54))(chr(117) + chr(0b1110100) + chr(0b11101 + 0o111) + '\x2d' + chr(0b110001 + 0o7))])
for kP4qaKv0ZkGv in [fuVZQYYmCmIL, KEN7VBM5yLnz, J0ccc3JgDPv_]:
xafqLlk3kkUe(MUaMiwsTdGeu, xafqLlk3kkUe(SXOLrMavuUCe(b'2\x1b\x18%\x1e`'), '\144' + chr(0b1100101) + chr(0b111010 + 0o51) + chr(0b1011110 + 0o21) + '\144' + chr(0b1100101))('\x75' + '\x74' + chr(0b1001 + 0o135) + chr(0b101101) + chr(56)))(YyaZ4tpXu4lf(xafqLlk3kkUe(kP4qaKv0ZkGv[cSYvAmO9j4zD], xafqLlk3kkUe(SXOLrMavuUCe(b'=\n\x1d\x19\x16Hq):}}\x8d'), chr(4050 - 3950) + '\x65' + chr(99) + chr(0b1101111) + chr(9400 - 9300) + chr(0b11010 + 0o113))(chr(117) + '\164' + chr(0b1100110) + chr(45) + chr(0b111000)))))
xafqLlk3kkUe(l6V0bqbLx_b9, xafqLlk3kkUe(SXOLrMavuUCe(b'2\x1b\x18%\x1e`'), '\144' + chr(0b11011 + 0o112) + chr(99) + chr(5195 - 5084) + '\144' + chr(0b10100 + 0o121))(chr(6234 - 6117) + chr(0b1000101 + 0o57) + '\146' + '\055' + chr(56)))(YyaZ4tpXu4lf(xafqLlk3kkUe(kP4qaKv0ZkGv[xafqLlk3kkUe(SXOLrMavuUCe(b"'\n\x1a'\x15pe"), chr(2043 - 1943) + chr(1572 - 1471) + chr(0b11111 + 0o104) + '\157' + chr(2894 - 2794) + '\x65')(chr(117) + chr(0b1110100) + '\x66' + chr(0b100000 + 0o15) + chr(0b111000))], xafqLlk3kkUe(SXOLrMavuUCe(b'=\n\x1d\x19\x16Hq):}}\x8d'), chr(100) + '\x65' + chr(5239 - 5140) + chr(0b1010010 + 0o35) + chr(7056 - 6956) + chr(101))(chr(0b1010101 + 0o40) + '\164' + '\146' + chr(45) + chr(0b11 + 0o65)))))
nHdeL8JC2SEC = n4ljua2gi1Pr.CeyMIoSyrpkQ[cSYvAmO9j4zD]
HHpQzG13Xmp7 = n4ljua2gi1Pr.CeyMIoSyrpkQ[xafqLlk3kkUe(SXOLrMavuUCe(b"'\n\x1a'\x15pe"), chr(0b1100100) + chr(101) + chr(0b1100011) + '\157' + chr(0b101110 + 0o66) + chr(0b1100101))(chr(117) + '\x74' + '\x66' + chr(0b101101) + chr(0b111000))]
S2d3tWjjt3Wy = pVmed7U5DpuL(MUaMiwsTdGeu, nHdeL8JC2SEC)
dNEMNGEup3WB = pVmed7U5DpuL(l6V0bqbLx_b9, HHpQzG13Xmp7)
S7Hxucg7jlZk = {cSYvAmO9j4zD: S2d3tWjjt3Wy, xafqLlk3kkUe(SXOLrMavuUCe(b"'\n\x1a'\x15pe"), chr(0b101101 + 0o67) + chr(0b10001 + 0o124) + chr(0b1100011) + chr(0b1101111) + chr(0b1100100) + chr(101))('\x75' + '\x74' + chr(0b1100110) + '\055' + chr(0b111000)): dNEMNGEup3WB}
return (_H7HhX1OiYNO, yXL7lYDLbCr_, S7Hxucg7jlZk, CZW_z9Phwam0)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.