Loading [MathJax]/jax/output/CommonHTML/config.js
前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >专栏 >littlevgl(Lvgl)最新版V7.4移植

littlevgl(Lvgl)最新版V7.4移植

作者头像
杨永贞
发布于 2020-09-02 11:19:53
发布于 2020-09-02 11:19:53
3.5K00
代码可运行
举报
运行总次数:0
代码可运行

LittleVGL最新已经更新到V7,网上大多数移植教程的版本比较老,很多特性没有,界面也不够酷炫。

原子最近更新的 LittleVGL 教程则是基于V6版本的,基本上搬过来全是报错,无法参考。新旧版本一致还是有很大区别的,这里介绍下最新版本的移植要点,针对嵌入式linux的framebuffer(dev/fb0)移植。

当然最最新的版本是V7.4.0,源码可以在github下载https://github.com/lvgl/lvgl

关于lvgl的官网及介绍,在https://lvgl.io,Online demo:https://lvgl.io/demos,Docs:https://docs.lvgl.io

移植比较简单,主要区别是几个接口跟老版本的不一样了。不过最终都是实现disp_flush显示驱动接口即可。

接口原型新版本的是这样的:

void disp_flush(lv_disp_drv_t * disp_drv, const lv_area_t * area, lv_color_t * color_p)

移植说明:

新建个工程文件夹,我这取名叫test,

然后在test文件夹下新建个lvgl文件夹,把下载到的源码中的src文件夹整个拷贝出来放进去。

把lv_conf_template.h拷贝出来,到工程的文件夹下,重命名为lv_conf.h.

编辑下,根据实际情况改下相关的配置:

#define LV_HOR_RES_MAX (480) #define LV_VER_RES_MAX (272) #define LV_COLOR_DEPTH 16 #define LV_USE_GPU 0

/* 1: Enable file system (might be required for images */ #define LV_USE_FILESYSTEM 1 。。。

在工程的文件夹下建个lv_drivers文件夹,用于实现的驱动文件。

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
/**
 * @file fbdev.c
 *
 */

/*********************
 *      INCLUDES
 *********************/
#include "fbdev.h"
#if USE_FBDEV

#include <stdlib.h>
#include <unistd.h>
#include <stddef.h>
#include <stdio.h>
#include <fcntl.h>
#include <linux/fb.h>
#include <sys/mman.h>
#include <sys/ioctl.h>

/*********************
 *      DEFINES
 *********************/
#ifndef FBDEV_PATH
#define FBDEV_PATH  "/dev/fb0"
#endif

/**********************
 *      TYPEDEFS
 **********************/

/**********************
 *  STATIC PROTOTYPES
 **********************/

/**********************
 *  STATIC VARIABLES
 **********************/
static struct fb_var_screeninfo vinfo;
static struct fb_fix_screeninfo finfo;
static char *fbp = 0;
static long int screensize = 0;
static int fbfd = 0;

/**********************
 *      MACROS
 **********************/

/**********************
 *   GLOBAL FUNCTIONS
 **********************/

void fbdev_init(void)
{
    // Open the file for reading and writing
    fbfd = open(FBDEV_PATH, O_RDWR);
    if (fbfd == -1) {
        perror("Error: cannot open framebuffer device");
        return;
    }
    printf("The framebuffer device was opened successfully.\n");

    // Get fixed screen information
    if (ioctl(fbfd, FBIOGET_FSCREENINFO, &finfo) == -1) {
        perror("Error reading fixed information");
        return;
    }

    // Get variable screen information
    if (ioctl(fbfd, FBIOGET_VSCREENINFO, &vinfo) == -1) {
        perror("Error reading variable information");
        return;
    }

    printf("%dx%d, %dbpp\n", vinfo.xres, vinfo.yres, vinfo.bits_per_pixel);

    // Figure out the size of the screen in bytes
    screensize = vinfo.xres * vinfo.yres * vinfo.bits_per_pixel / 8;

    // Map the device to memory
    fbp = (char *)mmap(0, screensize, PROT_READ | PROT_WRITE, MAP_SHARED, fbfd, 0);
    if ((int)fbp == -1) {
        perror("Error: failed to map framebuffer device to memory");
        return;
    }
    printf("The framebuffer device was mapped to memory successfully.\n");

}


