/\_/\ /\_/\
- =( owo )= =( owo )=
\ ) ( ) ( //
\(_ _ _) (_ _ _)//
- C
/\_/\ /\_/\
- =( owo )= =( owo )=
\ ) ( ) ( //
\(_ _ _) (_ _ _)//
layer { | |
name: "train-data" | |
type: "Data" | |
top: "data" | |
top: "label" | |
include { | |
phase: TRAIN | |
} | |
transform_param { | |
mirror: true |
def triplet_loss(anchor, positive, negative, alpha): | |
"""Calculate the triplet loss according to the FaceNet paper | |
Args: | |
anchor: the embeddings for the anchor images. | |
positive: the embeddings for the positive images. | |
negative: the embeddings for the negative images. | |
Returns: | |
the triplet loss according to the FaceNet paper as a float tensor. |
def triplet_loss_soft(anchor, positive, negative, m=1): | |
"""Calculate the triplet loss according to the FaceNet paper | |
Args: | |
anchor: the embeddings for the anchor images. | |
positive: the embeddings for the positive images. | |
negative: the embeddings for the negative images. | |
Returns: | |
the triplet loss according to the FaceNet paper as a float tensor. |
from collections import defaultdict | |
import numpy as np | |
import pdb | |
from IPython import embed | |
sky = defaultdict(list) | |
def find_tuple(pts, tgts): | |
idx = [] |
This toolset provides channel level pruning of inception-renet v2 model( the details of inception resnet v2 model, please refer to .. _Inception-ResnetV2: https://arxiv.org/abs/1602.07261
from __future__ import absolute_import | |
from __future__ import division | |
from __future__ import print_function | |
import tensorflow as tf | |
import numpy as np | |
import pickle | |
from tensorflow.core.framework import attr_value_pb2 | |
from tensorflow.core.framework import graph_pb2 | |
from tensorflow.core.framework import node_def_pb2 |
from __future__ import absolute_import | |
from __future__ import division | |
from __future__ import print_function | |
import tensorflow as tf | |
import numpy as np | |
import pickle | |
from tensorflow.core.framework import attr_value_pb2 | |
from tensorflow.core.framework import graph_pb2 | |
from tensorflow.core.framework import node_def_pb2 |
[{"query": "china economy", "res": [{"contributors": null, "truncated": false, "text": "RT @KatiePilbeamIG: China's economy in 2017. https://t.co/v78JbOzr6x", "is_quote_status": true, "in_reply_to_status_id": null, "id": 814461641647685632, "favorite_count": 0, "entities": {"symbols": [], "user_mentions": [{"id": 702832773988544512, "indices": [3, 18], "id_str": "702832773988544512", "screen_name": "KatiePilbeamIG", "name": "Katie"}], "hashtags": [], "urls": [{"url": "https://t.co/v78JbOzr6x", "indices": [45, 68], "expanded_url": "https://twitter.com/IGTV/status/814424627523022849", "display_url": "twitter.com/IGTV/status/81\u2026"}]}, "quoted_status_id": 814424627523022849, "retweeted": false, "coordinates": null, "source": "<a href=\"http://twitter.com/download/android\" rel=\"nofollow\">Twitter for Android</a>", "in_reply_to_screen_name": null, "in_reply_to_user_id": null, "retweet_count": 1, "id_str": "814461641647685632", "favorited": false, "retweeted_status": {"contributors": null, "truncated": false, |
[{"query": "now2016 nowladygaga", "res": [{"contributors": null, "truncated": false, "text": "RT @suporteladygaga: MONSTERS VOTANDO\n#NOW2016 #NOWLadyGaga https://t.co/SpCM7zFBpB", "is_quote_status": false, "in_reply_to_status_id": null, "id": 814453454659796992, "favorite_count": 0, "entities": {"symbols": [], "user_mentions": [{"id": 882160322, "indices": [3, 19], "id_str": "882160322", "screen_name": "suporteladygaga", "name": "Suporte Lady Gaga"}], "hashtags": [{"indices": [38, 46], "text": "NOW2016"}, {"indices": [47, 59], "text": "NOWLadyGaga"}], "urls": [], "media": [{"source_user_id": 882160322, "source_status_id_str": "814296174777798656", "expanded_url": "https://twitter.com/suporteladygaga/status/814296174777798656/photo/1", "display_url": "pic.twitter.com/SpCM7zFBpB", "url": "https://t.co/SpCM7zFBpB", "media_url_https": "https://pbs.twimg.com/media/C0z2CMqXAAA0Vom.jpg", "source_user_id_str": "882160322", "source_status_id": 814296174777798656, "id_str": "814296150266281984", "sizes": {"large": {"h |