Sha256: 4ff28c0bec443366e5b7eacf6bafeb14a602dbc01055c1fe191c7b0345c59dba

Contents?: true

Size: 1.31 KB

Versions: 9

Compression:

Stored size: 1.31 KB

Contents

#pragma once
#include "LDA.h"

namespace tomoto
{
	template<TermWeight _tw>
	struct DocumentHLDA : public DocumentLDA<_tw>
	{
		using BaseDocument = DocumentLDA<_tw>;
		using WeightType = typename DocumentLDA<_tw>::WeightType;
		using DocumentLDA<_tw>::DocumentLDA;

		// numByTopic indicates numByLevel in HLDAModel.
		// Zs indicates level in HLDAModel.
		std::vector<int32_t> path;

		template<typename _TopicModel> void update(WeightType* ptr, const _TopicModel& mdl);

		DEFINE_SERIALIZER_AFTER_BASE_WITH_VERSION(BaseDocument, 0, path);
		DEFINE_TAGGED_SERIALIZER_AFTER_BASE_WITH_VERSION(BaseDocument, 1, 0x00010001, path);
	};

	struct HLDAArgs : public LDAArgs
	{
		Float gamma = 0.1;

		HLDAArgs()
		{
			k = 2;
		}
	};

	class IHLDAModel : public ILDAModel
	{
	public:
		using DefaultDocType = DocumentHLDA<TermWeight::one>;
		static IHLDAModel* create(TermWeight _weight, const HLDAArgs& args,
			bool scalarRng = false);

		virtual Float getGamma() const = 0;
		virtual size_t getLiveK() const = 0;
		virtual size_t getLevelDepth() const = 0;
		virtual bool isLiveTopic(Tid tid) const = 0;
		virtual size_t getNumDocsOfTopic(Tid tid) const = 0;
		virtual size_t getLevelOfTopic(Tid tid) const = 0;
		virtual size_t getParentTopicId(Tid tid) const = 0;
		virtual std::vector<uint32_t> getChildTopicId(Tid tid) const = 0;
	};
}

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
tomoto-0.4.0 vendor/tomotopy/src/TopicModel/HLDA.h
tomoto-0.3.3 vendor/tomotopy/src/TopicModel/HLDA.h
tomoto-0.3.2 vendor/tomotopy/src/TopicModel/HLDA.h
tomoto-0.3.1 vendor/tomotopy/src/TopicModel/HLDA.h
tomoto-0.3.0 vendor/tomotopy/src/TopicModel/HLDA.h
tomoto-0.2.3 vendor/tomotopy/src/TopicModel/HLDA.h
tomoto-0.2.2 vendor/tomotopy/src/TopicModel/HLDA.h
tomoto-0.2.1 vendor/tomotopy/src/TopicModel/HLDA.h
tomoto-0.2.0 vendor/tomotopy/src/TopicModel/HLDA.h