/**
 * Flush a buffer to the marked area
 * @param x1 left coordinate
 * @param y1 top coordinate
 * @param x2 right coordinate
 * @param y2 bottom coordinate
 * @param color_p an array of colors
 */
void fbdev_flush(int32_t x1, int32_t y1, int32_t x2, int32_t y2, const lv_color_t * color_p)
{
    if(fbp == NULL) return;

    /*Return if the area is out the screen*/
    if(x2 < 0) return;
    if(y2 < 0) return;
    if(x1 > vinfo.xres - 1) return;
    if(y1 > vinfo.yres - 1) return;

    /*Truncate the area to the screen*/
    int32_t act_x1 = x1 < 0 ? 0 : x1;
    int32_t act_y1 = y1 < 0 ? 0 : y1;
    int32_t act_x2 = x2 > vinfo.xres - 1 ? vinfo.xres - 1 : x2;
    int32_t act_y2 = y2 > vinfo.yres - 1 ? vinfo.yres - 1 : y2;

    long int location = 0;

    /*32 or 24 bit per pixel*/
    if(vinfo.bits_per_pixel == 32 || vinfo.bits_per_pixel == 24) {
        uint32_t *fbp32 = (uint32_t*)fbp;
        uint32_t x;
        uint32_t y;
        for(y = act_y1; y <= act_y2; y++) {
            for(x = act_x1; x <= act_x2; x++) {
                location = (x+vinfo.xoffset) + (y+vinfo.yoffset) * vinfo.xres;
                fbp32[location] = color_p->full;
                color_p++;
            }

            color_p += x2 - act_x2;
        }
    }
    /*16 bit per pixel*/
    else if(vinfo.bits_per_pixel == 16) {
        uint16_t *fbp16 = (uint16_t*)fbp;
        uint32_t x;
        uint32_t y;
        for(y = act_y1; y <= act_y2; y++) {
            for(x = act_x1; x <= act_x2; x++) {
                location = (x+vinfo.xoffset) + (y+vinfo.yoffset) * vinfo.xres;
                fbp16[location] = color_p->full;
                color_p++;
            }

            color_p += x2 - act_x2;
        }
    }
    /*8 bit per pixel*/
    else if(vinfo.bits_per_pixel == 8) {
        uint8_t *fbp8 = (uint8_t*)fbp;
        uint32_t x;
        uint32_t y;
        for(y = act_y1; y <= act_y2; y++) {
            for(x = act_x1; x <= act_x2; x++) {
                location = (x+vinfo.xoffset) + (y+vinfo.yoffset) * vinfo.xres;
                fbp8[location] = color_p->full;
                color_p++;
            }

            color_p += x2 - act_x2;
        }
    } else {
        /*Not supported bit per pixel*/
    }

    //May be some direct update command is required
    //ret = ioctl(state->fd, FBIO_UPDATE, (unsigned long)((uintptr_t)rect));

    //lv_flush_ready();
    /* IMPORTANT!!!
     * Inform the graphics library that you are ready with the flushing*/
}

/* Flush the content of the internal buffer the specific area on the display
 * You can use DMA or any hardware acceleration to do this operation in the background but
 * 'lv_disp_flush_ready()' has to be called when finished. */
void disp_flush(lv_disp_drv_t * disp_drv, const lv_area_t * area, lv_color_t * color_p)
{
    /* IMPORTANT!!!
     * Inform the graphics library that you are ready with the flushing*/
    fbdev_flush(area->x1,area->y1,area->x2,area->y2,color_p);
    lv_disp_flush_ready(disp_drv);
}

/**
 * Fill out the marked area with a color
 * @param x1 left coordinate
 * @param y1 top coordinate
 * @param x2 right coordinate
 * @param y2 bottom coordinate
 * @param color fill color
 */
