#vulnerable code 
                                float hierarchicalSoftmax(int target, float lr) {
        float loss = 0.0f;
        grad_.zero();
        IntVector binaryCode = codes.get(target);
        IntVector pathToRoot = paths.get(target);
        for (int i = 0; i < pathToRoot.size(); i++) {
            loss += binaryLogistic(pathToRoot.get(i), binaryCode.get(i) == 1, lr);
        }
        return loss;
    } 
                            #location 7 
                            #vulnerability type THREAD_SAFETY_VIOLATION
#fixed code
                                Model(Matrix wi,
          Matrix wo,
          Args args,
          int seed) {
        hidden_ = new Vector(args.dim);
        output_ = new Vector(wo.m_);
        grad_ = new Vector(args.dim);
        random = new Random(seed);
        wi_ = wi;
        wo_ = wo;
        args_ = args;
        isz_ = wi.m_;
        osz_ = wo.m_;
        hsz_ = args.dim;
        negpos = 0;
        loss_ = 0.0f;
        nexamples_ = 1;
    }