Skip to content
This repository was archived by the owner on Dec 26, 2018. It is now read-only.
This repository was archived by the owner on Dec 26, 2018. It is now read-only.

some modify to accelerate the train function #13

@younfor

Description

@younfor

in file "paramservermodel.py"
int function def train(self, labels, features):

for i in range(len(self.compute_gradients)):

    #     self.gradients[
    #         i] += self.compute_gradients[i][0].eval(feed_dict=feed)       

because its not necessary to use "for" in this code, replaced by:

grads, test_error_rate = self.session.run([self.compute_gradients,self.error_rate],feed_dict=feed)
self.gradients[:] = [g[0] for g in grads]

this will save several times of gpu train, especial in mnist one iter time from 7ms to 1ms in my computer

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions