Sha256: 7aab23c044d7444abd1254256e2ed37738967d82ba01c8d6bd88a1ba81e2040a

Contents?: true

Size: 1.31 KB

Versions: 5

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);
	};

	class IHLDAModel : public ILDAModel
	{
	public:
		using DefaultDocType = DocumentHLDA<TermWeight::one>;
		static IHLDAModel* create(TermWeight _weight, size_t levelDepth = 1, 
			Float alpha = 0.1, Float eta = 0.01, Float gamma = 0.1, size_t seed = std::random_device{}(),
			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

5 entries across 5 versions & 1 rubygems

Version Path
tomoto-0.1.4 vendor/tomotopy/src/TopicModel/HLDA.h
tomoto-0.1.3 vendor/tomotopy/src/TopicModel/HLDA.h
tomoto-0.1.2 vendor/tomotopy/src/TopicModel/HLDA.h
tomoto-0.1.1 vendor/tomotopy/src/TopicModel/HLDA.h
tomoto-0.1.0 vendor/tomotopy/src/TopicModel/HLDA.h