Java Code Examples for com.jstarcraft.ai.data.DataModule#getOuterKeyValue()

The following examples show how to use com.jstarcraft.ai.data.DataModule#getOuterKeyValue() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DeepFMModel.java    From jstarcraft-rns with Apache License 2.0 5 votes vote down vote up
@Override
public void prepare(Configurator configuration, DataModule model, DataSpace space) {
    super.prepare(configuration, model, space);
    learnRatio = configuration.getFloat("recommender.iterator.learnrate");
    momentum = configuration.getFloat("recommender.iterator.momentum");
    weightRegularization = configuration.getFloat("recommender.weight.regularization");
    this.marker = model;

    // TODO 此处需要重构,外部索引与内部索引的映射转换
    dimensionSizes = new int[model.getQualityOrder()];
    for (int orderIndex = 0, orderSize = model.getQualityOrder(); orderIndex < orderSize; orderIndex++) {
        Entry<Integer, KeyValue<String, Boolean>> term = model.getOuterKeyValue(orderIndex);
        dimensionSizes[model.getQualityInner(term.getValue().getKey())] = space.getQualityAttribute(term.getValue().getKey()).getSize();
    }
}
 
Example 2
Source File: DeepFMModel.java    From jstarcraft-rns with Apache License 2.0 5 votes vote down vote up
@Override
public void prepare(Configurator configuration, DataModule model, DataSpace space) {
    super.prepare(configuration, model, space);
    learnRatio = configuration.getFloat("recommender.iterator.learnrate");
    momentum = configuration.getFloat("recommender.iterator.momentum");
    weightRegularization = configuration.getFloat("recommender.weight.regularization");
    this.marker = model;

    // TODO 此处需要重构,外部索引与内部索引的映射转换
    dimensionSizes = new int[model.getQualityOrder()];
    for (int orderIndex = 0, orderSize = model.getQualityOrder(); orderIndex < orderSize; orderIndex++) {
        Entry<Integer, KeyValue<String, Boolean>> term = model.getOuterKeyValue(orderIndex);
        dimensionSizes[model.getQualityInner(term.getValue().getKey())] = space.getQualityAttribute(term.getValue().getKey()).getSize();
    }
}