2bfe5bfcec7759ae022b1a479411aa7d1b8401f1,example/example7.py,,,#,26
Before Change
pool_layer = 1
subset_vec_all_layers = []
common = {
"model_dir": "//data/cips/data/lab/data/model/uncased_L-12_H-768_A-12",
"num_worker": 2,
"num_repeat": 5,
"port": 6006,
"port_out": 6007,
"max_seq_len": 20,
"client_batch_size": 2048,
"max_batch_size": 256,
"num_client": 1,
"pooling_strategy": PoolingStrategy.REDUCE_MEAN,
"pooling_layer": [-2],
"gpu_memory_fraction": 0.5,
"xla": False,
"cpu": False,
"verbose": False,
"device_map": []
}
args = namedtuple("args_namedtuple", ",".join(common.keys()))
for k, v in common.items():
setattr(args, k, v)
for pool_layer in range(1, 13):
setattr(args, "pooling_layer", [-pool_layer])
server = BertServer(args)
server.start()
After Change
//load bert vectors and labels
subset_vec_all_layers = np.load("example7_5k_mxnet.npy")
np_subset_label = np.load("example7_5k_mxnet_subset_label.npy")
subset_label = np_subset_label.tolist()
//=========================== visulize ===========================
def vis(embed, vis_alg="PCA", pool_alg="REDUCE_MEAN"):
plt.close()
fig = plt.figure()
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 5
Instances
Project Name: hanxiao/bert-as-service
Commit Name: 2bfe5bfcec7759ae022b1a479411aa7d1b8401f1
Time: 2019-05-06
Author: zyn2122@gmail.com
File Name: example/example7.py
Class Name:
Method Name:
Project Name: Hironsan/anago
Commit Name: bbfbf8def4a89dd860d305267bf2797ed3df69ce
Time: 2018-03-04
Author: light.tree.1.13@gmail.com
File Name: tests/test_tagger.py
Class Name: TaggerTest
Method Name: setUpClass
Project Name: OpenNMT/OpenNMT-py
Commit Name: 301b0cbf78e3de174a50fff682e142c985b3ae88
Time: 2017-02-22
Author: alerer@fb.com
File Name: OpenNMT/train.py
Class Name:
Method Name: main