void fbdev_fill(int32_t x1, int32_t y1, int32_t x2, int32_t y2, lv_color_t color)
{
    if(fbp == NULL) return;

    /*Return if the area is out the screen*/
    if(x2 < 0) return;
    if(y2 < 0) return;
    if(x1 > vinfo.xres - 1) return;
    if(y1 > vinfo.yres - 1) return;

    /*Truncate the area to the screen*/
    int32_t act_x1 = x1 < 0 ? 0 : x1;
    int32_t act_y1 = y1 < 0 ? 0 : y1;
    int32_t act_x2 = x2 > vinfo.xres - 1 ? vinfo.xres - 1 : x2;
    int32_t act_y2 = y2 > vinfo.yres - 1 ? vinfo.yres - 1 : y2;

    uint32_t x;
    uint32_t y;

    long int location = 0;

    /*32 or 24 bit per pixel*/
    if(vinfo.bits_per_pixel == 32 || vinfo.bits_per_pixel == 24) {
        uint32_t *fbp32 = (uint32_t*)fbp;
        for(x = act_x1; x <= act_x2; x++) {
            for(y = act_y1; y <= act_y2; y++) {
                location = (x+vinfo.xoffset) + (y+vinfo.yoffset) * vinfo.xres;
                fbp32[location] = color.full;
            }
        }
    }
    else if(vinfo.bits_per_pixel == 16) {
        uint16_t *fbp16 = (uint16_t*)fbp;
        for(x = act_x1; x <= act_x2; x++) {
            for(y = act_y1; y <= act_y2; y++) {
                location = (x+vinfo.xoffset) + (y+vinfo.yoffset) * vinfo.xres;
                fbp16[location] = color.full;
            }
        }
    }
    else if(vinfo.bits_per_pixel == 8) {
        uint8_t *fbp8 = (uint8_t*)fbp;
        for(x = act_x1; x <= act_x2; x++) {
            for(y = act_y1; y <= act_y2; y++) {
                location = (x+vinfo.xoffset) + (y+vinfo.yoffset) * vinfo.xres;
                fbp8[location] = color.full;
            }
        }
    } else {
        /*Not supported bit per pixel*/
    }

    //May be some direct update command is required
    //ret = ioctl(state->fd, FBIO_UPDATE, (unsigned long)((uintptr_t)rect));

}

/**
 * Put a color map to the marked area
 * @param x1 left coordinate
 * @param y1 top coordinate
 * @param x2 right coordinate
 * @param y2 bottom coordinate
 * @param color_p an array of colors
 */
void fbdev_map(int32_t x1, int32_t y1, int32_t x2, int32_t y2, const lv_color_t * color_p)
{

    if(fbp == NULL) return;

    /*Return if the area is out the screen*/
    if(x2 < 0) return;
    if(y2 < 0) return;
    if(x1 > vinfo.xres - 1) return;
    if(y1 > vinfo.yres - 1) return;

    /*Truncate the area to the screen*/
    int32_t act_x1 = x1 < 0 ? 0 : x1;
    int32_t act_y1 = y1 < 0 ? 0 : y1;
    int32_t act_x2 = x2 > vinfo.xres - 1 ? vinfo.xres - 1 : x2;
    int32_t act_y2 = y2 > vinfo.yres - 1 ? vinfo.yres - 1 : y2;

    long int location = 0;

    /*32 or 24 bit per pixel*/
    if(vinfo.bits_per_pixel == 32 || vinfo.bits_per_pixel == 24) {
        uint32_t *fbp32 = (uint32_t*)fbp;
        uint32_t x;
        uint32_t y;
        for(y = act_y1; y <= act_y2; y++) {
            for(x = act_x1; x <= act_x2; x++) {
                location = (x+vinfo.xoffset) + (y+vinfo.yoffset) * vinfo.xres;
                fbp32[location] = color_p->full;
                color_p++;
            }

            color_p += x2 - act_x2;
        }
    }
    /*16 bit per pixel*/
    else if(vinfo.bits_per_pixel == 16) {
        uint16_t *fbp16 = (uint16_t*)fbp;
        uint32_t x;
        uint32_t y;
        for(y = act_y1; y <= act_y2; y++) {
            for(x = act_x1; x <= act_x2; x++) {
                location = (x+vinfo.xoffset) + (y+vinfo.yoffset) * vinfo.xres;
                fbp16[location] = color_p->full;
                color_p++;
            }

            color_p += x2 - act_x2;
        }
    }
    /*8 bit per pixel*/
    else if(vinfo.bits_per_pixel == 8) {
        uint8_t *fbp8 = (uint8_t*)fbp;
        uint32_t x;
        uint32_t y;
        for(y = act_y1; y <= act_y2; y++) {
            for(x = act_x1; x <= act_x2; x++) {
                location = (x+vinfo.xoffset) + (y+vinfo.yoffset) * vinfo.xres;
                fbp8[location] = color_p->full;
                color_p++;
            }

            color_p += x2 - act_x2;
        }
    } else {
        /*Not supported bit per pixel*/
    }

    //May be some direct update command is required
    //ret = ioctl(state->fd, FBIO_UPDATE, (unsigned long)((uintptr_t)rect));
}


