Giter Site home page Giter Site logo

yl-1993 / hfsoftmax Goto Github PK

View Code? Open in Web Editor NEW
96.0 96.0 24.0 79 KB

Accelerated Training for Massive Classification via Dynamic Class Selection (AAAI 2018)

License: MIT License

Python 97.76% Shell 2.24%
aaai18 face-recognition large-scale-classification pytorch

hfsoftmax's People

Contributors

yl-1993 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hfsoftmax's Issues

Training loss abnormal

Hello, I am using a non-sampling training model, and the loss always changes within a small range[-0.5,0.5]. When using the hf_sample method, the network loss rapidly increases to nan. Does the sample method require a pre-trained model?

When the number of classes is nearly 1 million, how to implement the hash forest?

Hi, when the number of classes is nearly 100k(MS-Celeb-1M), i think annoy could build hash forest in an acceptable time.
But as the number of classes becomes larger, considered as a "massive classification", nearly 1 million, the HF building time seems unacceptable(I tried annoy building a 1 million features and set n_trees = 100, feat_dim = 2048, it costs ~22 minutes).
So is there a solution, or do you have any advice?
Thank you!

about Feature Extraction

Hello, I am a beginner, trying to extract features, can you tell me what the three parameters prefix, filelist, load_path mean?

Problems about the training

Hi, I have two problems about the hfsoftmax

  1. The sampler works from the beginning of training process, while the CPk (for example, top 1000) is very low at the beginning, how to ensure it works?
  2. The adaptive allocation scheme not release the code ? only see sample_num=1000,

‘get_value_by_rows’ Fall into an infinite loop

Hi, It's a great work. When I am using the sampling layer(hnsw_sampler.py), the program runs to 'update_hf ' function, falls into an infinite loop in 'get_value_by_rows', and cannot enter the conditional judgment. Part of the code is as follows:
#####################################################
while True:
sockets = dict(self._poll.poll(1000))
if self._socket in sockets:
msg = self._socket.recv()
if not meta:
meta = json.loads(msg)
else:
data = np.frombuffer(msg, dtype=meta['dtype'])
return data.reshape(meta['shape'])
#####################################################

text classification

your idea is very good! I am curious whether this method can be used for text classification?

TypeError: conv2d(): argument 'input' (position 1) must be Tensor, not list

File "/home/adam/anaconda3/envs/torch04/lib/python3.6/site-packages/torch/nn/modules/conv.py", line 303, in forward
self.padding, self.dilation, self.groups)
TypeError: conv2d(): argument 'input' (position 1) must be Tensor, not list

Here, the convolution operation will report an error. You should enter a tensor. Actually enter a list composed of two tensors. I want to ask the author how to solve it.

'Unsupported msg type'

def _recv(self):
    # TODO: 
    #   1. use logging to better log server info
    #   2. better exception handling
    print('waiting for message ... ')
    packet = self._socket.recv_multipart()
    print(packet)
    print(len(packet))
    if len(packet) == 2:
        ident, msg = packet
        msg = self._parse_json(msg)
    elif len(packet) == 4:
        ident, msg, meta, data = packet
        msg, meta = map(self._parse_json, [msg, meta])
        if msg['op'] == 'set_matrix':
            msg['data'] = self._buf_to_ndarray(data, meta)
        else:
            msg['rows'] = self._buf_to_ndarray(data, meta)
    elif len(packet) == 6:
        ident, msg, rows_meta, rows_data, val_meta, val_data = packet
        msg, rows_meta, val_meta = map(self._parse_json, [msg, rows_meta, val_meta])
        msg['rows'] = self._buf_to_ndarray(rows_data, rows_meta)
        msg['data'] = self._buf_to_ndarray(val_data, val_meta)
    else:
        raise RuntimeError('Unsupported msg type')
    self.handle(ident, msg)

always raise an error: RuntimeError('Unsupported msg type')
I find where the error shows up, but don't why?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.