Create deephashloss.py
parent
52663edf60
commit
9323b1478a
|
@ -0,0 +1,6 @@
|
|||
# do binarize
|
||||
if self.config["Global"].get("feature_binarize") == "round":
|
||||
batch_feas = paddle.round(batch_feas).astype("float32") * 2.0 - 1.0
|
||||
|
||||
if self.config["Global"].get("feature_binarize") == "sign":
|
||||
batch_feas = paddle.sign(batch_feas).astype("float32")
|
Loading…
Reference in New Issue