From f689ce5d39c6f1475dfc71503288ea2905c8f685 Mon Sep 17 00:00:00 2001 From: zachcp Date: Fri, 15 Nov 2024 02:30:15 -0500 Subject: Documentation Pass for Models (#2617) * links in chinese_clip * links for clip model * add mod docs for flux and llava * module doc for MMDIT and MIMI * add docs for a few more modesl * mod docs for bert naser and beit * add module docs for convmixer colpali codegeex and chatglm * add another series of moddocs * add fastvit-llama2_c * module docs mamba -> mobileone * module docs from moondream-phi3 * mod docs for quantized and qwen * update to yi * fix long names * Update llama2_c.rs * Update llama2_c_weights.rs * Fix the link for mimi + tweaks --------- Co-authored-by: Laurent Mazare --- candle-transformers/src/models/vit.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'candle-transformers/src/models/vit.rs') diff --git a/candle-transformers/src/models/vit.rs b/candle-transformers/src/models/vit.rs index 3be72bf5..49ab4630 100644 --- a/candle-transformers/src/models/vit.rs +++ b/candle-transformers/src/models/vit.rs @@ -1,3 +1,20 @@ +//! Vision Transformer (ViT) implementation. +//! +//! Vision Transformer applies transformer architecture to image classification +//! by splitting images into patches and processing them as a sequence. +//! +//! Key characteristics: +//! - Image patches as sequence tokens +//! - Self-attention between patches +//! - Position embeddings +//! - CLS token for classification +//! - Layer normalization +//! +//! References: +//! - [ViT Paper](https://arxiv.org/abs/2010.11929) +//! - [Model Card](https://huggingface.co/google/vit-base-patch16-224) +//! + use crate::models::with_tracing::{conv2d, linear, linear_no_bias, Conv2d, Linear}; use candle::{IndexOp, Module, Result, Tensor, D}; use candle_nn::{layer_norm, LayerNorm, VarBuilder}; -- cgit v1.2.3