/**********************
 *   STATIC FUNCTIONS
 **********************/

#endif

附上一个小测试demo:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
#include "lvgl.h"
#include "lv_drivers/display/fbdev.h"
#include <unistd.h>
//#include "lv_examples/lv_apps/demo/demo.h"

static lv_disp_buf_t disp_buf_2;
static lv_color_t buf2_1[LV_HOR_RES_MAX * 10];                        /*A buffer for 10 rows*/
static lv_color_t buf2_2[LV_HOR_RES_MAX * 10];                        /*An other buffer for 10 rows*/
//extern void demo_create(void);
int main(void)
{
    /*LittlevGL init*/
    lv_init();

    /*Linux frame buffer device init*/
    fbdev_init();

    /*Add a display the LittlevGL sing the frame buffer driver*/
    lv_disp_drv_t disp_drv;
    lv_disp_drv_init(&disp_drv);

    disp_drv.flush_cb = disp_flush;
    /*Set a display buffer*/
    lv_disp_buf_init(&disp_buf_2, buf2_1, buf2_2, LV_HOR_RES_MAX * 10);   /*Initialize the display buffer*/
    disp_drv.buffer = &disp_buf_2;
    //disp_drv.disp_flush = fbdev_flush;      /*It flushes the internal graphical buffer to the frame buffer*/
    lv_disp_drv_register(&disp_drv);

    /*Create a "Hello world!" label*/
    lv_obj_t * label = lv_label_create(lv_scr_act(), NULL);
    lv_label_set_text(label, "hello worldaaa!v7.4");
    lv_obj_align(label, NULL, LV_ALIGN_CENTER, 0, 0);

    /*Handle LitlevGL tasks (tickless mode)*/
	
	//demo_create();
    while(1) {
        lv_tick_inc(5);
        lv_task_handler();
        usleep(5000);
    }

    return 0;
}

如何运行?直接make即可生成可执行文件。

附makefile文件:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
########################################
#makefile
########################################
#****************************************************************************
# Cross complie path
#****************************************************************************
CHAIN_ROOT= /home/yang/crosstool/ctools/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin
CROSS_COMPILE=$(CHAIN_ROOT)/arm-linux-gnueabihf-

#CROSS_COMPILE = 

CC     := $(CROSS_COMPILE)gcc
CXX    := $(CROSS_COMPILE)g++
AS	   := $(CROSS_COMPILE)as
AR     := $(CROSS_COMPILE)ar 
LD     := $(CROSS_COMPILE)ld
RANLIB := $(CROSS_COMPILE)ranlib
OBJDUMP:= $(CROSS_COMPILE)objdump
OBJCOPY:= $(CROSS_COMPILE)objcopy
STRIP  := $(CROSS_COMPILE)strip
#编译主程序
BINARY  := littlevgl
OBJ_DIR := ./

INCS := -I ./   -I./lvgl/src/
CFLAGS= -Wall -g  -std=c99 -fno-common -fsanitize=address  -fno-stack-protector -fno-omit-frame-pointer -fno-var-tracking 


#****************************************************************************
# Source files
#****************************************************************************
SRC_C=$(shell find . -name "*.c")

OBJ_C=$(patsubst %.c, %.o, $(SRC_C))

SRCS := $(SRC_C) $(SRC_C)

OBJS := $(OBJ_C) 
LDSCRIPT=  -lasan 
LDFLAGS= -Llibs  
#LDSCRIPT= -lNC_FileSys
#LDFLAGS= -Llib 

#SRC  = $(wildcard *.c)
#DIR  = $(notdir $(SRC))
#OBJS = $(patsubst %.c,$(OBJ_DIR)%.o,$(DIR))
#OBJS=  main.o myutils.o  inirw.o  cmdpboc.o cputest.o bustcp.o ansrec.o m1cmd.o m1api.o m1test.o upcash.o myother.o getsys.o
#CFLAGS=-std=c99
#@echo Building lib...
#$(call make_subdir)
.PHONY: clean 
all:  prebuild  $(BINARY)

prebuild:
	@echo Building app...

$(BINARY) : $(OBJS)
	@echo Generating ...
	$(CC) -o $(BINARY) $(OBJS) $(LDFLAGS) $(LDSCRIPT) 
	@echo OK!

$(OBJ_DIR)%.o : %.c
	$(CC) -c $(CFLAGS) $(INCS) $< -o  $@
	
clean:
	rm -f $(OBJ_DIR)*.o
	find . -name "*.[od]" |xargs rm
	@
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2020/09/01 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
暂无评论
推荐阅读
编辑精选文章
换一批
初学者指南:利用SVD创建推荐系统
作者:Mayukh Bhattacharyya 翻译:老齐 序言 你是否有过这样的经历:前一天晚上登录Netflix,观看了《星际穿越》,他们会建议你看《地心引力》。或者你在亚马逊上购买了东西,看到
老齐
2020/08/28
7070
初学者指南:利用SVD创建推荐系统
推荐系统实战-基于用户的协同过滤
1、数据集简介 MovieLens数据集包含多个用户对多部电影的评级数据,也包括电影元数据信息和用户属性信息。 这个数据集经常用来做推荐系统,机器学习算法的测试数据集。尤其在推荐系统领域,很多著名论文都是基于这个数据集的。(PS: 它是某次具有历史意义的推荐系统竞赛所用的数据集)。 下载地址为:http://files.grouplens.org/datasets/movielens/,有好几种版本,对应不同数据量,本文所用的数据为1M的数据。 2、数据介绍 1m的数据解压后,可以看到四个主要的csv文件,
石晓文
2018/04/11
2.6K1
推荐系统实战-基于用户的协同过滤
基于矩阵分解原理的推荐系统
矩阵分解是推荐系统系列中的一种算法,顾名思义,就是将矩阵分解成两个(或多个)矩阵,它们相乘后得到原始矩阵。在推荐系统中,我们通常从用户与项目之间的交互/评分矩阵开始,矩阵分解算法会将用户和项目特征矩阵分解,这也称为嵌入。下面以电影推荐中的评分,购买等矩阵为例。
老齐
2020/07/23
1.1K0
基于矩阵分解原理的推荐系统
【干货】基于协同过滤的推荐系统实战(附完整代码)
【导读】本文使用Python实现简单的推荐系统,分别实践了基于用户和基于商品的推荐系统,代码使用sklearn工具包实现。除了代码实现外,还分别从理论上介绍了两种推荐系统原理:User-Based Collaborative Filtering 和 Item-Based Collaborative Filtering,并讲解了几种常见的相似性度量方法及它们分别适用场景,还实现了推荐系统的评估。最终分析两种推荐系统的优劣,说明混合推荐技术可能具有更好的性能。 作者 | Chhavi Saluja 编译 | 专
WZEARW
2018/04/13
14.5K0
【干货】基于协同过滤的推荐系统实战(附完整代码)
推荐系统的PMF - 概率矩阵分解和协同过滤
自动化推荐系统通常用于根据现有的偏好数据为用户提供他们感兴趣的产品建议。文献中通常描述了不同类型的推荐系统。我们这篇文章将突出介绍两个主要类别,然后在第二个类别上进一步扩展:
deephub
2020/06/11
8260
第十七章 推荐系统
第一、仅仅因为它是机器学习中的一个重要的应用。在过去几年,我偶尔访问硅谷不同的技术公司,我常和工作在这儿致力于机器学习应用的人们聊天,我常问他们,最重要的机器学习的应用是什么,或者,你最想改进的机器学习应用有哪些。我最常听到的答案是推荐系统。现在,在硅谷有很多团体试图建立很好的推荐系统。因此,如果你考虑网站像亚马逊,或网飞公司或易趣,或iTunes Genius,有很多的网站或系统试图推荐新产品给用户。如,亚马逊推荐新书给你,网飞公司试图推荐新电影给你,等等。这些推荐系统,根据浏览你过去买过什么书,或过去评价过什么电影来判断。这些系统会带来很大一部分收入,比如像亚马逊和网飞这样的公司。因此,对推荐系统性能的改善,将对这些企业的有实质性和直接的影响。
tomas家的小拨浪鼓
2019/03/19
6180
第十七章 推荐系统
一文帮你梳理清楚:奇异值分解和矩阵分解 | 技术头条
【导读】在推荐系统的相关研究中,我们常常用到两个相关概念:矩阵分解和奇异值分解。这两个概念是同一种算法吗?两者到底有什么差别?在本文中,作者梳理了两种算法的概念、来源和内容,并进行了比较。通过对相关内容的梳理,作者提出,矩阵分解是推荐系统中最初使用的概念,奇异值分解是对该方法的进一步发展。在现在的讨论中,一般将两种方法统一成为奇异值分解。
AI科技大本营
2019/05/14
8270
一文帮你梳理清楚:奇异值分解和矩阵分解 | 技术头条
【推荐系统】推荐系统概述
许多人把推荐系统视为一种神秘的存在,他们觉得推荐系统似乎知道我们的想法是什么。Netflix 向我们推荐电影,还有亚马逊向我们推荐该买什么样的商品。推荐系统从早期发展到现在,已经得到了很大的改进和完善,以不断地提高用户体验。尽管推荐系统中许多都是非常复杂的系统,但其背后的基本思想依然十分简单。
黄博的机器学习圈子
2021/07/07
2K0
【推荐系统】推荐系统概述
推荐系统之矩阵分解模型
最近在整理Embedding技术在推荐系统中的应用,总结了获取各类item2vec的方法,推荐系统中的矩阵分解作为解决item2vec问题初期技术方法之一,虽已在推荐领域摸爬滚打了十几年,但至今仍旧在工业界的推荐场景中扮演着重要的角色,本文就对推荐系统中的矩阵分解进行简单的介绍,为后续几篇介绍推荐系统中的Embedding技术做铺垫。
流川枫
2020/04/24
1.5K0
[吴恩达机器学习笔记]16推荐系统5-6协同过滤算法/低秩矩阵分解/均值归一化
对推荐的结果进行预测,得到一个预测值的矩阵,这个矩阵的预测结果和用户评分数据矩阵 Y 中数据一一对应:
演化计算与人工智能
2020/08/14
9850
[吴恩达机器学习笔记]16推荐系统5-6协同过滤算法/低秩矩阵分解/均值归一化
独家 | 从零开始用python搭建推荐引擎(附代码)
当今社会的每个人都面临着各种各样的选择。例如,如果我漫无目的想找一本书读,那么关于我如何搜索就会出现很多可能。这样一来,我可能会浪费很多时间在网上浏览,并且在各种各样的网站上搜寻,希望能找到有价值的书籍。这个时候我可能寻找别人的推荐。
数据派THU
2018/12/05
1.9K0
【机器学习】从电影数据集到推荐系统
你们可能曾经花上几分钟甚至几个小时去选择一部电影单独看或者和家人一起看,不幸的是没有成功?你希望有人在这种时候替你做决定,这正是推荐系统的作用。
黄博的机器学习圈子
2021/07/07
3.3K1
【机器学习】从电影数据集到推荐系统
推荐系统之矩阵分解(MF)及其python实现
        目前推荐系统中用的最多的就是矩阵分解方法,在Netflix Prize推荐系统大赛中取得突出效果。以用户-项目评分矩阵为例,矩阵分解就是预测出评分矩阵中的缺失值,然后根据预测值以某种方式向用户推荐。今天以“用户-项目评分矩阵R(M×N)”说明矩阵分解方式的原理以及python实现。
Flaneur
2020/03/25
2.6K0
推荐系统基础:使用PyTorch进行矩阵分解进行动漫的推荐
我们一天会遇到很多次推荐——当我们决定在Netflix/Youtube上看什么,购物网站上的商品推荐,Spotify上的歌曲推荐,Instagram上的朋友推荐,LinkedIn上的工作推荐……列表还在继续!推荐系统的目的是预测用户对某一商品的“评价”或“偏好”。这些评级用于确定用户可能喜欢什么,并提出明智的建议。
deephub
2020/09/07
1.6K0
推荐系统基础:使用PyTorch进行矩阵分解进行动漫的推荐
开发|如何用深度学习推荐电影?手把手教你
简介 几乎所有人都喜欢与家人、朋友一起观看电影度过闲暇时光。大家可能都有过这样的体验:本想在接下来的两个小时里看一个电影,却坐在沙发上坐了20分钟不知道看什么,选择困难症又犯了,结果好心情也变得沮丧。所以,我们很需要一个电脑代理,在做挑选电影的时候提供推荐。 现在,电影智能推荐系统已经成为日常生活中的一部分。 Data Science Central 曾表示: “虽然硬数据很难获得,但知情人士估计,对亚马逊和Netflix这样的大型电商平台,推荐系统为它们带来高达10%至25%的收入增长”。 在这个项
AI科技评论
2018/03/13
1K0
开发|如何用深度学习推荐电影?手把手教你
如何使用矩阵分解提升推荐效果
推荐系统在现代互联网应用中扮演着至关重要的角色,无论是电商平台的商品推荐,还是流媒体平台的视频推荐,都离不开高效的推荐算法。矩阵分解技术,作为推荐系统中的一种经典方法,因其优越的性能而被广泛应用。矩阵分解技术的核心思想是将用户-物品交互矩阵分解为低维矩阵,以此来挖掘用户和物品的潜在特征,从而提升推荐效果。
数字扫地僧
2024/08/08
1690
协同过滤算法概述与python 实现协同过滤算法基于内容(usr-item,item-item)
协调过滤推荐概述   协同过滤(Collaborative Filtering)作为推荐算法中最经典的类型,包括在线的协同和离线的过滤两部分。所谓在线协同,就是通过在线数据找到用户可能喜欢的物品,而离线过滤,则是过滤掉一些不值得推荐的数据,比比如推荐值评分低的数据,或者虽然推荐值高但是用户已经购买的数据。   协同过滤的模型一般为m个物品,m个用户的数据,只有部分用户和部分数据之间是有评分数据的,其它部分评分是空白,此时我们要用已有的部分稀疏数据来预测那些空白的物品和数据之间的评分关系,找到最
学到老
2018/04/18
7.7K0
协同过滤算法概述与python 实现协同过滤算法基于内容(usr-item,item-item)
矩阵分解在协同过滤推荐算法中的应用
    在协同过滤推荐算法总结中,我们讲到了用矩阵分解做协同过滤是广泛使用的方法,这里就对矩阵分解在协同过滤推荐算法中的应用做一个总结。(过年前最后一篇!祝大家新年快乐!明年的目标是写120篇机器学习,深度学习和NLP相关的文章)
刘建平Pinard
2018/08/14
1.2K0
在Python中实现你自己的推荐系统
现今,推荐系统被用来个性化你在网上的体验,告诉你买什么,去哪里吃,甚至是你应该和谁做朋友。人们口味各异,但通常有迹可循。人们倾向于喜欢那些与他们所喜欢的东西类似的东西,并且他们倾向于与那些亲近的人有相似的口味。推荐系统试图捕捉这些模式,以助于预测你还会喜欢什么东西。电子商务、社交媒体、视频和在线新闻平台已经积极的部署了它们自己的推荐系统,以帮助它们的客户更有效的选择产品,从而实现双赢。 两种最普遍的推荐系统的类型是基于内容和协同过滤(CF)。协同过滤基于用户对产品的态度产生推荐,也就是说,它使用“人群的智慧
CDA数据分析师
2018/02/05
3K0
在Python中实现你自己的推荐系统
实战基于矩阵分解的推荐系统
设: U 为所有用户集合 P 为所有物品集合 R 为用户对物品的喜好程度 模型 Model(R) = U * P 算法核心: 通过用户对不同物品的打分,来预测用户对其他物品的喜好程度。此处并没有考虑用户和物品的属性,如:用户年龄,性别,学历,工作等,物品价格,品类,外观等。
周萝卜
2019/08/01
9300
实战基于矩阵分解的推荐系统
推荐阅读
相关推荐
初学者指南:利用SVD创建推荐系统
更多 >
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档
本文部分代码块支持一键运行,欢迎体验
本文部分代码块支持一键运行,欢迎体验